[ Index ] |
|
Code source de SPIP Agora 1.4 |
[Code source] [Imprimer] [Statistiques]
Last created PEAR_Config instance.
Poids: | 1169 lignes (35 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
PEAR_Config:: (28 méthodes):
PEAR_Config()
singleton()
readConfigFile()
mergeConfigFile()
writeConfigFile()
_readConfigDataFrom()
getConfFile()
_encodeOutput()
_decodeInput()
get()
set()
getType()
getDocs()
getPrompt()
getGroup()
getGroups()
getGroupKeys()
getSetValues()
getKeys()
remove()
removeLayer()
store()
toDefault()
definedBy()
isDefaulted()
isDefined()
isDefinedLayer()
getLayers()
Classe: PEAR_Config - X-Ref
This is a class for storing configuration data, keeping track ofPEAR_Config($user_file = '', $system_file = '') X-Ref |
Constructor. param: string (optional) file to read user-defined options from param: string (optional) file to read system-wide defaults from |
singleton($user_file = '', $system_file = '') X-Ref |
Static singleton method. If you want to keep only one instance of this class in use, this method will give you a reference to the last created PEAR_Config object if one exists, or create a new object. param: string (optional) file to read user-defined options from param: string (optional) file to read system-wide defaults from return: object an existing or new PEAR_Config instance |
readConfigFile($file = null, $layer = 'user') X-Ref |
Reads configuration data from a file. All existing values in the config layer are discarded and replaced with data from the file. param: string (optional) file to read from, if NULL or not param: string (optional) config layer to insert data into return: bool TRUE on success or a PEAR error on failure |
mergeConfigFile($file, $override = true, $layer = 'user') X-Ref |
Merges data into a config layer from a file. Does the same thing as readConfigFile, except it does not replace all existing values in the config layer. param: string file to read from param: bool (optional) whether to overwrite existing data param: string config layer to insert data into ('user' or return: bool TRUE on success or a PEAR error on failure |
writeConfigFile($file = null, $layer = 'user', $data = null) X-Ref |
Writes data into a config layer from a file. param: string file to read from param: bool (optional) whether to overwrite existing data param: string config layer to insert data into ('user' or return: bool TRUE on success or a PEAR error on failure |
_readConfigDataFrom($file) X-Ref |
Reads configuration data from a file and returns the parsed data in an array. param: string file to read from return: array configuration data or a PEAR error on failure |
getConfFile($layer) X-Ref |
Gets the file used for storing the config for a layer param: string $layer 'user' or 'system' |
_encodeOutput(&$data) X-Ref |
Encodes/scrambles configuration data before writing to files. Currently, 'password' values will be base64-encoded as to avoid that people spot cleartext passwords by accident. param: array (reference) array to encode values in return: bool TRUE on success |
_decodeInput(&$data) X-Ref |
Decodes/unscrambles configuration data after reading from files. param: array (reference) array to encode values in return: bool TRUE on success |
get($key, $layer = null) X-Ref |
Returns a configuration value, prioritizing layers as per the layers property. param: string config key return: mixed the config value, or NULL if not found |
set($key, $value, $layer = 'user') X-Ref |
Set a config value in a specific layer (defaults to 'user'). Enforces the types defined in the configuration_info array. An integer config variable will be cast to int, and a set config variable will be validated against its legal values. param: string config key param: string config value param: string (optional) config layer return: bool TRUE on success, FALSE on failure |
getType($key) X-Ref |
Get the type of a config value. param: string config key return: string type, one of "string", "integer", "file", |
getDocs($key) X-Ref |
Get the documentation for a config value. param: string config key return: string documentation string |
getPrompt($key) X-Ref |
Get the short documentation for a config value. param: string config key return: string short documentation string |
getGroup($key) X-Ref |
Get the parameter group for a config key. param: string config key return: string parameter group |
getGroups() X-Ref |
Get the list of parameter groups. return: array list of parameter groups |
getGroupKeys($group) X-Ref |
Get the list of the parameters in a group. param: string $group parameter group return: array list of parameters in $group |
getSetValues($key) X-Ref |
Get the list of allowed set values for a config value. Returns NULL for config values that are not sets. param: string config key return: array enumerated array of set values, or NULL if the |
getKeys() X-Ref |
Get all the current config keys. return: array simple array of config keys |
remove($key, $layer = 'user') X-Ref |
Remove the a config key from a specific config layer. param: string config key param: string (optional) config layer return: bool TRUE on success, FALSE on failure |
removeLayer($layer) X-Ref |
Temporarily remove an entire config layer. USE WITH CARE! param: string config key param: string (optional) config layer return: bool TRUE on success, FALSE on failure |
store($layer = 'user', $data = null) X-Ref |
Stores configuration data in a layer. param: string config layer to store return: bool TRUE on success, or PEAR error on failure |
toDefault($key) X-Ref |
Unset the user-defined value of a config key, reverting the value to the system-defined one. param: string config key return: bool TRUE on success, FALSE on failure |
definedBy($key) X-Ref |
Tells what config layer that gets to define a key. param: string config key return: string the config layer, or an empty string if not found |
isDefaulted($key) X-Ref |
Tells whether a config value has a system-defined value. param: string config key return: bool |
isDefined($key) X-Ref |
Tells whether a given key exists as a config value. param: string config key return: bool whether <config key> exists in this object |
isDefinedLayer($layer) X-Ref |
Tells whether a given config layer exists. param: string config layer return: bool whether <config layer> exists in this object |
getLayers() X-Ref |
Returns the layers defined (except the 'default' one) return: array of the defined layers |
Généré le : Sat Feb 24 14:40:03 2007 | par Balluche grâce à PHPXref 0.7 |