1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00

Make the error handling work again since the new internal command

structure
This commit is contained in:
Tomas V.V.Cox
2002-05-26 19:08:21 +00:00
parent e75fe514a1
commit 8cd936095b
+19 -19
View File
@@ -83,8 +83,7 @@ in. The default layer is "user".
{
// $params[0] -> the layer
if ($error = $this->_checkLayer(@$params[0])) {
$failmsg .= $error;
break;
return $this->raiseError($error);
}
$keys = $this->config->getKeys();
sort($keys);
@@ -115,11 +114,10 @@ in. The default layer is "user".
// $params[0] -> the parameter
// $params[1] -> the layer
if ($error = $this->_checkLayer(@$params[1])) {
$failmsg .= $error;
break;
return $this->raiseError($error);
}
if (sizeof($params) < 1 || sizeof($params) > 2) {
$failmsg .= "config-get expects 1 or 2 parameters";
return $this->raiseError("config-get expects 1 or 2 parameters");
} elseif (sizeof($params) == 1) {
$this->ui->displayLine("$params[0] = " . $this->config->get($params[0]));
} else {
@@ -135,20 +133,22 @@ in. The default layer is "user".
// $param[1] -> the value for the parameter
// $param[2] -> the layer
$failmsg = '';
if (sizeof($params) < 2 || sizeof($params) > 3) {
$failmsg .= "config-set expects 2 or 3 parameters";
break;
}
if ($error = $this->_checkLayer(@$params[2])) {
$failmsg .= $error;
break;
}
if (!call_user_func_array(array(&$this->config, 'set'), $params))
{
$failmsg = "config-set (" . implode(", ", $params) . ") failed";
} else {
$this->config->store();
}
do {
if (sizeof($params) < 2 || sizeof($params) > 3) {
$failmsg .= "config-set expects 2 or 3 parameters";
break;
}
if ($error = $this->_checkLayer(@$params[2])) {
$failmsg .= $error;
break;
}
if (!call_user_func_array(array(&$this->config, 'set'), $params))
{
$failmsg = "config-set (" . implode(", ", $params) . ") failed";
} else {
$this->config->store();
}
} while (false);
if ($failmsg) {
return $this->raiseError($failmsg);
}