开发者

PHP core function printing debug statements

开发者 https://www.devze.com 2022-12-26 23:15 出处:网络
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.

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 dow开发者_如何学运维n 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?


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 :

  • Autoloading Classes
  • 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 ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消