diff options
author | Vincent Blavet <vblavet@php.net> | 2002-01-23 19:09:54 +0000 |
---|---|---|
committer | Vincent Blavet <vblavet@php.net> | 2002-01-23 19:09:54 +0000 |
commit | 2c91e54d5a97ceef3e270ded78cfc521ba6196e9 (patch) | |
tree | 26d964ae05a588d7d7a5aed0574be7659b3bc687 /pear/scripts/pearwin.php | |
parent | 62c923452080a17c25d87cc995b28e69f5deb3bf (diff) | |
download | php-git-2c91e54d5a97ceef3e270ded78cfc521ba6196e9.tar.gz |
* Add uninstall command
* Add list-installed command
Diffstat (limited to 'pear/scripts/pearwin.php')
-rw-r--r-- | pear/scripts/pearwin.php | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/pear/scripts/pearwin.php b/pear/scripts/pearwin.php index dc43382ca5..dcba17b57a 100644 --- a/pear/scripts/pearwin.php +++ b/pear/scripts/pearwin.php @@ -1,4 +1,4 @@ -<?php +<?php // // +----------------------------------------------------------------------+ // | PHP Version 4 | @@ -77,6 +77,36 @@ switch ($command) { print "install ok\n"; } 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': include_once 'PEAR/Packager.php'; $pkginfofile = $options[1][2]; @@ -108,11 +138,13 @@ function usage($obj = null) " -d <dir> set documentation dest dir (absolute path)\n". " -h, -? display help/usage (this message)\n". "Commands:\n". + " list-installed \n". " install <package file>\n". + " uninstall <package file>\n". " package [package info file]\n". "\n"); fclose($stderr); exit; } -?> +?>
\ No newline at end of file |