From: Tomas V.V.Cox Date: Mon, 1 Apr 2002 17:25:42 +0000 (+0000) Subject: - Added "nodeps" option to install/upgrade/uninstall X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~928 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=827334cd2fd94ce4650ba9e3c4574da90d625d83;p=php - Added "nodeps" option to install/upgrade/uninstall (pear install -n package.tgz) - Finish to document the install commands --- diff --git a/pear/PEAR/Command/Install.php b/pear/PEAR/Command/Install.php index 1960bc55c3..a458f69a79 100644 --- a/pear/PEAR/Command/Install.php +++ b/pear/PEAR/Command/Install.php @@ -61,15 +61,24 @@ class PEAR_Command_Install extends PEAR_Command_Common { switch ($command) { case 'install': - return array('', + $ret = array('', 'Installs a PEAR package created by the "package" command'); + break; case 'uninstall': - return array('', + $ret = array('', 'Uninstalls a previously installed PEAR package'); + break; case 'upgrade': - return array('', + $ret = array('', 'Upgrades a PEAR package installed in the system'); + break; } + $ret[0] = "[-n] [-f] {$ret[0]}"; + $ret[1] = "{$ret[1]}\n" . + " -f forces the installation of the package\n". + " when it is already installed\n". + " -n do not take care package dependencies"; + return $ret; } // }}} @@ -84,15 +93,17 @@ class PEAR_Command_Install extends PEAR_Command_Common $failmsg = ''; $opts = array(); + if (isset($options['f'])) { + $opts['force'] = true; + } + if (isset($options['n'])) { + $opts['nodeps'] = true; + } switch ($command) { case 'upgrade': $opts['upgrade'] = true; // fall through case 'install': { - if (isset($options['f'])) { - $opts['force'] = true; - } - // XXX The ['nodeps'] option is still missing if ($installer->install(@$params[0], $opts, $this->config)) { $this->ui->displayLine("install ok"); } else { @@ -122,7 +133,7 @@ class PEAR_Command_Install extends PEAR_Command_Common function getOptions() { - return array('f'); + return array('f', 'n'); } }