Christian Grobmeier wrote:
does this function break applications which defined an own autoload?

No, it should not. You can only have one __autoload() function while with spl_autoload_register() you can add multiple autoload functions to the autoload stack.

http://de.php.net/spl_autoload_register
"If your code has an existing __autoload function then this function
must be explicitly registered on the __autoload stack."

Yes, exactly! If you define your own __autoload() function you should explicitly add LoggerManager::autoload() to the __autoload stack.
This would break for example the PIWI frameworks inclusion of log4php.
I haven't looked into your framework, but you should never use __autoload() in library code, use spl_autoload_register(). __autoload() is for application level code, however even application level code is better off using spl_autoload_register(), __autoload() is kind of the last way out if you need complete control and know what you are doing since you can only declare one __autoload() method ;)

In library code like log4php you should provide an autoload-method (like LoggerManager::autoload()) which does the job for you.

Knut

Reply via email to