cvs: php4 /pear/PEAR Registry.php
| From: | Stig Bakken | Date: | Mon, 10 Dec 2001 17:01:33 +0000 |
| Subject: | cvs: php4 /pear/PEAR Registry.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1504@lists.php.net to get a copy of this message | ||
ssb Mon Dec 10 12:01:33 2001 EDT
Modified files:
/php4/pear/PEAR Registry.php
Log:
* PEAR_Registry::packageInfo now takes a second arg for returning a single
attribute
Index: php4/pear/PEAR/Registry.php
diff -u php4/pear/PEAR/Registry.php:1.9 php4/pear/PEAR/Registry.php:1.10
--- php4/pear/PEAR/Registry.php:1.9 Mon Nov 12 20:06:48 2001
+++ php4/pear/PEAR/Registry.php Mon Dec 10 12:01:32 2001
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: Registry.php,v 1.9 2001/11/13 01:06:48 ssb Exp $
+// $Id: Registry.php,v 1.10 2001/12/10 17:01:32 ssb Exp $
require_once "System.php";
@@ -109,7 +109,7 @@
// }}}
// {{{ packageInfo()
- function packageInfo($package = null)
+ function packageInfo($package = null, $key = null)
{
if ($package === null) {
return array_map(array($this, "packageInfo"),
@@ -121,7 +121,14 @@
}
$data = fread($fp, filesize($this->_packageFileName($package)));
$this->_closePackageFile($fp);
- return unserialize($data);
+ $data = unserialize($data);
+ if ($key === null) {
+ return $data;
+ }
+ if (isset($data[$key])) {
+ return $data[$key];
+ }
+ return null;
}
// }}}