-
-
Notifications
You must be signed in to change notification settings - Fork 190
Convert timeout options for driver >= 1.5.0 #175
Conversation
|
||
services: mongodb | ||
|
||
before_script: | ||
- pecl -q install -f mongo-${MONGO_VERSION} && echo "extension=mongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` | ||
- printf "\n" | pecl -q install -f mongo-${MONGO_VERSION} && echo "extension=mongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` |
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.
Likewise, please amend the commit to remove this change. I'll implement this separately in a fashion similar to what I did for ODM: doctrine/mongodb-odm@4fe7d41
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.
Taking care of this and the driver version addition in #176.
This PR made me aware that we were missing some driver documentation. That should now be fixed with PHP-1076. |
Fixed your suggestions, everything alright now? |
@@ -281,6 +281,7 @@ public function drop() | |||
public function ensureIndex(array $keys, array $options = array()) | |||
{ | |||
$options = isset($options['safe']) ? $this->convertWriteConcern($options) : $options; | |||
$options = isset($options['timeout']) ? $this->convertSocketTimeout($options) : $options; |
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.
This actually needs wtimeout
handling as well. On MongoDB 2.4, ensureIndex()
will perform and insert operation on system.indexes
. In 2.6+, the createIndexes command is used. I've updated the driver documentation to clarify this in http://svn.php.net/viewvc?view=revision&revision=333382
LGTM once Is it possible to add a couple of tests modeled after |
Added |
This transforms the deprecated "timeout" and "wtimeout" options to their respective counterparts ("socketTimeoutMS" and "wTimeoutMS") whenever this is applicable.
This transforms the deprecated
timeout
andwtimeout
options to their respective counterparts (socketTimeoutMS
andwTimeoutMS
) whenever this is applicable.This change is necessary because as of version 1.5.0 of the mongo driver, E_DEPRECATED errors are triggered when the old options are given.