diff options
author | Christian Dickmann <dickmann@php.net> | 2002-05-29 12:59:13 +0000 |
---|---|---|
committer | Christian Dickmann <dickmann@php.net> | 2002-05-29 12:59:13 +0000 |
commit | 451ae6a4afce16c91df68488fdfc3800bfdd69b3 (patch) | |
tree | 71c980472c5ef80620d1df6321f508f12f303bd3 | |
parent | 047ed8c727afee3b764dc5b51bd04a8796141719 (diff) | |
download | php-git-451ae6a4afce16c91df68488fdfc3800bfdd69b3.tar.gz |
fix a bug and add UI::log
-rw-r--r-- | pear/PEAR/Command/Install.php | 5 | ||||
-rw-r--r-- | pear/PEAR/Common.php | 3 | ||||
-rw-r--r-- | pear/PEAR/Frontend/CLI.php | 6 | ||||
-rw-r--r-- | pear/PEAR/Installer.php | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/pear/PEAR/Command/Install.php b/pear/PEAR/Command/Install.php index eac3c0a06b..cabd97ff1f 100644 --- a/pear/PEAR/Command/Install.php +++ b/pear/PEAR/Command/Install.php @@ -149,7 +149,7 @@ specified at once. function doInstall($command, $options, $params) { if (empty($this->installer)) { - $this->installer = &new PEAR_Installer($ui); + $this->installer = &new PEAR_Installer($this->ui); } if ($command == 'upgrade') { $options[$command] = true; @@ -166,12 +166,13 @@ specified at once. return $this->raiseError("$command failed"); } } + return true; } function doUninstall($command, $options, $params) { if (empty($this->installer)) { - $this->installer = &new PEAR_Installer($ui); + $this->installer = &new PEAR_Installer($this->ui); } foreach ($params as $pkg) { if ($this->installer->uninstall($pkg, $options)) { diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index b4e1ccca2f..6629b64d59 100644 --- a/pear/PEAR/Common.php +++ b/pear/PEAR/Common.php @@ -210,8 +210,7 @@ class PEAR_Common extends PEAR { if ($this->debug >= $level) { if (is_object($this->ui)) { - // XXX convert to new Frontend API? - $this->ui->outputData($msg, 'unknown'); + $this->ui->log($msg); } else { print "$msg\n"; } diff --git a/pear/PEAR/Frontend/CLI.php b/pear/PEAR/Frontend/CLI.php index ed57378888..c829937812 100644 --- a/pear/PEAR/Frontend/CLI.php +++ b/pear/PEAR/Frontend/CLI.php @@ -394,6 +394,12 @@ class PEAR_Frontend_CLI extends PEAR } // }}} + + function log($text) + { + return $this->displayLine($text); + } + // {{{ bold($text) function bold($text) diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index be1540f7a9..db9ae28a1f 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -531,6 +531,8 @@ class PEAR_Installer extends PEAR_Common $this->log(1, '...done: ' . number_format($params, 0, '', ',') . ' bytes'); break; } + if (method_exists($this->ui, '_downloadCallback')) + $this->ui->_downloadCallback($msg, $params); } // }}} |