ZF-11450: Extending Zend_Log_Writer and their factory-methods

Issue Type: Bug Created: 2011-06-07T13:46:30.000+0000 Last Updated: 2011-06-23T17:09:18.000+0000 Status: Resolved Fix version(s): Reporter: Eric Andre (eandre) Assignee: BenoƮt Durand (intiilapa) Tags: - Zend_Log

Related issues: - ZF2-18



If there is any need to extend a writer, for example Firebug to add functionality from FirePHP, you can set a writerNamespace property, e.g.

in an ini-property file:

firebug.writerNamespace = "My_Log_Writer" firebug.writerName = "Firebug"

The Zend_Log::getClassName method works fine, it will recognize the namespace given in $config array, but then call_user_func calls the factory method from Zend_Log_Writer_Firebug and the code there:

public static function factory() { return new self(); }

returns a Zend_Log_Writer_Firebug instance instead of My_Log_Writer_Firebug.

So the factory method must be overridden to take some effect.

solution for php5.3 compatibility is to use return new static, for php5.2 support there is no potential but override the factory method.


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.