summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2002-06-07 14:50:39 +0000
committerTomas V.V.Cox <cox@php.net>2002-06-07 14:50:39 +0000
commitf3673c8798c2a063e436eabe49fd21071e91a8a1 (patch)
treedede3c7e7ff46d428f07b56361be6c98f6daedb8
parent8f21117efb08c073561332fc26c0ac7d22ef1e06 (diff)
downloadphp-git-f3673c8798c2a063e436eabe49fd21071e91a8a1.tar.gz
- Reapplied the "treat umask as octal in "config-set"
command" Stig's patch - Ported the config-help command to new UI API
-rw-r--r--pear/PEAR/Command/Config.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/pear/PEAR/Command/Config.php b/pear/PEAR/Command/Config.php
index 296119e286..2639ad77f7 100644
--- a/pear/PEAR/Command/Config.php
+++ b/pear/PEAR/Command/Config.php
@@ -67,6 +67,16 @@ argument may be used to specify which layer to set the configuration parameter
in. The default layer is "user".
',
),
+ 'config-help' => array(
+ 'summary' => 'Show Information About Setting',
+ 'function' => 'doConfigHelp',
+ 'shortcut' => 'ch',
+ 'options' => array(),
+ 'doc' => '[parameter]
+Displays help for a configuration parameter. Without arguments it
+displays help for all configuration parameters.
+',
+ ),
);
/**
@@ -137,6 +147,9 @@ in. The default layer is "user".
$failmsg .= $error;
return PEAR::raiseError($failmsg);
}
+ if ($params[0] == 'umask') {
+ list($params[1]) = sscanf($params[1], '%o');
+ }
if (!call_user_func_array(array(&$this->config, 'set'), $params))
{
$failmsg = "config-set (" . implode(", ", $params) . ") failed";
@@ -149,6 +162,26 @@ in. The default layer is "user".
return true;
}
+ function doConfigHelp($command, $options, $params)
+ {
+ if (empty($params)) {
+ $params = $this->config->getKeys();
+ }
+ $data['caption'] = "Config help" . ((count($params) == 1) ? " for $params[0]" : '');
+ $data['headline'] = array('Name', 'Type', 'Description');
+ $data['border'] = true;
+ foreach ($params as $name) {
+ $type = $this->config->getType($name);
+ $docs = $this->config->getDocs($name);
+ if ($type == 'set') {
+ $docs = rtrim($docs) . "\nValid set: " .
+ implode(' ', $this->config->getSetValues($name));
+ }
+ $data['data'][] = array($name, $type, $docs);
+ }
+ $this->ui->outputData($data, $command);
+ }
+
/**
* Checks if a layer is defined or not
*