summaryrefslogtreecommitdiff
path: root/pear/PEAR/Installer.php
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2002-05-12 21:09:04 +0000
committerStig Bakken <ssb@php.net>2002-05-12 21:09:04 +0000
commit3bc12ac2423f9e8af5d1481b9e997662d1e248f6 (patch)
tree5ea3e615734f330960d285f74ea15f1c466d831e /pear/PEAR/Installer.php
parentd7e00e32850a92533afc1c64400f6a81183d4cc9 (diff)
downloadphp-git-3bc12ac2423f9e8af5d1481b9e997662d1e248f6.tar.gz
* refactored the command/options code:
- now each command class should define a "commands" property with documentation, option specs etc. - both long and short options are now supported - after recent changes to Console_Getopt, you may now have options to commands even though the same option is also valid for the pear command itself - less CLI-centric, better suited to Gtk and Web frontends
Diffstat (limited to 'pear/PEAR/Installer.php')
-rw-r--r--pear/PEAR/Installer.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php
index 92191ee894..0bbea5365a 100644
--- a/pear/PEAR/Installer.php
+++ b/pear/PEAR/Installer.php
@@ -271,13 +271,13 @@ class PEAR_Installer extends PEAR_Common
*
* @param $pkgfile path to the package file
*
- * @return bool true if successful, false if not
+ * @return array package info if successful, null if not
*/
function install($pkgfile, $options = array())
{
// recognized options:
- // - register_only : update registry but don't install files
+ // - register-only : update registry but don't install files
// - upgrade : upgrade existing install
// - soft : fail silently
//
@@ -379,7 +379,7 @@ class PEAR_Installer extends PEAR_Common
if (empty($options['soft'])) {
$this->log(0, $error);
}
- return $this->raiseError('Dependencies failed');
+ return $this->raiseError("$pkgname: dependencies failed");
}
}
@@ -399,7 +399,7 @@ class PEAR_Installer extends PEAR_Common
if (empty($options['force']) && !version_compare($v2, $v1, 'gt')) {
return $this->raiseError("upgrade to a newer version ($v2 is not newer than $v1)");
}
- if (empty($options['register_only'])) {
+ if (empty($options['register-only'])) {
// when upgrading, remove old release's files first:
if (PEAR::isError($err = $this->_deletePackageFiles($pkgname))) {
return $this->raiseError($err);
@@ -411,7 +411,7 @@ class PEAR_Installer extends PEAR_Common
// info from the package it self we want to access from _installFile
$this->pkginfo = $pkginfo;
- if (empty($options['register_only'])) {
+ if (empty($options['register-only'])) {
if (!is_dir($this->config->get('php_dir'))) {
return $this->raiseError("no script destination directory\n",
null, PEAR_ERROR_DIE);
@@ -446,7 +446,10 @@ class PEAR_Installer extends PEAR_Common
} else {
$ret = $this->registry->updatePackage($pkgname, $this->pkginfo, false);
}
- return $ret;
+ if (!$ret) {
+ return null;
+ }
+ return $pkginfo;
}
// }}}