cvs: pear-core /PEAR Registry.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Thu, 14 May 2009 01:34:21 +0000 |
| Subject: | cvs: pear-core /PEAR Registry.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-8402@lists.php.net to get a copy of this message | ||
dufuz Thu May 14 01:34:21 2009 UTC
Modified files:
/pear-core/PEAR Registry.php
Log:
Cosmetics
http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Registry.php?r1=1.179&r2=1.180&diff_format=u
Index: pear-core/PEAR/Registry.php
diff -u pear-core/PEAR/Registry.php:1.179 pear-core/PEAR/Registry.php:1.180
--- pear-core/PEAR/Registry.php:1.179 Fri Apr 10 19:42:18 2009
+++ pear-core/PEAR/Registry.php Thu May 14 01:34:21 2009
@@ -11,7 +11,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php
New BSD License
- * @version CVS: $Id: Registry.php,v 1.179 2009/04/10 19:42:18 dufuz Exp $
+ * @version CVS: $Id: Registry.php,v 1.180 2009/05/14 01:34:21 dufuz Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -1774,11 +1774,13 @@
if (PEAR::isError($e = $this->_lock(LOCK_EX))) {
return $e;
}
+
$ret = $this->_deleteChannel($channel);
$this->_unlock();
if ($ret && is_a($this->_config, 'PEAR_Config')) {
$this->_config->setChannels($this->listChannels());
}
+
return $ret;
}
@@ -1792,20 +1794,20 @@
*/
function addChannel($channel, $lastmodified = false, $update = false)
{
- if (!is_a($channel, 'PEAR_ChannelFile')) {
- return false;
- }
- if (!$channel->validate()) {
+ if (!is_a($channel, 'PEAR_ChannelFile') || !$channel->validate()) {
return false;
}
+
if (PEAR::isError($e = $this->_lock(LOCK_EX))) {
return $e;
}
+
$ret = $this->_addChannel($channel, $update, $lastmodified);
$this->_unlock();
if (!$update && $ret && is_a($this->_config, 'PEAR_Config')) {
$this->_config->setChannels($this->listChannels());
}
+
return $ret;
}
@@ -1817,12 +1819,9 @@
if (PEAR::isError($e = $this->_lock(LOCK_EX))) {
return $e;
}
+
$file = $this->_packageFileName($package, $channel);
- if (file_exists($file)) {
- $ret = @unlink($file);
- } else {
- $ret = false;
- }
+ $ret = file_exists($file) ? @unlink($file) : false;
$this->_rebuildFileMap();
$this->_unlock();
$p = array('channel' => $channel, 'package' => $package);