cvs: php4 /pear/PEAR Common.php
| From: | Stig Bakken | Date: | Tue, 02 Apr 2002 09:21:08 +0000 |
| Subject: | cvs: php4 /pear/PEAR Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2978@lists.php.net to get a copy of this message | ||
ssb Tue Apr 2 04:21:08 2002 EDT
Modified files:
/php4/pear/PEAR Common.php
Log:
* add Frontend support to PEAR_Common::log()
Index: php4/pear/PEAR/Common.php
diff -u php4/pear/PEAR/Common.php:1.40 php4/pear/PEAR/Common.php:1.41
--- php4/pear/PEAR/Common.php:1.40 Sun Mar 31 14:04:53 2002
+++ php4/pear/PEAR/Common.php Tue Apr 2 04:21:08 2002
@@ -17,7 +17,7 @@
// | Tomas V.V.Cox <cox@idecnet.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.40 2002/03/31 19:04:53 cox Exp $
+// $Id: Common.php,v 1.41 2002/04/02 09:21:08 ssb Exp $
require_once 'PEAR.php';
require_once 'Archive/Tar.php';
@@ -68,6 +68,13 @@
*/
var $releases_states =
array('alpha','beta','stable','snapshot','devel');
+ /**
+ * User Interface object (PEAR_Frontend_* class). If null,
+ * log() uses print.
+ * @var object
+ */
+ var $ui = null;
+
// }}}
// {{{ constructor
@@ -159,7 +166,11 @@
function log($level, $msg)
{
if ($this->debug >= $level) {
- print "$msg\n";
+ if (is_object($this->ui)) {
+ $this->ui->displayLine($msg);
+ } else {
+ print "$msg\n";
+ }
}
}
@@ -192,6 +203,15 @@
}
// }}}
+ // {{{ setFrontend()
+
+ function setFrontend(&$ui)
+ {
+ $this->ui = &$ui;
+ }
+
+ // }}}
+
// {{{ _element_start()
/**