summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2002-06-06 07:25:07 +0000
committerTomas V.V.Cox <cox@php.net>2002-06-06 07:25:07 +0000
commit41e7696ec97f95d3f3d7a9664ef1b0d44ca36f9b (patch)
tree4f0aea18c3da0f8fa220ac20fad579178825cb1d
parentec9c0bf0a7fcfd22a56affd963d5d5d64e5fa17d (diff)
downloadphp-git-41e7696ec97f95d3f3d7a9664ef1b0d44ca36f9b.tar.gz
Implemented "pear info <Installed Package>" command
# Stig, why I'm sure that you already have implemented this # command? Have to stop with my LSD therapy
-rw-r--r--pear/PEAR/Command/Registry.php33
1 files changed, 31 insertions, 2 deletions
diff --git a/pear/PEAR/Command/Registry.php b/pear/PEAR/Command/Registry.php
index 1196a870c6..84ba59decf 100644
--- a/pear/PEAR/Command/Registry.php
+++ b/pear/PEAR/Command/Registry.php
@@ -50,6 +50,13 @@ Tests if a package is installed in the system. Will exit(1) if it is not.
<, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne
<version> The version to compare with
'),
+ 'info' => array(
+ 'summary' => 'Information of an installed package',
+ 'function' => 'doInfo',
+ 'shortcut' => 'i',
+ 'options' => array(),
+ 'doc' => '[package] Displays the information of an installed package'
+ )
);
// }}}
@@ -159,7 +166,7 @@ Tests if a package is installed in the system. Will exit(1) if it is not.
}
$this->ui->outputData($data, $command);
-
+
}
return true;
}
@@ -167,7 +174,8 @@ Tests if a package is installed in the system. Will exit(1) if it is not.
// }}}
// {{{ doShellTest()
- function doShellTest($command, $options, $params) {
+ function doShellTest($command, $options, $params)
+ {
$this->pushErrorHandling(PEAR_ERROR_RETURN);
$reg = &new PEAR_Registry($this->config->get('php_dir'));
// "pear shell-test Foo"
@@ -195,6 +203,27 @@ Tests if a package is installed in the system. Will exit(1) if it is not.
}
// }}}
+ // {{{ doInfo
+
+ function doInfo($command, $options, $params)
+ {
+ // $params[0] The package for showing info
+ if (sizeof($params) != 1) {
+ return $this->raiseError("This command only accepts one param: ".
+ "the package you want information");
+ }
+ $package = $params[0];
+ $reg = &new PEAR_Registry($this->config->get('php_dir'));
+ if (!$reg->packageExists($package)) {
+ return $this->raiseError("The package $package is not installed");
+ }
+ $info = $reg->packageInfo($package);
+ include_once 'PEAR/Command/Package.php';
+ $data = &PEAR_Command_Package::_infoForDisplaying($info);
+ $this->ui->outputData($data, $command);
+ }
+
+ // }}}
}
?> \ No newline at end of file