PHP Mongo: Note: Mongo :: __ construct (): parsers

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

( ! ) 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); 

A notification appears sometimes, not all the time. I use the mongo ODM doctrine.

+6
source share
1 answer

This message is issued by the driver (see parse.c or log-1.phpt unit test). This behavior is controlled only by the MongoLog class (there are no ini options for it), and registration is disabled by default, so you certainly know if you activated it. I guess some codeIgniter related library is the culprit (this is the only general thread I can make out).

You can find more detailed information in the MongoLog documentation , but the following should completely disable logging for all levels and modules:

 \MongoLog::setLevel(\MongoLog::NONE) \MongoLog::setModule(\MongoLog::NONE) 
+3
source

Source: https://habr.com/ru/post/919963/


All Articles