PHP Class Prado\TApplicationConfiguration

This class is used internally by TApplication to parse and represent application configuration.
Since: 3.0
Author: Qiang Xue ([email protected])
Author: Carl G. Mathisen ([email protected])
Inheritance: extends TComponent
Show file Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
getAliases ( ) : array Returns list of path alias definitions.
getExternalConfigurations ( ) : array
getIsEmpty ( ) : boolean
getModules ( ) : array Returns list of module configurations.
getParameters ( ) : array Returns list of parameter definitions.
getProperties ( ) : array Returns list of page initial property values.
getServices ( ) : array
getUsings ( ) : array Returns list of namespaces to be used.
loadFromFile ( $fname ) Parses the application configuration file.
loadFromPhp ( $config, $configPath ) Parses the application configuration given in terms of a PHP array.
loadFromXml ( $dom, $configPath ) Parses the application configuration given in terms of a TXmlElement.

Protected Methods

Method Description
loadExternalPhp ( $includeNode, $configPath ) Loads the external PHP array.
loadExternalXml ( $includeNode, $configPath ) Loads the external XML configurations.
loadModulesPhp ( $modulesNode, $configPath ) Loads the modules PHP array.
loadModulesXml ( $modulesNode, $configPath ) Loads the modules XML node.
loadParametersPhp ( $parametersNode, $configPath ) Loads the parameters PHP array.
loadParametersXml ( $parametersNode, $configPath ) Loads the parameters XML node.
loadPathsPhp ( $pathsNode, $configPath ) Loads the paths PHP array
loadPathsXml ( $pathsNode, $configPath ) Loads the paths XML node.
loadServicesPhp ( $servicesNode, $configPath ) Loads the services PHP array.
loadServicesXml ( $servicesNode, $configPath ) Loads the services XML node.

Method Details

getAliases() public method

The definitions are aggregated (top-down) from configuration files along the path to the specified page. Each array element represents a single alias definition, with the key being the alias name and the value the absolute path.
public getAliases ( ) : array
return array list of path alias definitions

getExternalConfigurations() public method

public getExternalConfigurations ( ) : array
return array list of external configuration files. Each element is like $filePath=>$condition

getIsEmpty() public method

public getIsEmpty ( ) : boolean
return boolean whether this configuration contains actual stuff

getModules() public method

The module configurations are aggregated (top-down) from configuration files along the path to the specified page. Each array element represents a single module configuration, with the key being the module ID and the value the module configuration. Each module configuration is stored in terms of an array with the following content ([0]=>module type, [1]=>module properties, [2]=>complete module configuration) The module properties are an array of property values indexed by property names. The complete module configuration is a TXmlElement object representing the raw module configuration which may contain contents enclosed within module tags.
public getModules ( ) : array
return array list of module configurations to be used

getParameters() public method

The parameter definitions are aggregated (top-down) from configuration files along the path to the specified page. Each array element represents a single parameter definition, with the key being the parameter ID and the value the parameter definition. A parameter definition can be either a string representing a string-typed parameter, or an array. The latter defines a component-typed parameter whose format is as follows, ([0]=>component type, [1]=>component properties) The component properties are an array of property values indexed by property names.
public getParameters ( ) : array
return array list of parameter definitions to be used

getProperties() public method

Each array element represents a single property with the key being the property name and the value the initial property value.
public getProperties ( ) : array
return array list of page initial property values

getServices() public method

public getServices ( ) : array
return array list of service configurations

getUsings() public method

The namespaces are aggregated (top-down) from configuration files along the path to the specified page. Each array element represents a single namespace usage, with the value being the namespace to be used.
public getUsings ( ) : array
return array list of namespaces to be used

loadExternalPhp() protected method

Loads the external PHP array.
protected loadExternalPhp ( $includeNode, $configPath )

loadExternalXml() protected method

Loads the external XML configurations.
protected loadExternalXml ( $includeNode, $configPath )

loadFromFile() public method

Parses the application configuration file.
public loadFromFile ( $fname )

loadFromPhp() public method

Parses the application configuration given in terms of a PHP array.
public loadFromPhp ( $config, $configPath )

loadFromXml() public method

Parses the application configuration given in terms of a TXmlElement.
public loadFromXml ( $dom, $configPath )

loadModulesPhp() protected method

Loads the modules PHP array.
protected loadModulesPhp ( $modulesNode, $configPath )

loadModulesXml() protected method

Loads the modules XML node.
protected loadModulesXml ( $modulesNode, $configPath )

loadParametersPhp() protected method

Loads the parameters PHP array.
protected loadParametersPhp ( $parametersNode, $configPath )

loadParametersXml() protected method

Loads the parameters XML node.
protected loadParametersXml ( $parametersNode, $configPath )

loadPathsPhp() protected method

Loads the paths PHP array
protected loadPathsPhp ( $pathsNode, $configPath )

loadPathsXml() protected method

Loads the paths XML node.
protected loadPathsXml ( $pathsNode, $configPath )

loadServicesPhp() protected method

Loads the services PHP array.
protected loadServicesPhp ( $servicesNode, $configPath )

loadServicesXml() protected method

Loads the services XML node.
protected loadServicesXml ( $servicesNode, $configPath )