cvs: pear /Log Log.php package.php package.xml /Log/Log observer.php

From: Date: Wed, 26 Oct 2005 05:46:56 +0000
Subject: cvs: pear /Log Log.php package.php package.xml /Log/Log observer.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-35865@lists.php.net to get a copy of this message
jon Wed Oct 26 01:46:56 2005 EDT Modified files: /pear/Log Log.php package.php package.xml /pear/Log/Log observer.php Log: The Observer code is now PHP 4.4 compliant. Log::factory(), Log::singleton(), and Log_observer::factory() now return null instead of false on failure. This is more consistent with the model that these methods return object references. Backwards compatibility is only violated if users were explicitly testing for a literal 'false' result. Bug: 5776 http://cvs.php.net/diff.php/pear/Log/Log.php?r1=1.51&r2=1.52&ty=u Index: pear/Log/Log.php diff -u pear/Log/Log.php:1.51 pear/Log/Log.php:1.52 --- pear/Log/Log.php:1.51 Tue Sep 6 01:54:36 2005 +++ pear/Log/Log.php Wed Oct 26 01:46:55 2005 @@ -1,9 +1,9 @@ <?php /** - * $Header: /repository/pear/Log/Log.php,v 1.51 2005/09/06 05:54:36 jon Exp $ + * $Header: /repository/pear/Log/Log.php,v 1.52 2005/10/26 05:46:55 jon Exp $ * $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $ * - * @version $Revision: 1.51 $ + * @version $Revision: 1.52 $ * @package Log */ @@ -104,8 +104,8 @@ * * @param int $level Log messages up to and including this level. * - * @return object Log The newly created concrete Log instance, or an - * false on an error. + * @return object Log The newly created concrete Log instance, or + * null on an error. * @access public * @since Log 1.0 */ @@ -131,7 +131,7 @@ return $obj; } - return false; + return null; } /** @@ -165,8 +165,8 @@ * * @param int $level Log messages up to and including this level. * - * @return object Log The newly created concrete Log instance, or an - * false on an error. + * @return object Log The newly created concrete Log instance, or + * null on an error. * @access public * @since Log 1.0 */ http://cvs.php.net/diff.php/pear/Log/package.php?r1=1.40&r2=1.41&ty=u Index: pear/Log/package.php diff -u pear/Log/package.php:1.40 pear/Log/package.php:1.41 --- pear/Log/package.php:1.40 Tue Oct 25 12:42:50 2005 +++ pear/Log/package.php Wed Oct 26 01:46:55 2005 @@ -2,9 +2,10 @@ require_once 'PEAR/PackageFileManager.php'; -$version = '1.9.2'; +$version = '1.9.3'; $notes = <<<EOT -Fixing a syntax error in the SQL handler that occured when a custom SQL statement was not provided. (Bug 5777) +The Observer code is now PHP 4.4 compliant. (Bug 5776) +Log::factory(), Log::singleton(), and Log_observer::factory() now return null instead of false on failure. This is more consistent with the model that these methods return object references. Backwards compatibility is only violated if users were explicitly testing for a literal 'false' result. EOT; $changelog = $notes; http://cvs.php.net/diff.php/pear/Log/package.xml?r1=1.98&r2=1.99&ty=u Index: pear/Log/package.xml diff -u pear/Log/package.xml:1.98 pear/Log/package.xml:1.99 --- pear/Log/package.xml:1.98 Tue Oct 25 12:42:51 2005 +++ pear/Log/package.xml Wed Oct 26 01:46:55 2005 @@ -14,11 +14,12 @@ </maintainer> </maintainers> <release> - <version>1.9.2</version> + <version>1.9.3</version> <date>2005-10-25</date> <license>PHP License</license> <state>stable</state> - <notes>Fixing a syntax error in the SQL handler that occured when a custom SQL statement was not provided. (Bug 5777) + <notes>The Observer code is now PHP 4.4 compliant. (Bug 5776) +Log::factory(), Log::singleton(), and Log_observer::factory() now return null instead of false on failure. This is more consistent with the model that these methods return object references. Backwards compatibility is only violated if users were explicitly testing for a literal &apos;false&apos; result. </notes> <deps> <dep type="pkg" rel="ge" version="1.3" optional="yes">DB</dep> @@ -87,6 +88,15 @@ </release> <changelog> <release> + <version>1.9.3</version> + <date>2005-10-25</date> + <license>PHP License</license> + <state>stable</state> + <notes>The Observer code is now PHP 4.4 compliant. (Bug 5776) +Log::factory(), Log::singleton(), and Log_observer::factory() now return null instead of false on failure. This is more consistent with the model that these methods return object references. Backwards compatibility is only violated if users were explicitly testing for a literal &apos;false&apos; result. + </notes> + </release> + <release> <version>1.9.2</version> <date>2005-10-25</date> <license>PHP License</license> http://cvs.php.net/diff.php/pear/Log/Log/observer.php?r1=1.13&r2=1.14&ty=u Index: pear/Log/Log/observer.php diff -u pear/Log/Log/observer.php:1.13 pear/Log/Log/observer.php:1.14 --- pear/Log/Log/observer.php:1.13 Sat Feb 26 09:48:58 2005 +++ pear/Log/Log/observer.php Wed Oct 26 01:46:56 2005 @@ -1,9 +1,9 @@ <?php /** - * $Header: /repository/pear/Log/Log/observer.php,v 1.13 2005/02/26 14:48:58 chagenbu Exp $ + * $Header: /repository/pear/Log/Log/observer.php,v 1.14 2005/10/26 05:46:56 jon Exp $ * $Horde: horde/lib/Log/observer.php,v 1.5 2000/06/28 21:36:13 jon Exp $ * - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ * @package Log */ @@ -65,7 +65,7 @@ * configuration values. * * @return object The newly created concrete Log_observer - * instance, or an false on an error. + * instance, or null on an error. */ function &factory($type, $priority = PEAR_LOG_INFO, $conf = array()) { @@ -99,27 +99,17 @@ if (class_exists($class)) { /* Support both new-style and old-style construction. */ if ($newstyle) { - return new $class($priority, $conf); + $object =& new $class($priority, $conf); } else { - return new $class($priority); + $object =& new $class($priority); } + return $object; } - return false; + return null; } /** -<<<<<<< observer.php - * This is a stub method to make sure that Log_observer classes do - * something when they are notified of a message. The default - * behavior is to just print the message, which is obviously not - * desireable in practically any situation - which is why you need - * to override this method. :) - * - * @param array $messageOb A hash containing all information - the text - * message itself, the priority, what log it came - * from, etc. -======= * This is a stub method to make sure that Log_Observer classes do * something when they are notified of a message. The default behavior * is to just print the message, which is obviously not desireable in @@ -127,11 +117,9 @@ * method. :) * * @param array $event A hash describing the log event. ->>>>>>> 1.5 */ function notify($event) { print_r($event); } - }

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