-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-433: Persist topology state between requests #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c673e0a
5096fcb
e5db9dd
1060cb8
ad0ae24
29e5121
3036797
a5667e6
9717d5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,6 @@ typedef struct { | |
typedef struct { | ||
PHONGO_ZEND_OBJECT_PRE | ||
mongoc_client_t *client; | ||
char *pem_file; | ||
PHONGO_ZEND_OBJECT_POST | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I forgot to remove this field in the PR for PHPC-605 when we dropped PHP streams. |
||
} php_phongo_manager_t; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,18 @@ require_once __DIR__ . "/../utils/basic.inc"; | |
$name = tempnam(sys_get_temp_dir(), "PHONGO"); | ||
unlink($name); | ||
mkdir($name); | ||
$manager = new MongoDB\Driver\Manager(STANDALONE, array(), array("debug" => $name)); | ||
ini_set('mongodb.debug', $name); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was changed for PHPC-704, since we no longer want to support INI modifications via a constructor argument. As a result, I need to manually enable/disable the INI setting below. |
||
$manager = new MongoDB\Driver\Manager(STANDALONE); | ||
$bulk = new MongoDB\Driver\BulkWrite(); | ||
$bulk->insert(array('_id' => 1, 'x' => 1)); | ||
$result = $manager->executeBulkWrite(NS, $bulk); | ||
ini_set('mongodb.debug', 'off'); | ||
foreach(glob($name."/*") as $file); | ||
$content = file($file); | ||
unlink($file); | ||
rmdir($name); | ||
|
||
echo $content[0]; | ||
echo $content[0], $content[1]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously, the |
||
foreach($content as $line) { | ||
if (strpos($line, "mongoc_bulk_operation_execute")) { | ||
echo $line; | ||
|
@@ -30,6 +32,7 @@ foreach($content as $line) { | |
===DONE=== | ||
<?php exit(0); ?> | ||
--EXPECTF-- | ||
[%s] PHONGO: DEBUG > Connection string: '%s' | ||
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s | ||
[%s] mongoc: TRACE > ENTRY: mongoc_bulk_operation_execute():%d | ||
[%s] mongoc: TRACE > EXIT: mongoc_bulk_operation_execute():%d | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ $bulk = new MongoDB\Driver\BulkWrite(); | |
$bulk->insert(array('_id' => 1, 'x' => 1)); | ||
$result = $manager->executeBulkWrite(NS, $bulk); | ||
|
||
ini_set("mongodb.debug", "off"); | ||
?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Best I can tell, the request reverts to the original INI setting ( |
||
===DONE=== | ||
<?php exit(0); ?> | ||
|
@@ -23,3 +22,4 @@ ini_set("mongodb.debug", "off"); | |
[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s | ||
%a | ||
===DONE=== | ||
%a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Internals Book talks about using
ALLOC_HASHTABLE()
, but that is only useful for non-persistent hash tables. Allocating the value inside of our global struct seemed kosher.