mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-03-26 01:42:10 +01:00
* Replace client pointers on object structs with Manager references * Request-scoped Manager registry for APM events * Ensure Manager is registered regardless of persistent client * Reset request-scoped clients when forking * Test for freeing Manager during RSHUTDOWN via subscriber reference Co-authored-by: Andreas Braun <git@alcaeus.org>
42 lines
1.6 KiB
PHP
42 lines
1.6 KiB
PHP
--TEST--
|
|
MongoDB\Driver\Manager::__construct(): disableClientPersistence option
|
|
--FILE--
|
|
<?php
|
|
|
|
ini_set('mongodb.debug', 'stderr');
|
|
new MongoDB\Driver\Manager();
|
|
|
|
// Won't reuse first client due to different options
|
|
new MongoDB\Driver\Manager(null, [], ['disableClientPersistence' => false]);
|
|
|
|
// Will reuse the previous client due to same options
|
|
new MongoDB\Driver\Manager(null, [], ['disableClientPersistence' => false]);
|
|
|
|
// Will create a non-persistent client
|
|
new MongoDB\Driver\Manager(null, [], ['disableClientPersistence' => true]);
|
|
|
|
// Will create another non-persistent client
|
|
new MongoDB\Driver\Manager(null, [], ['disableClientPersistence' => true]);
|
|
ini_set('mongodb.debug', '');
|
|
|
|
?>
|
|
===DONE===
|
|
<?php exit(0); ?>
|
|
--EXPECTF--
|
|
%A
|
|
[%s] PHONGO: DEBUG > Created client with hash: %s
|
|
[%s] PHONGO: DEBUG > Stored persistent client with hash: %s
|
|
[%s] PHONGO: DEBUG > Not destroying persistent client for Manager%A
|
|
[%s] PHONGO: DEBUG > Created client with hash: %s
|
|
[%s] PHONGO: DEBUG > Stored persistent client with hash: %s
|
|
[%s] PHONGO: DEBUG > Not destroying persistent client for Manager%A
|
|
[%s] PHONGO: DEBUG > Found client for hash: %s
|
|
[%s] PHONGO: DEBUG > Not destroying persistent client for Manager%A
|
|
[%s] PHONGO: DEBUG > Created client with hash: %s
|
|
[%s] PHONGO: DEBUG > Stored non-persistent client
|
|
[%s] PHONGO: DEBUG > Destroying non-persistent client for Manager%A
|
|
[%s] PHONGO: DEBUG > Created client with hash: %s
|
|
[%s] PHONGO: DEBUG > Stored non-persistent client
|
|
[%s] PHONGO: DEBUG > Destroying non-persistent client for Manager%A
|
|
===DONE===
|