mongodb driver 1.2.11 Function MongoCollection::setSlaveOkay() is deprecated #66

Closed
MDrollette opened this Issue Jul 19, 2012 · 14 comments

Comments

Projects
None yet
9 participants
@MDrollette

Just updated the mongodb php driver to 1.2.11 and I'm getting this 500 error.

Deprecated: Function MongoCollection::setSlaveOkay() is deprecated in
.../vendor/doctrine/mongodb/lib/Doctrine/MongoDB/Collection.php line 615
@jmikola

This comment has been minimized.

Show comment
Hide comment
@jmikola

jmikola Jul 19, 2012

Member

See doctrine/mongodb-odm@f5b500a

I would suggest ignoring deprecation warnings until read preferences are implemented in the driver, which will allow us to specify primary/secondary preferences on the connection.

Member

jmikola commented Jul 19, 2012

See doctrine/mongodb-odm@f5b500a

I would suggest ignoring deprecation warnings until read preferences are implemented in the driver, which will allow us to specify primary/secondary preferences on the connection.

@hmatanock

This comment has been minimized.

Show comment
Hide comment
@hmatanock

hmatanock Jul 23, 2012

Looks like MongoDB just "undepreciated" this. https://jira.mongodb.org/browse/PHP-444

Looks like MongoDB just "undepreciated" this. https://jira.mongodb.org/browse/PHP-444

@vbergae

This comment has been minimized.

Show comment
Hide comment
@vbergae

vbergae Jul 23, 2012

If anybody doesn't want to deactivate deprecation warnings a workaround could be to downgrade mongo driver using pecl:

# pecl install -f mongo 1.2.10

vbergae commented Jul 23, 2012

If anybody doesn't want to deactivate deprecation warnings a workaround could be to downgrade mongo driver using pecl:

# pecl install -f mongo 1.2.10
@kaiwa

This comment has been minimized.

Show comment
Hide comment
@kaiwa

kaiwa Jul 23, 2012

thx @vbergae, saved me some time

dash is missing for the command:

pecl install -f mongo-1.2.10

kaiwa commented Jul 23, 2012

thx @vbergae, saved me some time

dash is missing for the command:

pecl install -f mongo-1.2.10
@jmikola

This comment has been minimized.

Show comment
Hide comment
@jmikola

jmikola Jul 24, 2012

Member

Keep in mind that 1.2.10 has some GridFS bugs, so you might find 1.2.9 a better alternative until 1.2.12 is released and the deprecation is removed.

Member

jmikola commented Jul 24, 2012

Keep in mind that 1.2.10 has some GridFS bugs, so you might find 1.2.9 a better alternative until 1.2.12 is released and the deprecation is removed.

@jmikola

This comment has been minimized.

Show comment
Hide comment
Member

jmikola commented Jul 24, 2012

@jmikola jmikola closed this Jul 24, 2012

@meonkeys

This comment has been minimized.

Show comment
Hide comment
@meonkeys

meonkeys Nov 27, 2012

Contributor

I just upgraded to PHP mongo extension 1.3.0 and started seeing #66 . I'm using doctrine-mongodb-odm 1.0.0-BETA5 and doctrine-mongodb 1.0.0-BETA1. Downgrading and/or ignoring E_DEPRECATED seem a bit cumbersome... is there another fix?

Contributor

meonkeys commented Nov 27, 2012

I just upgraded to PHP mongo extension 1.3.0 and started seeing #66 . I'm using doctrine-mongodb-odm 1.0.0-BETA5 and doctrine-mongodb 1.0.0-BETA1. Downgrading and/or ignoring E_DEPRECATED seem a bit cumbersome... is there another fix?

@meonkeys

This comment has been minimized.

Show comment
Hide comment
@meonkeys

meonkeys Nov 27, 2012

Contributor

Update: @jmikola answered my question on IRC (Freenode#mongodb):

[14:43] < jmikola> meonkeys: you can disable e_deprecated notices for now (old doctrine tests did that briefly if you look at the phpunit bootstrap history)
[14:44] < jmikola> but mainly, doctrine needs to be updated to support the 1.3.0 driver
[14:44] < jmikola> and i don't have the free time to get to that this week

However, I'm not I don't know how to disable E_DEPRECATED notices in a Symfony 2.0 app. I tried adding error_reporting(error_reporting() ^ E_DEPRECATED) in a few places, but Symfony2 is calling error_reporting(-1) from somewhere.

Sorry if Symfony2 is offtopic -- I'll gladly ask about that somewhere else if need be.

Contributor

meonkeys commented Nov 27, 2012

Update: @jmikola answered my question on IRC (Freenode#mongodb):

[14:43] < jmikola> meonkeys: you can disable e_deprecated notices for now (old doctrine tests did that briefly if you look at the phpunit bootstrap history)
[14:44] < jmikola> but mainly, doctrine needs to be updated to support the 1.3.0 driver
[14:44] < jmikola> and i don't have the free time to get to that this week

However, I'm not I don't know how to disable E_DEPRECATED notices in a Symfony 2.0 app. I tried adding error_reporting(error_reporting() ^ E_DEPRECATED) in a few places, but Symfony2 is calling error_reporting(-1) from somewhere.

Sorry if Symfony2 is offtopic -- I'll gladly ask about that somewhere else if need be.

@meonkeys

This comment has been minimized.

Show comment
Hide comment
@meonkeys

meonkeys Nov 27, 2012

Contributor

@kaiwa thanks for referencing #80.

Contributor

meonkeys commented Nov 27, 2012

@kaiwa thanks for referencing #80.

@godbout

This comment has been minimized.

Show comment
Hide comment
@godbout

godbout Dec 7, 2012

@meonkeys in the bootstrap.php.cache file, init() method.

godbout commented Dec 7, 2012

@meonkeys in the bootstrap.php.cache file, init() method.

@meonkeys

This comment has been minimized.

Show comment
Hide comment
@meonkeys

meonkeys Dec 8, 2012

Contributor

@godbout yeah, so I see it in there, but editing that file doesn't seem like a robust way to disable E_DEPRECATED notices in a Symfony 2.0 app.

Contributor

meonkeys commented Dec 8, 2012

@godbout yeah, so I see it in there, but editing that file doesn't seem like a robust way to disable E_DEPRECATED notices in a Symfony 2.0 app.

@Baachi

This comment has been minimized.

Show comment
Hide comment
@Baachi

Baachi Dec 8, 2012

@meonkeys you must change the error reporting level isinde your AppKernel class. The AppKernel class has a init method where you can change this.

Baachi commented Dec 8, 2012

@meonkeys you must change the error reporting level isinde your AppKernel class. The AppKernel class has a init method where you can change this.

@jmikola

This comment has been minimized.

Show comment
Hide comment
@jmikola

jmikola Dec 30, 2012

Member

@manchuck: The 1.0.0 release is compatible with both the 1.2.12 and 1.3.x driver versions: https://github.com/doctrine/mongodb/tags

Member

jmikola commented Dec 30, 2012

@manchuck: The 1.0.0 release is compatible with both the 1.2.12 and 1.3.x driver versions: https://github.com/doctrine/mongodb/tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment