diff options
author | SVN Migration <svn@php.net> | 2002-03-13 18:39:43 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2002-03-13 18:39:43 +0000 |
commit | 8d6817e7f142091b1c30de30f349c3fde9d7e094 (patch) | |
tree | 45704599905d4a7445ad446fc5337374a3390dbf /pear/PEAR/Command | |
parent | 94e6810a2a3e189cf729bdbae8f45cd9d7987ad6 (diff) | |
download | php-git-help.tar.gz |
This commit was manufactured by cvs2svn to create tag 'help'.help
Diffstat (limited to 'pear/PEAR/Command')
-rw-r--r-- | pear/PEAR/Command/Common.php | 68 | ||||
-rw-r--r-- | pear/PEAR/Command/Install.php | 99 |
2 files changed, 0 insertions, 167 deletions
diff --git a/pear/PEAR/Command/Common.php b/pear/PEAR/Command/Common.php deleted file mode 100644 index e54c1694f1..0000000000 --- a/pear/PEAR/Command/Common.php +++ /dev/null @@ -1,68 +0,0 @@ -<?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$ - -require_once "PEAR.php"; -require_once "PEAR/CommandResponse.php"; - -class PEAR_Command_Common extends PEAR -{ - /** - * PEAR_Config object used to pass user system and configuration - * on when executing commands - * - * @var object - */ - var $config; - - /** - * PEAR_Command_Common constructor. - * - * @access public - */ - function PEAR_Command_Common() - { - parent::PEAR(); - $this->config = PEAR_Config::singleton(); - } - - /** - * Return a PEAR_CommandResponse object with parameters - * filled in. - * - * @param int status code - * @param string message text - * @param string (optional) message character encoding - * - * @return object a PEAR_CommandResponse object - * - * @access public - * - * @see PEAR_CommandResponse - */ - function &makeResponse($status, $message, $encoding = null) - { - $obj =& new PEAR_CommandResponse($status, $message, $encoding); - return $obj; - } - - -} - -?>
\ No newline at end of file diff --git a/pear/PEAR/Command/Install.php b/pear/PEAR/Command/Install.php deleted file mode 100644 index 0d99f85b1a..0000000000 --- a/pear/PEAR/Command/Install.php +++ /dev/null @@ -1,99 +0,0 @@ -<?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$ - -require_once "PEAR/Command/Common.php"; -require_once "PEAR/Installer.php"; - -/** - * PEAR commands for installation or deinstallation/upgrading of - * packages. - * - */ -class PEAR_Command_Install extends PEAR_Command_Common -{ - /** Stack of executing commands, to make run() re-entrant - * @var array - */ - var $command_stack; // XXX UNUSED to make run() re-entrant - - /** Currently executing command. - * @var string - */ - var $command; // XXX UNUSED - - /** - * PEAR_Command_Install constructor. - * - * @access public - */ - function PEAR_Command_Install() - { - parent::PEAR_Command_Common(); - } - - /** - * Return a list of all the commands defined by this class. - * @return array list of commands - * @access public - */ - function getCommands() - { - return array('install', 'uninstall', 'upgrade'); - } - - function run($command, $options, $params) - { - $installer =& new PEAR_Installer($options['php_dir'], - $options['ext_dir'], - $options['doc_dir']); - $installer->debug = @$options['verbose']; - $status = PEAR_COMMAND_SUCCESS; - ob_start(); - switch ($command) { - case 'install': - case 'upgrade': { - if ($command == 'upgrade') { - $options['upgrade'] = true; - } - if ($installer->install($params[0], $options, $this->config)) { - print "install ok\n"; - } else { - print "install failed\n"; - $status = PEAR_COMMAND_FAILURE; - } - break; - } - case 'uninstall': { - if ($installer->uninstall($params[0], $uninstall_options)) { - print "uninstall ok\n"; - } else { - print "uninstall failed\n"; - $status = PEAR_COMMAND_FAILURE; - } - break; - } - } - $output = ob_get_contents(); - ob_end_clean(); - return $this->makeResponse($status, $output); - } -} - -?>
\ No newline at end of file |