mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
* Add uninstall command
* Add list-installed command
This commit is contained in:
parent
62c9234520
commit
2c91e54d5a
1 changed files with 34 additions and 2 deletions
|
@ -77,6 +77,36 @@ switch ($command) {
|
||||||
print "install ok\n";
|
print "install ok\n";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'uninstall':
|
||||||
|
include_once 'PEAR/Installer.php';
|
||||||
|
$package = $options[1][2];
|
||||||
|
$installer =& new PEAR_Installer($script_dir, $ext_dir, $doc_dir);
|
||||||
|
$installer->debug = $verbose;
|
||||||
|
if (PEAR::isError($installer->uninstall($package))) {
|
||||||
|
print "\nuninstall failed\n";
|
||||||
|
} else {
|
||||||
|
print "uninstall ok\n";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'list-installed':
|
||||||
|
include_once 'PEAR/Registry.php';
|
||||||
|
$reg = new PEAR_Registry;
|
||||||
|
$installed = $reg->packageInfo();
|
||||||
|
$i = $j = 0;
|
||||||
|
print("Installed packages:\n");
|
||||||
|
foreach ($installed as $package) {
|
||||||
|
if ($i++ % 20 == 0) {
|
||||||
|
if ($j++ > 0) {
|
||||||
|
print "\n";
|
||||||
|
}
|
||||||
|
printf("%-20s %-10s %s\n",
|
||||||
|
"Package", "Version", "State");
|
||||||
|
print str_repeat("-", 75)."\n";
|
||||||
|
}
|
||||||
|
printf("%-20s %-10s %s\n", $package['package'],
|
||||||
|
$package['version'], $package['release_state']);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'package':
|
case 'package':
|
||||||
include_once 'PEAR/Packager.php';
|
include_once 'PEAR/Packager.php';
|
||||||
$pkginfofile = $options[1][2];
|
$pkginfofile = $options[1][2];
|
||||||
|
@ -108,7 +138,9 @@ function usage($obj = null)
|
||||||
" -d <dir> set documentation dest dir (absolute path)\n".
|
" -d <dir> set documentation dest dir (absolute path)\n".
|
||||||
" -h, -? display help/usage (this message)\n".
|
" -h, -? display help/usage (this message)\n".
|
||||||
"Commands:\n".
|
"Commands:\n".
|
||||||
|
" list-installed \n".
|
||||||
" install <package file>\n".
|
" install <package file>\n".
|
||||||
|
" uninstall <package file>\n".
|
||||||
" package [package info file]\n".
|
" package [package info file]\n".
|
||||||
"\n");
|
"\n");
|
||||||
fclose($stderr);
|
fclose($stderr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue