svn: /pear2/Pyrus/trunk/src/Pyrus/ Logger.php

From: Date: Fri, 05 Mar 2010 21:35:08 +0000
Subject: svn: /pear2/Pyrus/trunk/src/Pyrus/ Logger.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-59000@lists.php.net to get a copy of this message
dufuz Fri, 05 Mar 2010 21:35:08 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=295864 Log: spl_object_hash does not lend it self well as a key for the loggers due to the reason that the hash keeps changing between object instantiation. To make all our tests run we are using the class names as key. This allows people to have a base logger class and as such extend that with different name to have multiple loggers with the same base functionality (priority level changes or so). Changed paths: U pear2/Pyrus/trunk/src/Pyrus/Logger.php Modified: pear2/Pyrus/trunk/src/Pyrus/Logger.php =================================================================== --- pear2/Pyrus/trunk/src/Pyrus/Logger.php 2010-03-05 21:30:23 UTC (rev 295863) +++ pear2/Pyrus/trunk/src/Pyrus/Logger.php 2010-03-05 21:35:08 UTC (rev 295864) @@ -47,11 +47,11 @@ static public function attach(LogInterface $observer) { - self::$observers[spl_object_hash($observer)] = $observer; + self::$observers[get_class($observer)] = $observer; } static public function detach(LogInterface $observer) { - unset(self::$observers[spl_object_hash($observer)]); + unset(self::$observers[get_class($observer)]); } } \ No newline at end of file

« previous php.pear.cvs (#59000) next »