注意:Mongo::__construct():解析服务器

时间:2021-08-11 07:27:49

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

我想知道为什么我会得到以下php通知:

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

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.

通知有时会出现,而不是一直出现。我用的是蒙哥的教义。

1 个解决方案

#1


3  

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).

此消息由驱动程序发出(请参见:parse)。c或log-1。phpt单元测试)。此行为仅由MongoLog类控制(没有ini选项),默认情况下禁用日志记录,因此您肯定知道是否激活了它。我的猜测是,与CodeIgniter相关的库是罪魁祸首(这是我能识别的唯一公共线程)。

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文档了解更多信息,但是以下内容应该完全禁止所有级别和模块的日志记录:

\MongoLog::setLevel(\MongoLog::NONE)
\MongoLog::setModule(\MongoLog::NONE)

#1


3  

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).

此消息由驱动程序发出(请参见:parse)。c或log-1。phpt单元测试)。此行为仅由MongoLog类控制(没有ini选项),默认情况下禁用日志记录,因此您肯定知道是否激活了它。我的猜测是,与CodeIgniter相关的库是罪魁祸首(这是我能识别的唯一公共线程)。

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文档了解更多信息,但是以下内容应该完全禁止所有级别和模块的日志记录:

\MongoLog::setLevel(\MongoLog::NONE)
\MongoLog::setModule(\MongoLog::NONE)