Source for file Config.php
Documentation is available at Config.php 
// +----------------------------------------------------------------------+  
// +----------------------------------------------------------------------+  
// | Copyright (c) 1997-2004 The PHP Group                                |  
// +----------------------------------------------------------------------+  
// | This source file is subject to version 3.0 of the PHP license,       |  
// | that is bundled with this package in the file LICENSE, and is        |  
// | available through the world-wide-web at the following url:           |  
// | http://www.php.net/license/3_0.txt.                                  |  
// | If you did not receive a copy of the PHP license and are unable to   |  
// | obtain it through the world-wide-web, please send a note to          |  
// | license@php.net so we can mail you a copy immediately.               |  
// +----------------------------------------------------------------------+  
// | Author: Stig Bakken <ssb@php.net>                                    |  
// |         Tomas V.V.Cox <cox@idecnet.com>                              |  
// +----------------------------------------------------------------------+  
// $Id: Config.php,v 1.27 2004/06/15 16:48:49 pajoye Exp $  
require_once "PEAR/Command/Common.php";   
require_once "PEAR/Config.php";   
 * PEAR commands for managing configuration data.  
class PEAR_Command_Config  extends PEAR_Command_Common   
            'summary' =>  'Show All Settings',  
            'function' =>  'doConfigShow',  
Displays all configuration values.  An optional argument  
may be used to tell which configuration layer to display.  Valid  
configuration layers are "user", "system" and "default".  
            'summary' =>  'Show One Setting',  
            'function' =>  'doConfigGet',  
            'doc' =>  '<parameter> [layer]  
Displays the value of one configuration parameter.  The  
first argument is the name of the parameter, an optional second argument  
may be used to tell which configuration layer to look in.  Valid configuration  
layers are "user", "system" and "default".  If no layer is specified, a value  
will be picked from the first layer that defines the parameter, in the order  
            'summary' =>  'Change Setting',  
            'function' =>  'doConfigSet',  
            'doc' =>  '<parameter> <value> [layer]  
Sets the value of one configuration parameter.  The first argument is  
the name of the parameter, the second argument is the new value.  Some  
parameters are subject to validation, and the command will fail with  
an error message if the new value does not make sense.  An optional  
third argument may be used to specify in which layer to set the  
configuration parameter.  The default layer is "user".  
            'summary' =>  'Show Information About Setting',  
            'function' =>  'doConfigHelp',  
Displays help for a configuration parameter.  Without arguments it  
displays help for all configuration parameters.  
     * PEAR_Command_Config constructor.  
    function PEAR_Command_Config (&$ui, &$config)  
        parent ::PEAR_Command_Common ($ui, $config);  
    function doConfigShow ($command, $options, $params)  
        // $params[0] -> the layer  
        if ($error =  $this->_checkLayer (@$params[0 ])) {  
            return $this->raiseError ($error);   
        $keys =  $this->config->getKeys ();   
        $data = array ('caption' =>  'Configuration:');   
        foreach ($keys as  $key) {  
            $type =  $this->config->getType ($key);   
            $value =  $this->config->get ($key, @$params[0 ]);   
            if ($type ==  'password' &&  $value) {  
            } elseif  ($value === true ) {  
            $data['data'][$this->config->getGroup ($key)][] = array ($this->config->getPrompt ($key) , $key, $value);   
        $this->ui->outputData ($data, $command);   
    function doConfigGet ($command, $options, $params)  
        // $params[0] -> the parameter  
        // $params[1] -> the layer  
        if ($error =  $this->_checkLayer (@$params[1 ])) {  
            return $this->raiseError ($error);   
            return $this->raiseError ("config-get expects 1 or 2 parameters");   
        } elseif  (sizeof($params) == 1 ) {  
            $this->ui->outputData ($this->config->get ($params[0 ]), $command);   
            $data =  $this->config->get ($params[0 ], $params[1 ]);   
            $this->ui->outputData ($data, $command);   
    function doConfigSet ($command, $options, $params)  
        // $param[0] -> a parameter to set  
        // $param[1] -> the value for the parameter  
        // $param[2] -> the layer  
            $failmsg .=  "config-set expects 2 or 3 parameters";   
            return PEAR ::raiseError ($failmsg);   
        if ($error =  $this->_checkLayer (@$params[2 ])) {  
            return PEAR ::raiseError ($failmsg);   
            $failmsg =  "config-set (" .  implode(", ", $params) .  ") failed";   
            return $this->raiseError ($failmsg);   
    function doConfigHelp ($command, $options, $params)  
            $params =  $this->config->getKeys ();   
        $data['caption']  =  "Config help" .  ((count($params) == 1 ) ? "  for $params[0]" :  '');   
        $data['headline'] = array ('Name', 'Type', 'Description');   
        foreach ($params as  $name) {  
            $type =  $this->config->getType ($name);   
            $docs =  $this->config->getDocs ($name);   
                $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  
     * @param string $layer The layer to search for  
     * @return mixed False on no error or the error message  
    function _checkLayer ($layer = null )  
        if (!empty ($layer) &&  $layer !=  'default') {  
            $layers =  $this->config->getLayers ();   
                return " only the layers: \"" .  implode('" or "', $layers) .  "\" are supported";   
 
 
        
		    
 
		    Documentation generated on Mon, 11 Mar 2019 14:23:56 -0400 by  phpDocumentor 1.4.4. PEAR Logo Copyright ©  PHP Group 2004.
	        
       |