PHP 클래스 Horde_Config, horde

Copyright 2002-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
저자: Chuck Hagenbuch ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_app string The name of the configured application.
$_configBegin string The line marking the begin of the generated configuration.
$_configEnd string The line marking the end of the generated configuration.
$_currentConfig array The current $conf array of the configured application.
$_oldConfig string The content of the old configuration file.
$_phpConfig string The content of the generated configuration file.
$_postConfig string The manual configuration after the generated configuration.
$_preConfig string The manual configuration in front of the generated configuration.
$_versionTag string The version tag of the conf.xml file which will be copied into the conf.php file.
$_versionUrl string Horde URL to check version information.
$_xmlConfigTree array The XML tree of the configuration file traversed to an associative array.

공개 메소드들

메소드 설명
__construct ( string $app = 'horde' ) Constructor.
checkVersions ( ) : array Contact Horde servers and get version information.
configFile ( )
configNoSQL ( string $ctx, DomNode $node = null, string $switchname = 'driverconfig' ) : array Returns the configuration tree for a NoSQL backend configuration to replace a tag.
configSQL ( string $ctx, DomNode $node = null, string $switchname = 'driverconfig' ) : array Returns the configuration tree for an SQL backend configuration to replace a tag.
generatePHPConfig ( Horde_Variables $formvars, array $custom_conf = null ) : string Generates the content of the application's configuration file.
getPHPConfig ( ) : string Returns the file content of the current configuration file.
getVersion ( string $text ) : string Get the Horde version string for a config file.
readXMLConfig ( array $custom_conf = null ) : array Reads the application's conf.xml file and builds an associative array from its XML tree.
writePHPConfig ( Horde_Variables $formvars, string &$php = null ) : boolean Generates and writes the content of the application's configuration file.

보호된 메소드들

메소드 설명
__default ( string $ctx, mixed $default ) : array Returns a certain value from the current configuration array or a default value, if not found, and which of the values have been returned.
__defaultRaw ( string $ctx, mixed $default ) : array Returns a certain value from the current configuration file or a default value, if not found, and which of the values have been returned.
_configLDAP ( string $ctx, DomNode $node = null, string $switchname = 'driverconfig' ) : array Returns the configuration tree for an LDAP backend configuration to replace a tag.
_configLDAPUser ( string $ctx, DomNode $node = null ) : array Returns the configuration tree for an LDAP configuration to search user DNs to replace a tag.
_configSQLSplitRead ( string $ctx, DomNode $node, string $phptype ) : array Returns the configuration items for split-read database setups.
_configVFS ( string $ctx, DomNode $node ) : array Returns the configuration tree for a VFS backend configuration to replace a tag.
_default ( string $ctx, mixed $default ) : mixed Returns a certain value from the current configuration array or a default value, if not found.
_defaultRaw ( string $ctx, mixed $default ) : mixed Returns a certain value from the current configuration file or a default value, if not found.
_generatePHPConfig ( array $section, string $prefix, Horde_Variables $formvars ) Generates the configuration file items for a part of the configuration tree.
_getEnumValues ( DomNode $node ) : array Returns an associative array containing all possible values of the specified tag.
_getNodeOnlyText ( DomNode $node ) : string Returns the content of all text node children of the specified node.
_getSwitchValues ( &$node, $curctx ) : array Returns a multidimensional associative array representing the specified tag.
_handleSpecials ( DomNode $node ) : array Returns an associative array containing the possible values of a tag as used inside of enum configurations.
_isDefault ( string $ctx, mixed $default ) : boolean Returns whether a certain value from the current configuration array exists or a default value will be used.
_isDefaultRaw ( string $ctx, mixed $default ) : boolean Returns whether a certain value from the current configuration array exists or a default value will be used.
_parseLevel ( &$conf, DOMNodeList $children, string $ctx ) Parses one level of the configuration XML tree into the associative array containing the traversed configuration tree.
_quote ( string $string ) : string Returns the specified string with escaped single quotes

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $app = 'horde' )
$app string The name of the application to be configured.

__default() 보호된 메소드

Returns a certain value from the current configuration array or a default value, if not found, and which of the values have been returned.
protected __default ( string $ctx, mixed $default ) : array
$ctx string A string representing the key of the configuration array to return.
$default mixed The default value to return if the key wasn't found.
리턴 array First element: either the value of the configuration array's requested key or the default value if the key wasn't found. Second element: whether the returned value was the default value.

__defaultRaw() 보호된 메소드

It does NOT return the actual value, but the PHP expression as used in the configuration file.
protected __defaultRaw ( string $ctx, mixed $default ) : array
$ctx string A string representing the key of the configuration array to return.
$default mixed The default value to return if the key wasn't found.
리턴 array First element: either the value of the configuration array's requested key or the default value if the key wasn't found. Second element: whether the returned value was the default value.

_configLDAP() 보호된 메소드

Subnodes will be parsed and added to both the Horde defaults and the Custom configuration parts.
protected _configLDAP ( string $ctx, DomNode $node = null, string $switchname = 'driverconfig' ) : array
$ctx string The context of the tag.
$node DomNode The DomNode representation of the tag.
$switchname string If $node is not set, the value of the tag's switchname attribute.
리턴 array An associative array with the LDAP configuration tree.

_configLDAPUser() 보호된 메소드

Subnodes will be parsed and added.
protected _configLDAPUser ( string $ctx, DomNode $node = null ) : array
$ctx string The context of the tag.
$node DomNode The DomNode representation of the tag.
리턴 array A list of associative arrays with the LDAP configuration tree.

_configSQLSplitRead() 보호된 메소드

Returns the configuration items for split-read database setups.
protected _configSQLSplitRead ( string $ctx, DomNode $node, string $phptype ) : array
$ctx string The context of the tag.
$node DomNode The DomNode representation of the tag.
$phptype string The SQL backend name.
리턴 array An associative array with the split-read SQL configuration tree.

_configVFS() 보호된 메소드

Subnodes will be parsed and added to both the Horde defaults and the Custom configuration parts.
protected _configVFS ( string $ctx, DomNode $node ) : array
$ctx string The context of the tag.
$node DomNode The DomNode representation of the tag.
리턴 array An associative array with the VFS configuration tree.

_default() 보호된 메소드

Returns a certain value from the current configuration array or a default value, if not found.
protected _default ( string $ctx, mixed $default ) : mixed
$ctx string A string representing the key of the configuration array to return.
$default mixed The default value to return if the key wasn't found.
리턴 mixed Either the value of the configuration array's requested key or the default value if the key wasn't found.

_defaultRaw() 보호된 메소드

It does NOT return the actual value, but the PHP expression as used in the configuration file.
protected _defaultRaw ( string $ctx, mixed $default ) : mixed
$ctx string A string representing the key of the configuration array to return.
$default mixed The default value to return if the key wasn't found.
리턴 mixed Either the value of the configuration file's requested key or the default value if the key wasn't found.

_generatePHPConfig() 보호된 메소드

Generates the configuration file items for a part of the configuration tree.
protected _generatePHPConfig ( array $section, string $prefix, Horde_Variables $formvars )
$section array An associative array containing the part of the traversed XML configuration tree that should be processed.
$prefix string A configuration prefix determining the current position inside the configuration file. This prefix will be translated to keys of the $conf array in the generated configuration file.
$formvars Horde_Variables The processed configuration form data.

_getEnumValues() 보호된 메소드

The keys contain the actual enum values while the values contain their corresponding descriptions.
protected _getEnumValues ( DomNode $node ) : array
$node DomNode The DomNode representation of the tag whose values should be returned.
리턴 array An associative array with all possible enum values.

_getNodeOnlyText() 보호된 메소드

Returns the content of all text node children of the specified node.
protected _getNodeOnlyText ( DomNode $node ) : string
$node DomNode A DomNode object whose text node children to return.
리턴 string The concatenated values of all text nodes.

_getSwitchValues() 보호된 메소드

Returns a multidimensional associative array representing the specified tag.
protected _getSwitchValues ( &$node, $curctx ) : array
리턴 array An associative array representing the node.

_handleSpecials() 보호된 메소드

Returns an associative array containing the possible values of a tag as used inside of enum configurations.
protected _handleSpecials ( DomNode $node ) : array
$node DomNode The DomNode representation of the tag.
리턴 array An associative array with the possible values.

_isDefault() 보호된 메소드

Returns whether a certain value from the current configuration array exists or a default value will be used.
protected _isDefault ( string $ctx, mixed $default ) : boolean
$ctx string A string representing the key of the configuration array to return.
$default mixed The default value to return if the key wasn't found.
리턴 boolean Whether the default value will be used.

_isDefaultRaw() 보호된 메소드

Returns whether a certain value from the current configuration array exists or a default value will be used.
protected _isDefaultRaw ( string $ctx, mixed $default ) : boolean
$ctx string A string representing the key of the configuration array to return.
$default mixed The default value to return if the key wasn't found.
리턴 boolean Whether the default value will be used.

_parseLevel() 보호된 메소드

Parses one level of the configuration XML tree into the associative array containing the traversed configuration tree.
protected _parseLevel ( &$conf, DOMNodeList $children, string $ctx )
$children DOMNodeList The XML nodes of the level that should be parsed.
$ctx string A string representing the current position (context prefix) inside the configuration XML file.

_quote() 보호된 메소드

Returns the specified string with escaped single quotes
protected _quote ( string $string ) : string
$string string A string to escape.
리턴 string The specified string with single quotes being escaped.

checkVersions() 공개 메소드

Contact Horde servers and get version information.
public checkVersions ( ) : array
리턴 array Keys are app names, values are arrays with two keys: 'version' and 'url'.

configFile() 공개 메소드

public configFile ( )

configNoSQL() 공개 메소드

Subnodes will be parsed and added to both the Horde defaults and the custom configuration parts.
public configNoSQL ( string $ctx, DomNode $node = null, string $switchname = 'driverconfig' ) : array
$ctx string The context of the tag.
$node DomNode The DomNode representation of the tag.
$switchname string If DomNode is not set, the value of the tag's switchname attribute.
리턴 array An associative array with the SQL configuration tree.

configSQL() 공개 메소드

Subnodes will be parsed and added to both the Horde defaults and the Custom configuration parts.
public configSQL ( string $ctx, DomNode $node = null, string $switchname = 'driverconfig' ) : array
$ctx string The context of the tag.
$node DomNode The DomNode representation of the tag.
$switchname string If DomNode is not set, the value of the tag's switchname attribute.
리턴 array An associative array with the SQL configuration tree.

generatePHPConfig() 공개 메소드

Generates the content of the application's configuration file.
public generatePHPConfig ( Horde_Variables $formvars, array $custom_conf = null ) : string
$formvars Horde_Variables The processed configuration form data.
$custom_conf array Any settings that shall be included in the generated configuration.
리턴 string The content of the generated configuration file.

getPHPConfig() 공개 메소드

Returns the file content of the current configuration file.
public getPHPConfig ( ) : string
리턴 string The unparsed configuration file content.

getVersion() 공개 메소드

Get the Horde version string for a config file.
public getVersion ( string $text ) : string
$text string The text to parse.
리턴 string The version string or false if not found.

readXMLConfig() 공개 메소드

Reads the application's conf.xml file and builds an associative array from its XML tree.
public readXMLConfig ( array $custom_conf = null ) : array
$custom_conf array Any settings that shall be included in the generated configuration.
리턴 array An associative array representing the configuration tree.

writePHPConfig() 공개 메소드

Generates and writes the content of the application's configuration file.
public writePHPConfig ( Horde_Variables $formvars, string &$php = null ) : boolean
$formvars Horde_Variables The processed configuration form data.
$php string The content of the generated configuration file.
리턴 boolean True if the configuration file could be written immediately to the file system.

프로퍼티 상세

$_app 보호되어 있는 프로퍼티

The name of the configured application.
protected string $_app
리턴 string

$_configBegin 보호되어 있는 프로퍼티

The line marking the begin of the generated configuration.
protected string $_configBegin
리턴 string

$_configEnd 보호되어 있는 프로퍼티

The line marking the end of the generated configuration.
protected string $_configEnd
리턴 string

$_currentConfig 보호되어 있는 프로퍼티

The current $conf array of the configured application.
protected array $_currentConfig
리턴 array

$_oldConfig 보호되어 있는 프로퍼티

The content of the old configuration file.
protected string $_oldConfig
리턴 string

$_phpConfig 보호되어 있는 프로퍼티

The content of the generated configuration file.
protected string $_phpConfig
리턴 string

$_postConfig 보호되어 있는 프로퍼티

The manual configuration after the generated configuration.
protected string $_postConfig
리턴 string

$_preConfig 보호되어 있는 프로퍼티

The manual configuration in front of the generated configuration.
protected string $_preConfig
리턴 string

$_versionTag 보호되어 있는 프로퍼티

The version tag of the conf.xml file which will be copied into the conf.php file.
protected string $_versionTag
리턴 string

$_versionUrl 보호되어 있는 프로퍼티

Horde URL to check version information.
protected string $_versionUrl
리턴 string

$_xmlConfigTree 보호되어 있는 프로퍼티

The XML tree of the configuration file traversed to an associative array.
protected array $_xmlConfigTree
리턴 array