Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Convert deprecated MongoClient constructor options for PHP Mongo Driver >= 1.4.0 #137

Closed
wants to merge 1 commit into from

Conversation

fmeynard
Copy link
Contributor

Just a quick fix to work with php mongo driver 1.4.X

@jmikola
Copy link
Member

jmikola commented Oct 28, 2013

The Connection class takes an options array, which can have any keys. Did you suggest this change because the Symfony bundle restricts that options that can be used? If so, the bundle should probably be changed.

@jmikola
Copy link
Member

jmikola commented Mar 27, 2014

Closing this as I don't think it's something to be fixed in Doctrine MongoDB.

@jmikola jmikola closed this Mar 27, 2014
@rjelierse
Copy link
Contributor

It might not be the right fix, in fact, it isn't, this should be fixed in Collection. But one could argue that as an abstraction layer, changes in option names between versions (which is the case here) should be fixed at this level for the sake of compatibility. Otherwise, all packages that depend on this library should take care of checking the version of the installed mongo extension and change the options passed to the affected methods accordingly. The same has been done for the safe option for all affected methods.

EDIT: Ah, the proposed fix actually only dealt with the change in MongoClient, which has not been officially marked as deprecated. The changes in MongoCollection trigger E_DEPRECATED for mongo >= 1.5.0. Will create separate PR.

rjelierse pushed a commit to rjelierse/mongodb that referenced this pull request Apr 17, 2014
…octrine#137)

This transforms the deprecated "timeout" and "wtimeout" options to their
respective counterparts ("socketTimeoutMS" and "wTimeoutMS") whenever this
is applicable.
@jmikola jmikola added this to the 1.1.6 milestone Apr 21, 2014
@jmikola jmikola changed the title Fix to use the right timeout option with PHP Mongo Driver >= 1.4.0 Convert deprecated MongoClient constructor options for PHP Mongo Driver >= 1.4.0 Apr 21, 2014
@jmikola
Copy link
Member

jmikola commented Apr 21, 2014

In light of the changes to Collection, I think this worth including. Re-opening and will get it merged to 1.1.x. Thanks, @fmeynard.

Also, wTimeout should also be converted to wTimeoutMS, since it is deprecated in the documentation. Unlike timeout, It does not currently throw a notice (see: PHP-1079).

@jmikola jmikola reopened this Apr 21, 2014
@jmikola
Copy link
Member

jmikola commented Apr 21, 2014

Related DoctrineMongoDBBundle PR: doctrine/DoctrineMongoDBBundle#218

@jmikola
Copy link
Member

jmikola commented Apr 21, 2014

Superseded by #178.

@jmikola jmikola closed this Apr 21, 2014
@jmikola jmikola removed the feature label Apr 21, 2014
@jmikola jmikola removed this from the 1.1.6 milestone Apr 21, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants