Class ConfigurationReader

Description

This class provides methods for reading Database driven Configurations.

It is designed to be used as static class, to avoid instantiation.
Use it as follows:

  1.  $bar ConfigurationReader::getConfigurationEntry('foo''bar');

  • version: $Id: ConfigurationReader.php,v 1.9 2006/11/26 22:04:21 kpapst Exp $
  • copyright: Copyright (C) 2002-2006 Kevin Papst
  • author: Kevin Papst
  • license: GNU Public License


			
Method Summary
array getAll ()
ConfigurationEntry getConfigurationEntry (String $package, String $name)
mixed getConfigurationValue (String $package, String $name, [mixed $undefined = null])
array getPackage (String $package)
Methods
getAll (line 51)

Gets all Configuration Values available.

Calls will never be cached.

  • return: all Configurations as ConfigurationEntry objects in an Array
array getAll ()
getConfigurationEntry (line 103)

Fetch a known ConfigurationEntry from a Configuration Package.

  • return: the ConfigurationEntry Object or null
ConfigurationEntry getConfigurationEntry (String $package, String $name)
  • String $package: the Package Name to fetch
  • String $name: Name of the Configuration Name to fetch
getConfigurationValue (line 131)

Returns the Value of a ConfigurationEntry, or

  1. $undefined
if the requested Configuration Entry could not be found.

No need of explicit casting for:

  • CONFIG_TYPE_BOOLEAN

  • return: the Value or NULL
mixed getConfigurationValue (String $package, String $name, [mixed $undefined = null])
  • String $package: package the Parameter Package
  • String $name: name the Parameter Name
  • mixed $undefined: undefined fallback value for not found Configuration Entry
getPackage (line 77)

All Value of the Package will be fetched and returned as an Array of

instances.

This method call caches its Results (if not NULL).
If a Package was read, Calls against the same package within the methods

and will fetch their results from this cached Package.
If you want to read more than ONE entry/value of a Package it is always recommended to call
  1. getPackage($package)
first to fill the cache and speed up the Calls (less DB calls).

  • return: an Array of ConfigurationEntry Objects with keys of Config Names
array getPackage (String $package)
  • String $package: the Package Name to fetch

Documentation generated by phpDocumentor 1.3.1