fuel / core

Fuel PHP Framework - The core of the Fuel v1 framework
http://fuelphp.com
813 stars 345 forks source link

Fix MongoDB Error: The 'connect' option is deprecated #1110

Closed sayanriju closed 12 years ago

sayanriju commented 12 years ago

The following error is thrown on calling \Mongo_db::instance()

8192!

ErrorException [ 8192 ]: Mongo::__construct(): The 'connect' option is deprecated and will be removed in the future

COREPATH/classes/mongo/db.php @ line 178:

177: {
178: $this->connection = new \Mongo(trim($connection_string), $options);
179: $this->db = $this->connection->{$config['database']};

This can be fixed by changing the $options array in __construct() method of core/classes/mongo/db.php as follows. From:

$options = array("connect" => true);

To:

$options=array();

This is Line# 140 in the file for the FuelPHP version 1.2.1 download.

tomschlick commented 12 years ago

Can you say what version of MongoDB / PHP Mongo Driver you are using? I've been running mongodb in production for a while now and never have seen this exception come up.

On Monday, August 20, 2012 at 12:31 PM, Sayan Riju Chakrabarti wrote:

The following error is thrown on calling \Mongo_db::instance() 8192! ErrorException [ 8192 ]: Mongo::__construct(): The 'connect' option is deprecated and will be removed in the future COREPATH/classes/mongo/db.php @ line 178: 177: { 178: $this->connection = new \Mongo(trim($connection_string), $options); 179: $this->db = $this->connection->{$config['database']};
This can be fixed by changing the $options array in __construct() method of core/classes/mongo/db.php as follows. From: $options = array("connect" => true); To: $options=array();
This is Line# 140 in the file for the FuelPHP version 1.2.1 download.

— Reply to this email directly or view it on GitHub (https://github.com/fuel/core/issues/1110).

sayanriju commented 12 years ago

On Tue, Aug 21, 2012 at 12:54 AM, Tom Schlick notifications@github.comwrote:

Can you say what version of MongoDB / PHP Mongo Driver you are using? I've been running mongodb in production for a while now and never have seen this exception come up.

MongoDB Version: 2.0.7 PHP Mongo Driver version: 1.3.0beta1 (direct download from github) OS: Debian Squeeze PHP version: 5.3.3 FuelPHP version: 1.2.1

Sayan "Riju" Chakrabarti

Kolkata, India.

GnuPG Public Key ID: 0xB6506B6F Alt. Email: s26c.sayan@gmail.com

Website : http://sayanriju.co.cc

sayanriju commented 12 years ago

P.S.: My environment is in Development mode. And the error is not fatal (documents added as expected).

WanWizard commented 12 years ago

The question is: will it break the current released driver if you remove this? If so, this will stay, we're not going to have our driver default to the settings needed by an experimental beta.

WanWizard commented 12 years ago

Closed due to lack of further response.