diff options
author | Stig Bakken <ssb@php.net> | 2002-05-29 03:35:20 +0000 |
---|---|---|
committer | Stig Bakken <ssb@php.net> | 2002-05-29 03:35:20 +0000 |
commit | 41df5bcd5ab31f2e876e14b82bf1d80f996547ef (patch) | |
tree | a92bdea6b5f1d1c999e7a56e889066d74e807aaf | |
parent | b70685fd1ba98071853f77543eb56d6b8fff265b (diff) | |
download | php-git-41df5bcd5ab31f2e876e14b82bf1d80f996547ef.tar.gz |
* for now, provoke php errors on calls to the old methods
-rw-r--r-- | pear/PEAR/Frontend/CLI.php | 110 |
1 files changed, 78 insertions, 32 deletions
diff --git a/pear/PEAR/Frontend/CLI.php b/pear/PEAR/Frontend/CLI.php index 3b14c45d9b..ed57378888 100644 --- a/pear/PEAR/Frontend/CLI.php +++ b/pear/PEAR/Frontend/CLI.php @@ -68,11 +68,24 @@ class PEAR_Frontend_CLI extends PEAR function displayLine($text) { + trigger_error("Frontend::displayLine deprecated", E_USER_ERROR); + } + + function _displayLine($text) + { print "$this->lp$text\n"; } + // }}} + // {{{ display(text) + function display($text) { + trigger_error("Frontend::display deprecated", E_USER_ERROR); + } + + function _display($text) + { print $text; } @@ -81,7 +94,12 @@ class PEAR_Frontend_CLI extends PEAR function displayError($eobj) { - return $this->displayLine($eobj->getMessage()); + trigger_error("Frontend::displayError deprecated", E_USER_ERROR); + } + + function _displayError($eobj) + { + return $this->_displayLine($eobj->getMessage()); } // }}} @@ -89,7 +107,12 @@ class PEAR_Frontend_CLI extends PEAR function displayFatalError($eobj) { - $this->displayError($eobj); + trigger_error("Frontend::displayFatalError deprecated", E_USER_ERROR); + } + + function _displayFatalError($eobj) + { + $this->_displayError($eobj); exit(1); } @@ -98,6 +121,11 @@ class PEAR_Frontend_CLI extends PEAR function displayHeading($title) { + trigger_error("Frontend::displayHeading deprecated", E_USER_ERROR); + } + + function _displayHeading($title) + { print $this->lp.$this->bold($title)."\n"; print $this->lp.str_repeat("=", strlen($title))."\n"; } @@ -142,6 +170,7 @@ class PEAR_Frontend_CLI extends PEAR function userConfirm($prompt, $default = 'yes') { + trigger_error("Frontend::userConfirm not yet converted", E_USER_ERROR); static $positives = array('y', 'yes', 'on', '1'); static $negatives = array('n', 'no', 'off', '0'); print "$this->lp$prompt [$default] : "; @@ -169,6 +198,11 @@ class PEAR_Frontend_CLI extends PEAR function startTable($params = array()) { + trigger_error("Frontend::startTable deprecated", E_USER_ERROR); + } + + function _startTable($params = array()) + { $this->omode = 'table'; $params['table_data'] = array(); $params['widest'] = array(); // indexed by column @@ -182,6 +216,11 @@ class PEAR_Frontend_CLI extends PEAR function tableRow($columns, $rowparams = array(), $colparams = array()) { + trigger_error("Frontend::tableRow deprecated", E_USER_ERROR); + } + + function _tableRow($columns, $rowparams = array(), $colparams = array()) + { $highest = 1; for ($i = 0; $i < sizeof($columns); $i++) { $col = &$columns[$i]; @@ -227,10 +266,15 @@ class PEAR_Frontend_CLI extends PEAR function endTable() { + trigger_error("Frontend::tableRow deprecated", E_USER_ERROR); + } + + function _endTable() + { $this->omode = ''; extract($this->params); if (!empty($caption)) { - $this->displayHeading($caption); + $this->_displayHeading($caption); } if (count($table_data) == 0) { return; @@ -262,7 +306,7 @@ class PEAR_Frontend_CLI extends PEAR } } if ($borderline) { - $this->displayLine($borderline); + $this->_displayLine($borderline); } for ($i = 0; $i < sizeof($table_data); $i++) { extract($table_data[$i]); @@ -306,45 +350,47 @@ class PEAR_Frontend_CLI extends PEAR $rowtext .= $cellstart . $cell . $cellend; } $rowtext .= $rowend; - $this->displayLine($rowtext); + $this->_displayLine($rowtext); } } if ($borderline) { - $this->displayLine($borderline); + $this->_displayLine($borderline); } } + // }}} + // {{{ outputData() + function outputData($data, $command) { switch ($command) { - case 'list-all': - $this->startTable($data); - if (isset($data['headline']) && is_array($data['headline'])) - $this->tableRow($data['headline'], array('bold' => true), array(1 => array('wrap' => 55))); - - foreach($data['data'] as $category) { - foreach($category as $pkg) { - unset($pkg[3]); - $this->tableRow($pkg, null, array(1 => array('wrap' => 55))); - } - }; - $this->endTable(); - break; - default: - if (is_array($data)) - { - $this->startTable($data); + case 'list-all': + $this->_startTable($data); if (isset($data['headline']) && is_array($data['headline'])) - $this->tableRow($data['headline'], array('bold' => true), array(1 => array('wrap' => 55))); - foreach($data['data'] as $row) - $this->tableRow($row); - $this->endTable(); - } else { - $this->displayLine($data); - }; - }; - + $this->_tableRow($data['headline'], array('bold' => true), array(1 => array('wrap' => 55))); + + foreach($data['data'] as $category) { + foreach($category as $pkg) { + unset($pkg[3]); + $this->_tableRow($pkg, null, array(1 => array('wrap' => 55))); + } + }; + $this->_endTable(); + break; + default: + if (is_array($data)) + { + $this->_startTable($data); + if (isset($data['headline']) && is_array($data['headline'])) + $this->_tableRow($data['headline'], array('bold' => true), array(1 => array('wrap' => 55))); + foreach($data['data'] as $row) + $this->_tableRow($row); + $this->_endTable(); + } else { + $this->_displayLine($data); + } + } } // }}} |