cvs: pear /Log package.php package.xml package2.xml /Log/Log observer.php
| From: | Jon Parise | Date: | Thu, 02 Mar 2006 03:27:06 +0000 |
| Subject: | cvs: pear /Log package.php package.xml package2.xml /Log/Log observer.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38835@lists.php.net to get a copy of this message | ||
jon Thu Mar 2 03:27:06 2006 UTC
Modified files:
/pear/Log package.php package.xml package2.xml
/pear/Log/Log observer.php
Log:
The observer's factory method now provides more robust file location
logic. It no longer makes assumptions about the name of Log package's
directory when searching for new-style observer implementations.
We retain to explicit dirname(__FILE__) code for completeness, although I
think it may be possible to always relay on a relative pathname here.
Bug: 6831
http://cvs.php.net/viewcvs.cgi/pear/Log/package.php?r1=1.43&r2=1.44&diff_format=u
Index: pear/Log/package.php
diff -u pear/Log/package.php:1.43 pear/Log/package.php:1.44
--- pear/Log/package.php:1.43 Tue Jan 10 07:30:01 2006
+++ pear/Log/package.php Thu Mar 2 03:27:06 2006
@@ -12,8 +12,8 @@
If a 'DB' class already exists, the SQL handler won't attempt to require DB.php.
(Bug 6214)
When creating the Log instance in factory(), return a proper reference to the object. (Bug 5261)
When preparing the MDB2 statement, mark it as MDB2_PREPARE_MANIP. (Bug 6323)
-If the desired Log class already exists (because the caller has supplied it
-from some custom location), simply instantiate and return a new instance. (Mads Danquah)
+If the desired Log class already exists (because the caller has supplied it from some custom
location), simply instantiate and return a new instance. (Mads Danquah)
+The observer's factory method now provides more robust file location logic. (Bug 6831)
EOT;
$package = new PEAR_PackageFileManager2();
http://cvs.php.net/viewcvs.cgi/pear/Log/package.xml?r1=1.101&r2=1.102&diff_format=u
Index: pear/Log/package.xml
diff -u pear/Log/package.xml:1.101 pear/Log/package.xml:1.102
--- pear/Log/package.xml:1.101 Tue Jan 10 07:30:01 2006
+++ pear/Log/package.xml Thu Mar 2 03:27:06 2006
@@ -15,14 +15,14 @@
</maintainers>
<release>
<version>1.9.4</version>
- <date>2006-01-09</date>
+ <date>2006-03-01</date>
<license>PHP License</license>
<state>stable</state>
<notes>If a 'DB' class already exists, the SQL handler won't
attempt to require DB.php. (Bug 6214)
When creating the Log instance in factory(), return a proper reference to the object. (Bug 5261)
When preparing the MDB2 statement, mark it as MDB2_PREPARE_MANIP. (Bug 6323)
-If the desired Log class already exists (because the caller has supplied it
-from some custom location), simply instantiate and return a new instance. (Mads Danquah)
+If the desired Log class already exists (because the caller has supplied it from some custom
location), simply instantiate and return a new instance. (Mads Danquah)
+The observer's factory method now provides more robust file location logic. (Bug 6831)
</notes>
<deps>
<dep type="php" rel="ge" version="4.3.0"
optional="no"/>
@@ -93,14 +93,14 @@
<changelog>
<release>
<version>1.9.4</version>
- <date>2006-01-09</date>
+ <date>2006-03-01</date>
<license>PHP License</license>
<state>stable</state>
<notes>If a 'DB' class already exists, the SQL handler won't
attempt to require DB.php. (Bug 6214)
When creating the Log instance in factory(), return a proper reference to the object. (Bug 5261)
When preparing the MDB2 statement, mark it as MDB2_PREPARE_MANIP. (Bug 6323)
-If the desired Log class already exists (because the caller has supplied it
-from some custom location), simply instantiate and return a new instance. (Mads Danquah)
+If the desired Log class already exists (because the caller has supplied it from some custom
location), simply instantiate and return a new instance. (Mads Danquah)
+The observer's factory method now provides more robust file location logic. (Bug 6831)
</notes>
</release>
<release>
http://cvs.php.net/viewcvs.cgi/pear/Log/package2.xml?r1=1.2&r2=1.3&diff_format=u
Index: pear/Log/package2.xml
diff -u pear/Log/package2.xml:1.2 pear/Log/package2.xml:1.3
--- pear/Log/package2.xml:1.2 Tue Jan 10 07:30:01 2006
+++ pear/Log/package2.xml Thu Mar 2 03:27:06 2006
@@ -13,8 +13,8 @@
<email>jon@php.net</email>
<active>yes</active>
</lead>
- <date>2006-01-09</date>
- <time>23:27:57</time>
+ <date>2006-03-01</date>
+ <time>19:24:49</time>
<version>
<release>1.9.4</release>
<api>1.0.0</api>
@@ -27,8 +27,8 @@
<notes>If a 'DB' class already exists, the SQL handler won't
attempt to require DB.php. (Bug 6214)
When creating the Log instance in factory(), return a proper reference to the object. (Bug 5261)
When preparing the MDB2 statement, mark it as MDB2_PREPARE_MANIP. (Bug 6323)
-If the desired Log class already exists (because the caller has supplied it
-from some custom location), simply instantiate and return a new instance. (Mads
Danquah)</notes>
+If the desired Log class already exists (because the caller has supplied it from some custom
location), simply instantiate and return a new instance. (Mads Danquah)
+The observer's factory method now provides more robust file location logic. (Bug
6831)</notes>
<contents>
<dir baseinstalldir="/" name="/">
<dir name="docs">
@@ -124,13 +124,13 @@
<release>stable</release>
<api>stable</api>
</stability>
- <date>2006-01-09</date>
+ <date>2006-03-01</date>
<license>PHP License</license>
<notes>If a 'DB' class already exists, the SQL handler won't
attempt to require DB.php. (Bug 6214)
When creating the Log instance in factory(), return a proper reference to the object. (Bug 5261)
When preparing the MDB2 statement, mark it as MDB2_PREPARE_MANIP. (Bug 6323)
-If the desired Log class already exists (because the caller has supplied it
-from some custom location), simply instantiate and return a new instance. (Mads
Danquah)</notes>
+If the desired Log class already exists (because the caller has supplied it from some custom
location), simply instantiate and return a new instance. (Mads Danquah)
+The observer's factory method now provides more robust file location logic. (Bug
6831)</notes>
</release>
<release>
<version>
http://cvs.php.net/viewcvs.cgi/pear/Log/Log/observer.php?r1=1.16&r2=1.17&diff_format=u
Index: pear/Log/Log/observer.php
diff -u pear/Log/Log/observer.php:1.16 pear/Log/Log/observer.php:1.17
--- pear/Log/Log/observer.php:1.16 Tue Jan 3 05:24:19 2006
+++ pear/Log/Log/observer.php Thu Mar 2 03:27:06 2006
@@ -1,9 +1,9 @@
<?php
/**
- * $Header: /repository/pear/Log/Log/observer.php,v 1.16 2006/01/03 05:24:19 jon Exp $
+ * $Header: /repository/pear/Log/Log/observer.php,v 1.17 2006/03/02 03:27:06 jon Exp $
* $Horde: horde/lib/Log/observer.php,v 1.5 2000/06/28 21:36:13 jon Exp $
*
- * @version $Revision: 1.16 $
+ * @version $Revision: 1.17 $
* @package Log
*/
@@ -77,26 +77,20 @@
* it from some custom location), simply instantiate and return a new
* instance.
*/
- if (class_exist($class)) {
+ if (class_exists($class)) {
$object = new $class($priority, $conf);
return $object;
}
/* Support both the new-style and old-style file naming conventions. */
- if (file_exists(dirname(__FILE__) . '/observer_' . $type . '.php')) {
- $classfile = 'Log/observer_' . $type . '.php';
- $newstyle = true;
- } else {
+ $newstyle = true;
+ $classfile = dirname(__FILE__) . '/observer_' . $type . '.php';
+
+ if (!file_exists($classfile)) {
$classfile = 'Log/' . $type . '.php';
$newstyle = false;
}
- /* Issue a warning if the old-style conventions are being used. */
- if (!$newstyle) {
- trigger_error('Using old-style Log_observer conventions',
- E_USER_WARNING);
- }
-
/*
* Attempt to include our version of the named class, but don't treat
* a failure as fatal. The caller may have already included their own