Issue Type: Patch Created: 2010-10-31T15:00:45.000+0000 Last Updated: 2010-11-23T21:54:20.000+0000 Status: Resolved Fix version(s): Reporter: Frédéric MENU (fric) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Log
Related issues: Attachments:
If you try using the factory to create a new firebug logger like this
<pre class="highlight"> Zend_log::factory(array( array( "writerName" => "Firebug", "filterName" => "Priority", "filterParams" => array( "priority" => Zend_Log::INFO, ), ), ));
you've got the following fatal error: Fatal error: Cannot redeclare class Zend_Log in PATH/Zend/Log.php on line 30
Using normal instanciation does work though:
<pre class="highlight"> $writer = new Zend_Log_Writer_Firebug(); $logger = new Zend_Log($writer); $logger->log('Test message', Zend_Log::INFO);
Correction is to delete the following lines in Zend/log/Writer/firebug.php (lines 23 and 24) /** Zend_Log */ require_once 'Zend/Log.php';
Posted by Ramon Henrique Ornelas (ramon) on 2010-10-31T17:18:06.000+0000
In your sample code first the a typo is Zend_Log and not Zend_log. Zend_Log_Writer_Syslog and Zend_Log_Writer_Firebug uses constants of the class Zend_Log by this the require_once.
See a case of error if remove require_once of the class Zend_Log_Writer_Firebug.
<pre class="highlight"> require_once 'Zend/Log/Writer/Firebug.php'; $writer = new Zend_Log_Writer_Firebug(); $writer->getPriorityStyle(0);
Posted by Ramon Henrique Ornelas (ramon) on 2010-10-31T17:46:02.000+0000
Here a simple code reproduced and not found problem.
<pre class="highlight"> $paths = array( /* define path */ ); set_include_path(implode(PATH_SEPARATOR, $paths)); require_once 'Zend/Log.php'; Zend_log::factory(array( array( "writerName" => "Firebug", "filterName" => "Priority", "filterParams" => array( "priority" => Zend_Log::INFO, ), ), ));
Please provides more information to reproduced.
Posted by Frédéric MENU (fric) on 2010-10-31T20:17:55.000+0000
Actually you are right the problem comes from the misspelling of Zend_Log. I think that the class loader doesn't register the class properly the first time (using Zend_log) and at the second invocation of the class (using Zend_Log this time) the system crashes because it tries to register the class a second time (but the class loader registered Zend_log not Zend_Log)
Sorry for bothering for nothing and thanks for your reactivity.
Posted by Marc Hodgins (mjh_ca) on 2010-11-23T21:54:20.000+0000
Removing fix version. Issues marked 'not an issue' don't need a fix version.
Have you found an issue?
See the Overview section for more details.