diff --git a/src/Xhgui/Saver/MongoSaver.php b/src/Xhgui/Saver/MongoSaver.php index 09d12791d..a1f9e62dd 100644 --- a/src/Xhgui/Saver/MongoSaver.php +++ b/src/Xhgui/Saver/MongoSaver.php @@ -42,24 +42,11 @@ public function save(array $data) ]; $a = [ - '_id' => $data['_id'] ?? self::getLastProfilingId(), + '_id' => $data['_id'] ?? new MongoId(), 'meta' => $meta, 'profile' => $data['profile'], ]; return $this->_collection->insert($a, ['w' => 0]); } - - /** - * Return profiling ID - * @return MongoId lastProfilingId - */ - public static function getLastProfilingId() - { - if (!self::$lastProfilingId) { - self::$lastProfilingId = new MongoId(); - } - - return self::$lastProfilingId; - } } diff --git a/src/Xhgui/Saver/PdoSaver.php b/src/Xhgui/Saver/PdoSaver.php index 190731f26..b08f9d2c8 100644 --- a/src/Xhgui/Saver/PdoSaver.php +++ b/src/Xhgui/Saver/PdoSaver.php @@ -94,7 +94,7 @@ public function save(array $data) $usec = $ts['usec']; $this->stmt->execute([ - 'id' => Util::generateId(), + 'id' => $data['_id'] ?? Util::generateId(), 'profile' => json_encode($data['profile']), 'url' => $data['meta']['url'], 'SERVER' => json_encode($data['meta']['SERVER']),