cvs: pear-core /PEAR/Command Common.php
| From: | Pierre-Alain Joye | Date: | Thu, 02 Mar 2006 16:13:45 +0000 |
| Subject: | cvs: pear-core /PEAR/Command Common.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-4587@lists.php.net to get a copy of this message | ||
pajoye Thu Mar 2 16:13:45 2006 UTC
Modified files:
/pear-core/PEAR/Command Common.php
Log:
- silent notices in common::run()
- test once each case
http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Command/Common.php?r1=1.30&r2=1.31&diff_format=u
Index: pear-core/PEAR/Command/Common.php
diff -u pear-core/PEAR/Command/Common.php:1.30 pear-core/PEAR/Command/Common.php:1.31
--- pear-core/PEAR/Command/Common.php:1.30 Fri Jan 6 04:47:36 2006
+++ pear-core/PEAR/Command/Common.php Thu Mar 2 16:13:45 2006
@@ -16,7 +16,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Common.php,v 1.30 2006/01/06 04:47:36 cellog Exp $
+ * @version CVS: $Id: Common.php,v 1.31 2006/03/02 16:13:45 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
@@ -254,16 +254,17 @@
function run($command, $options, $params)
{
- $func = @$this->commands[$command]['function'];
- if (empty($func)) {
+ if (empty($this->commands[$command]['function'])) {
// look for shortcuts
foreach (array_keys($this->commands) as $cmd) {
- if (@$this->commands[$cmd]['shortcut'] == $command) {
- $command = $cmd;
- $func = @$this->commands[$command]['function'];
- if (empty($func)) {
+ if (isset($this->commands[$cmd]['shortcut']) &&
$this->commands[$cmd]['shortcut'] == $command) {
+
+ if (empty($this->commands[$cmd]['function'])) {
return $this->raiseError("unknown command `$command'");
+ } else {
+ $func = $this->commands[$cmd]['function'];
}
+ $command = $cmd;
break;
}
}