Bug #6066
Typo3 webservices gives fatal error in php log with Zend Framework 1.10 without adding factory() method.
100%
Description
In Zend Framework 1.10 the Zend_Log::factory method is added to the Zend_Log interface. Since Typo3Rpc_LogWriter_T3DevLog extends the Zend_Log_Writer_Abstract, which in turn implements the Zend_Log_FactoryInterface, then it will need to implement a factory() method to work with Zend Framework 1.10.
I added the following to Typo3Rpc_LogWriter_T3DevLog, which I have tested works with both ZF 1.9 and 1.10:
/**
* Create a new instance of Typo3Rpc_LogWriter_T3DevLog
*
* @param array|Zend_Config $config
* @return Zend_Log_Writer_Syslog
* @throws Zend_Log_Exception
*/
// TODO: This is implemented to be compliant with Zend Framework 1.10. I have grabbed the code from Zend_Log_Writer_Syslog, but do not know if this i correct.
static public function factory($config)
{
return new self(self::_parseConfig($config));
}
Without the method you will find a fatal error like this in your PHP error log:
Fatal error: Class Typo3Rpc_LogWriter_T3DevLog contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Zend_Log_FactoryInterface::factory) in /t3/typo3conf/ext/typo3_webservice/library/application/Typo3Rpc_LogWriter_T3DevLog.php on line 35
Web Reference:
Zend_Log::method proposal: http://framework.zend.com/wiki/display/ZFPROP/Zend_Log+factory%28%29+-+Martin+Roest
Commit in ZF repository: http://framework.zend.com/code/browse/Zend_Framework/standard/trunk/library/Zend/Log/FactoryInterface.php
Zend_Log::factory() listed as new in ZF 1.10: http://devzone.zend.com/article/11642-Zend-Framework-1.10.0beta1-Released
Updated by Helmut Hummel over 10 years ago
- Status changed from New to Resolved
- Assignee set to Helmut Hummel
- % Done changed from 0 to 100
fixed in trunk rev. 33399
(Thanks Kasper)