Linux vmi2545633.contaboserver.net 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06) x86_64
Apache/2.4.62 (Debian)
Server IP : 127.0.0.1 & Your IP : 127.0.0.1
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
php /
tests /
mongodb /
tests /
cursor /
Delete
Unzip
Name
Size
Permission
Date
Action
bug0671-001.phpt
653
B
-rw-r--r--
2025-04-09 02:56
bug0732-001.phpt
934
B
-rw-r--r--
2025-04-09 02:56
bug0849-001.phpt
1013
B
-rw-r--r--
2025-04-09 02:56
bug0924-001.phpt
1.46
KB
-rw-r--r--
2025-04-09 02:56
bug0924-002.phpt
1.87
KB
-rw-r--r--
2025-04-09 02:56
bug1050-001.phpt
2.66
KB
-rw-r--r--
2025-04-09 02:56
bug1050-002.phpt
3.16
KB
-rw-r--r--
2025-04-09 02:56
bug1151-001.phpt
821
B
-rw-r--r--
2025-04-09 02:56
bug1151-002.phpt
924
B
-rw-r--r--
2025-04-09 02:56
bug1151-003.phpt
763
B
-rw-r--r--
2025-04-09 02:56
bug1151-004.phpt
866
B
-rw-r--r--
2025-04-09 02:56
bug1152-001.phpt
4.69
KB
-rw-r--r--
2025-04-09 02:56
bug1152-002.phpt
4.59
KB
-rw-r--r--
2025-04-09 02:56
bug1162-001.phpt
942
B
-rw-r--r--
2025-04-09 02:56
bug1274-001.phpt
2.16
KB
-rw-r--r--
2025-04-09 02:56
bug1274-002.phpt
3.32
KB
-rw-r--r--
2025-04-09 02:56
bug1274-003.phpt
2.85
KB
-rw-r--r--
2025-04-09 02:56
bug1274-004.phpt
2.24
KB
-rw-r--r--
2025-04-09 02:56
bug1274-005.phpt
3.39
KB
-rw-r--r--
2025-04-09 02:56
bug1274-006.phpt
2.93
KB
-rw-r--r--
2025-04-09 02:56
bug1419-001.phpt
1.18
KB
-rw-r--r--
2025-04-09 02:56
bug1529-001.phpt
3.18
KB
-rw-r--r--
2025-04-09 02:56
bug1713-001.phpt
472
B
-rw-r--r--
2025-04-09 02:56
cursor-001.phpt
355
B
-rw-r--r--
2025-04-09 02:56
cursor-IteratorIterator-001.phpt
827
B
-rw-r--r--
2025-04-09 02:56
cursor-IteratorIterator-002.phpt
1001
B
-rw-r--r--
2025-04-09 02:56
cursor-IteratorIterator-003.phpt
1020
B
-rw-r--r--
2025-04-09 02:56
cursor-NoRewindIterator-001.phpt
1.59
KB
-rw-r--r--
2025-04-09 02:56
cursor-destruct-001.phpt
1.56
KB
-rw-r--r--
2025-04-09 02:56
cursor-getmore-001.phpt
913
B
-rw-r--r--
2025-04-09 02:56
cursor-getmore-002.phpt
903
B
-rw-r--r--
2025-04-09 02:56
cursor-getmore-003.phpt
1.05
KB
-rw-r--r--
2025-04-09 02:56
cursor-getmore-004.phpt
1.04
KB
-rw-r--r--
2025-04-09 02:56
cursor-getmore-005.phpt
1.51
KB
-rw-r--r--
2025-04-09 02:56
cursor-getmore-006.phpt
1.65
KB
-rw-r--r--
2025-04-09 02:56
cursor-isDead-001.phpt
735
B
-rw-r--r--
2025-04-09 02:56
cursor-isDead-002.phpt
827
B
-rw-r--r--
2025-04-09 02:56
cursor-iterator-001.phpt
1.3
KB
-rw-r--r--
2025-04-09 02:56
cursor-iterator-002.phpt
1.25
KB
-rw-r--r--
2025-04-09 02:56
cursor-iterator-003.phpt
859
B
-rw-r--r--
2025-04-09 02:56
cursor-iterator-004.phpt
1.66
KB
-rw-r--r--
2025-04-09 02:56
cursor-iterator_handlers-001.phpt
2
KB
-rw-r--r--
2025-04-09 02:56
cursor-rewind-001.phpt
2.32
KB
-rw-r--r--
2025-04-09 02:56
cursor-session-001.phpt
1.5
KB
-rw-r--r--
2025-04-09 02:56
cursor-session-002.phpt
1.32
KB
-rw-r--r--
2025-04-09 02:56
cursor-session-003.phpt
1.62
KB
-rw-r--r--
2025-04-09 02:56
cursor-session-004.phpt
1.58
KB
-rw-r--r--
2025-04-09 02:56
cursor-setTypeMap_error-001.phpt
3.73
KB
-rw-r--r--
2025-04-09 02:56
cursor-setTypeMap_error-002.phpt
1.2
KB
-rw-r--r--
2025-04-09 02:56
cursor-setTypeMap_error-003.phpt
1.07
KB
-rw-r--r--
2025-04-09 02:56
cursor-setTypeMap_error-004.phpt
1.84
KB
-rw-r--r--
2025-04-09 02:56
cursor-tailable-001.phpt
1.82
KB
-rw-r--r--
2025-04-09 02:56
cursor-tailable-002.phpt
1.88
KB
-rw-r--r--
2025-04-09 02:56
cursor-tailable-003.phpt
1.16
KB
-rw-r--r--
2025-04-09 02:56
cursor-tailable_error-001.phpt
2.08
KB
-rw-r--r--
2025-04-09 02:56
cursor-tailable_error-002.phpt
2.25
KB
-rw-r--r--
2025-04-09 02:56
cursor-toArray-001.phpt
1.26
KB
-rw-r--r--
2025-04-09 02:56
cursor-toArray-002.phpt
957
B
-rw-r--r--
2025-04-09 02:56
cursor_error-001.phpt
245
B
-rw-r--r--
2025-04-09 02:56
cursorid-getId-001.phpt
1.43
KB
-rw-r--r--
2025-04-09 02:56
cursorinterface-001.phpt
680
B
-rw-r--r--
2025-04-09 02:56
cursorinterface-002.phpt
227
B
-rw-r--r--
2025-04-09 02:56
cursorinterface-003.phpt
230
B
-rw-r--r--
2025-04-09 02:56
Save
Rename
--TEST-- PHPC-1152: Command cursors should use the same session for getMore and killCursors (implicit) --SKIPIF-- <?php require __DIR__ . "/../utils/basic-skipif.inc"; ?> <?php skip_if_not_libmongoc_crypto(); ?> <?php skip_if_not_live(); ?> <?php skip_if_not_clean(); ?> --FILE-- <?php require_once __DIR__ . "/../utils/basic.inc"; class Test implements MongoDB\Driver\Monitoring\CommandSubscriber { private $lsidByCursorId = []; private $lsidByRequestId = []; public function executeCommand() { $manager = create_test_manager(); $bulk = new MongoDB\Driver\BulkWrite; $bulk->insert(['_id' => 1]); $bulk->insert(['_id' => 2]); $bulk->insert(['_id' => 3]); $manager->executeBulkWrite(NS, $bulk); $command = new MongoDB\Driver\Command([ 'aggregate' => COLLECTION_NAME, 'pipeline' => [['$match' => new stdClass]], 'cursor' => ['batchSize' => 2], ]); MongoDB\Driver\Monitoring\addSubscriber($this); /* By creating two cursors with the same name, PHP's reference counting * will destroy the first after the second is created. Note that * mongoc_cursor_destroy also destroys implicit sessions and returns * them to the LIFO pool. This sequencing allows us to test that getMore * and killCursors use the session ID corresponding to the original * aggregate command. */ $cursor = $manager->executeCommand(DATABASE_NAME, $command); $cursor->toArray(); $cursor = $manager->executeCommand(DATABASE_NAME, $command); $cursor->toArray(); $cursor = $manager->executeCommand(DATABASE_NAME, $command); $cursor = $manager->executeCommand(DATABASE_NAME, $command); unset($cursor); MongoDB\Driver\Monitoring\removeSubscriber($this); /* We should expect two unique session IDs over the course of the test, * since at most two implicit sessions would have been in use at any * given time. */ printf("Unique session IDs used: %d\n", count(array_unique($this->lsidByRequestId))); } public function commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void { $requestId = $event->getRequestId(); $sessionId = bin2hex((string) $event->getCommand()->lsid->id); printf("%s session ID: %s\n", $event->getCommandName(), $sessionId); if ($event->getCommandName() === 'aggregate') { if (isset($this->lsidByRequestId[$requestId])) { throw new UnexpectedValueException('Previous command observed for request ID: ' . $requestId); } $this->lsidByRequestId[$requestId] = $sessionId; } if ($event->getCommandName() === 'getMore') { $cursorId = (string) $event->getCommand()->getMore; if ( ! isset($this->lsidByCursorId[$cursorId])) { throw new UnexpectedValueException('No previous command observed for cursor ID: ' . $cursorId); } printf("getMore used same session as aggregate: %s\n", $sessionId === $this->lsidByCursorId[$cursorId] ? 'yes' : 'no'); } if ($event->getCommandName() === 'killCursors') { $cursorId = (string) $event->getCommand()->cursors[0]; if ( ! isset($this->lsidByCursorId[$cursorId])) { throw new UnexpectedValueException('No previous command observed for cursor ID: ' . $cursorId); } printf("killCursors used same session as aggregate: %s\n", $sessionId === $this->lsidByCursorId[$cursorId] ? 'yes' : 'no'); } } public function commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void { /* Associate the aggregate's session ID with its cursor ID so it can be * looked up by the subsequent getMore or killCursors */ if ($event->getCommandName() === 'aggregate') { $cursorId = (string) $event->getReply()->cursor->id; $requestId = $event->getRequestId(); $this->lsidByCursorId[$cursorId] = $this->lsidByRequestId[$requestId]; } } public function commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void { } } (new Test)->executeCommand(); ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- aggregate session ID: %x getMore session ID: %x getMore used same session as aggregate: yes aggregate session ID: %x getMore session ID: %x getMore used same session as aggregate: yes aggregate session ID: %x aggregate session ID: %x killCursors session ID: %x killCursors used same session as aggregate: yes killCursors session ID: %x killCursors used same session as aggregate: yes Unique session IDs used: 2 ===DONE===