cvs: php4 /pear/PEAR Command.php /pear/PEAR/Command Common.php Install.php Package.php
| From: | Tomas V.V.Cox | Date: | Mon, 01 Apr 2002 14:32:40 +0000 |
| Subject: | cvs: php4 /pear/PEAR Command.php /pear/PEAR/Command Common.php Install.php Package.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2938@lists.php.net to get a copy of this message | ||
cox Mon Apr 1 09:32:40 2002 EDT
Modified files:
/php4/pear/PEAR Command.php
/php4/pear/PEAR/Command Common.php Install.php Package.php
Log:
Go with the help system
Index: php4/pear/PEAR/Command.php
diff -u php4/pear/PEAR/Command.php:1.7 php4/pear/PEAR/Command.php:1.8
--- php4/pear/PEAR/Command.php:1.7 Fri Mar 22 04:22:24 2002
+++ php4/pear/PEAR/Command.php Mon Apr 1 09:32:39 2002
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: Command.php,v 1.7 2002/03/22 09:22:24 ssb Exp $
+// $Id: Command.php,v 1.8 2002/04/01 14:32:39 cox Exp $
require_once "PEAR.php";
@@ -204,6 +204,15 @@
PEAR_Command::registerCommands();
}
return $GLOBALS['_PEAR_Command_commandopts'];
+ }
+
+ function getHelp($command)
+ {
+ $cmds = PEAR_Command::getCommands();
+ if (isset($cmds[$command])) {
+ return call_user_func(array($cmds[$command], 'getHelp'), $command);
+ }
+ return false;
}
}
Index: php4/pear/PEAR/Command/Common.php
diff -u php4/pear/PEAR/Command/Common.php:1.7 php4/pear/PEAR/Command/Common.php:1.8
--- php4/pear/PEAR/Command/Common.php:1.7 Fri Mar 22 04:22:26 2002
+++ php4/pear/PEAR/Command/Common.php Mon Apr 1 09:32:40 2002
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.7 2002/03/22 09:22:26 ssb Exp $
+// $Id: Common.php,v 1.8 2002/04/01 14:32:40 cox Exp $
require_once "PEAR.php";
//require_once "PEAR/CommandResponse.php";
@@ -52,6 +52,11 @@
function getOptions()
{
return array();
+ }
+
+ function getHelp($command)
+ {
+ return array(null, 'No help avaible yet');
}
/**
Index: php4/pear/PEAR/Command/Install.php
diff -u php4/pear/PEAR/Command/Install.php:1.10 php4/pear/PEAR/Command/Install.php:1.11
--- php4/pear/PEAR/Command/Install.php:1.10 Sat Mar 23 10:56:14 2002
+++ php4/pear/PEAR/Command/Install.php Mon Apr 1 09:32:40 2002
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: Install.php,v 1.10 2002/03/23 15:56:14 cox Exp $
+// $Id: Install.php,v 1.11 2002/04/01 14:32:40 cox Exp $
require_once "PEAR/Command/Common.php";
require_once "PEAR/Installer.php";
@@ -55,6 +55,21 @@
function getCommands()
{
return array('install', 'uninstall', 'upgrade');
+ }
+
+ function getHelp($command)
+ {
+ switch ($command) {
+ case 'install':
+ return array('<pear package>',
+ 'Installs a PEAR package created by the "package"
command');
+ case 'uninstall':
+ return array('<package>',
+ 'Uninstalls a previously installed PEAR package');
+ case 'upgrade':
+ return array('<pear package>',
+ 'Upgrades a PEAR package installed in the system');
+ }
}
// }}}
Index: php4/pear/PEAR/Command/Package.php
diff -u php4/pear/PEAR/Command/Package.php:1.11 php4/pear/PEAR/Command/Package.php:1.12
--- php4/pear/PEAR/Command/Package.php:1.11 Thu Mar 28 21:39:33 2002
+++ php4/pear/PEAR/Command/Package.php Mon Apr 1 09:32:40 2002
@@ -1,4 +1,22 @@
<?php
+//
+// +----------------------------------------------------------------------+
+// | PHP Version 4 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 1997-2002 The PHP Group |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 2.02 of the PHP license, |
+// | that is bundled with this package in the file LICENSE, and is |
+// | available at through the world-wide-web at |
+// | http://www.php.net/license/2_02.txt.
|
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Author: Stig Bakken <ssb@fast.no> |
+// +----------------------------------------------------------------------+
+//
+// $Id: Package.php,v 1.12 2002/04/01 14:32:40 cox Exp $
require_once 'PEAR/Command/Common.php';
require_once 'PEAR/Packager.php';
@@ -35,6 +53,24 @@
}
// }}}
+
+ function getHelp($command)
+ {
+ switch ($command) {
+ case 'package':
+ return array('[<package.xml>]',
+ 'Creates a PEAR package from its description file (usually
'.
+ 'named as package.xml)');
+ case 'package-list':
+ return array('<pear package>',
+ 'List the contents of a PEAR package');
+ case 'packge-info':
+ return array('<pear package>',
+ 'Shows information about a PEAR package');
+ }
+ }
+
+
// {{{ run()
/**
@@ -216,7 +252,6 @@
}
// }}}
-
}