cvs: php4(NEW_UI_API) /pear/PEAR/Frontend CLI.php
| From: | Stig Bakken | Date: | Wed, 29 May 2002 03:35:20 +0000 |
| Subject: | cvs: php4(NEW_UI_API) /pear/PEAR/Frontend CLI.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4223@lists.php.net to get a copy of this message | ||
ssb Tue May 28 23:35:20 2002 EDT
Modified files: (Branch: NEW_UI_API)
/php4/pear/PEAR/Frontend CLI.php
Log:
* for now, provoke php errors on calls to the old methods
Index: php4/pear/PEAR/Frontend/CLI.php
diff -u php4/pear/PEAR/Frontend/CLI.php:1.12.2.2 php4/pear/PEAR/Frontend/CLI.php:1.12.2.3
--- php4/pear/PEAR/Frontend/CLI.php:1.12.2.2 Tue May 28 09:02:10 2002
+++ php4/pear/PEAR/Frontend/CLI.php Tue May 28 23:35:20 2002
@@ -16,7 +16,7 @@
| Author: Stig Sæther Bakken <ssb@fast.no> |
+----------------------------------------------------------------------+
- $Id: CLI.php,v 1.12.2.2 2002/05/28 13:02:10 ssb Exp $
+ $Id: CLI.php,v 1.12.2.3 2002/05/29 03:35:20 ssb Exp $
*/
require_once "PEAR.php";
@@ -68,11 +68,24 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
}
if ($borderline) {
- $this->displayLine($borderline);
+ $this->_displayLine($borderline);
}
for ($i = 0; $i < sizeof($table_data); $i++) {
extract($table_data[$i]);
@@ -306,45 +350,47 @@
$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);
+ }
+ }
}
// }}}