Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Mongo: Notice: Mongo::__construct(): parsing servers

I am wondering why I am getting the following php notice:

( ! ) Notice: Mongo::__construct(): parsing servers in C:\htdocs\multishop\library\Lupi\Resource\Odm.php on line 38
Call Stack
#   Time    Memory  Function    Location
1   0.0004  138504  {main}( )   ..\index.php:0
2   0.0130  667392  Zend_Application->bootstrap( )  ..\index.php:25
3   0.0130  667488  Zend_Application_Bootstrap_BootstrapAbstract->bootstrap( )  ..\Application.php:355
4   0.0130  667504  Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap( ) ..\BootstrapAbstract.php:586
5   0.0442  2068704 Zend_Application_Bootstrap_BootstrapAbstract->_executeResource( )   ..\BootstrapAbstract.php:626
6   0.0442  2068832 Lupi_Resource_Odm->init( )  ..\BootstrapAbstract.php:683
7   0.0596  2778880 Mongo->__construct( )   ..\Odm.php:38

Line 38:

 $dm = DocumentManager::create(new \Doctrine\MongoDB\Connection(new \Mongo), $config);

The notice appears sometimes, not all the time. I am using doctrine mongo ODM.

like image 501
dextervip Avatar asked Jul 08 '12 05:07

dextervip


1 Answers

This message is being emitted by the driver (see: parse.c or the log-1.phpt unit test). This behavior is only controlled by the MongoLog class (there are no ini options for it) and logging is disabled by default, so you'd certainly know if you were activating it. My guess is that some library related to CodeIgniter is the culprit (that's the only common thread I can make out).

You can take a look at the MongoLog documentation for more information, but the following should completely disable logging for all levels and modules:

\MongoLog::setLevel(\MongoLog::NONE)
\MongoLog::setModule(\MongoLog::NONE)
like image 126
jmikola Avatar answered Oct 23 '22 17:10

jmikola