PHP核心函数打印调试语句
我正在将一个框架(Kohana 2.3.4)集成到一个网络应用程序(IPB 2.3.4/2.3.6)通过第三方桥接库 (IPBWI 2.07),我开始在网页输出顶部看到字符串 NOT FOUND
。
我怎样才能关闭该消息?
我将其范围缩小到对 IPB 中的 class_exists(...)
的调用。除了打印“NOT FOUND”消息之外,调用工作正常。当它自己执行时(不是由 Kohana 通过 IPBWI 调用),消息不会被打印。奇怪的是,我已经识别出对 Kohana 中先前调用的相同方法的调用,但不打印消息。
echo 'Calling class_exists<br>';
if ( ! class_exists( 'db_main' ) )
echo 'class_exists returns false<br>';
...
结果是:
Calling class_exists()<br>NOT FOUND<br>class_exists() returns false<br>
请注意,它不仅打印“NOT FOUND”,而且在其后面带有 html
标记,就像用于运行时调试一样。
我对 PHP 不太熟悉,但是是否启用了一些全局调试设置?我应该检查哪些类型的标志?
I'm integrating a framework (Kohana 2.3.4), into a web-app (IPB 2.3.4/2.3.6) via a third party bridge library (IPBWI 2.07), and I began seeing the string NOT FOUND
at the top of the web-page output.
How can I turn that message off?
I narrowed it down to a call to class_exists(...)
in IPB. The call is working correctly, except for the printing of the "NOT FOUND" message. When executed by itself (not invoked by Kohana via the IPBWI) the message is not printed. What is strange is that I've identified calls to the same method in Kohana which are invoked earlier, but do not print the message.
echo 'Calling class_exists<br>';
if ( ! class_exists( 'db_main' ) )
echo 'class_exists returns false<br>';
...
results in:
Calling class_exists()<br>NOT FOUND<br>class_exists() returns false<br>
Note that it is not only printing 'NOT FOUND' but following it with an html <br>
tag as though intended for runtime debugging.
I'm not very familiar with PHP, but is there some global debug setting that is being enabled? What sorts of flags should I check?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为内部函数,例如
call_exists()
将输出那种调试消息。但请注意,默认情况下,为尚未定义的类调用
class_exists
将导致调用自动加载器。If there is an autoloader set somewhere in your application, maybe that autoloader is echoing "`NOT FOUND`" when it's not able to autoload a class.
有关自动加载的更多信息,请参阅:
spl_autoload_register
Now, to be sure, and know where this autoloader is defined, and what it's doing *(and, possibly, find a way to remove that message)*, you could search for "`NOT FOUND`" in all the source files of your project -- it's a bit of a brute-force solution, but it often help ;-)
I don't think that internal functions, such as
call_exists()
will output that kind of debug message.But note that, by default, calling
class_exists
for a class that's not be defined yet will result in the autoloader being called.If there is an autoloader set somewhere in your application, maybe that autoloader is echoing "`NOT FOUND`" when it's not able to autoload a class.
For more informations about autoloading, see :
spl_autoload_register
Now, to be sure, and know where this autoloader is defined, and what it's doing *(and, possibly, find a way to remove that message)*, you could search for "`NOT FOUND`" in all the source files of your project -- it's a bit of a brute-force solution, but it often help ;-)