PHP核心函数打印调试语句

发布于 2024-08-29 08:17:09 字数 947 浏览 3 评论 0原文

我正在将一个框架(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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

明媚殇 2024-09-05 08:17:09

我不认为内部函数,例如 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.

有关自动加载的更多信息,请参阅:

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 :

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文