spunQ_Configuration Class Reference

Configuration for the spunQ framework. More...

Inheritance diagram for spunQ_Configuration:

spunQ_IConfiguration

List of all members.

Public Member Functions

 __construct ()
 Constructor.
 addConfigurationFile (spunQ_IConfiguration $file)
 Adds a configuration file.
 addConfigurationFiles (array $files)
 Adds multiple configuration files.
 getKeysStartingWith ($prefix)
 Returns configuration keys that start with given string.
 getStringsForPrefix ($prefix)
 Returns multiple strings, for which the key starts with given string.
 getStringValue ($key, $default=NULL)
 Returns the configuration value for a key.
 getMultipleStringValues ($prefix)
 Returns all key-value pairs where the key starts with given string.
 getBooleanValue ($key, $default=false)
 Returns the value of a boolean configuration key.
 getMultipleBooleanValues ($key)
 Multiple value version of getBooleanValue().
 getFileValue ($key, $default=NULL)
 Gets a spunQ_File.
 getMultipleFileValues ($prefix)
 Multiple value version of getFileValue().
 getFolderValue ($key, $default=NULL)
 Gets a spunQ_Folder.
 getMultipleFolderValues ($prefix)
 Multiple value version of getFolderValue().
 getSourceFolders ()
 Returns the folder containing all source code.
 getTypeParser ()
 Returns the TypeParser to use for parsing source files.
 getJsMinifier ()
 getCssMinifier ()
 getLastModificationTime ()
 Returns the timestamp the configuration has been modified.

Private Attributes

 $sourceFolders = NULL
 The folders containing source code.
 $typeParser
 The TypeParser to use for parsing source files.
 $languageFile = NULL
 The path to a language file.
 $configurations = array()
 The actual configuration objects.


Detailed Description

Configuration for the spunQ framework.

This is the main configuration of the spunQ framework. It will provide values defined by other spunQ_IConfiguration objects. addConfigurationFile() can be called multiple times to add various config files. Configuration files that are added later will always override previous values (i.e. if file2 contains the same key as file1, the value of file2 will take precedence).

Definition at line 12 of file Configuration.class.php.


Member Function Documentation

spunQ_Configuration::addConfigurationFile ( spunQ_IConfiguration file  ) 

Adds a configuration file.

The values provided by the latest config will always override the previous ones.

Parameters:
$file The configuration file to add to the pool.
Returns:
spunQ_Configuration $this

Definition at line 53 of file Configuration.class.php.

spunQ_Configuration::addConfigurationFiles ( array $  files  ) 

Adds multiple configuration files.

Parameters:
$files The configuration files to add to the pool.
Returns:
spunQ_Configuration $this

Definition at line 63 of file Configuration.class.php.

spunQ_Configuration::getBooleanValue ( key,
default = false 
)

Returns the value of a boolean configuration key.

Parameters:
$key The key string to get configuration value for.
$default The value to return if the key is not defined.
Returns:
boolean

Implements spunQ_IConfiguration.

Definition at line 119 of file Configuration.class.php.

spunQ_Configuration::getCssMinifier (  ) 

Todo:
stub

belongs into spunQ_IConfiguration

Definition at line 230 of file Configuration.class.php.

spunQ_Configuration::getFileValue ( key,
default = NULL 
)

Gets a spunQ_File.

Parameters:
$key The key string to get configuration value for.
$default The value to return if the key is not defined.
Returns:
spunQ_File

Implements spunQ_IConfiguration.

Definition at line 143 of file Configuration.class.php.

spunQ_Configuration::getFolderValue ( key,
default = NULL 
)

Gets a spunQ_Folder.

Parameters:
$key The key string to get configuration value for.
$default The value to return if the key is not defined.
Returns:
spunQ_Folder

Implements spunQ_IConfiguration.

Definition at line 167 of file Configuration.class.php.

spunQ_Configuration::getJsMinifier (  ) 

Todo:
stub

belongs into spunQ_IConfiguration

Definition at line 222 of file Configuration.class.php.

spunQ_Configuration::getKeysStartingWith ( prefix  ) 

Returns configuration keys that start with given string.

Parameters:
$prefix The string that a key must begin with to be returned.
Returns:
array<string> Array of configuration keys.

Implements spunQ_IConfiguration.

Definition at line 71 of file Configuration.class.php.

spunQ_Configuration::getLastModificationTime (  ) 

Returns the timestamp the configuration has been modified.

Returns:
integer A unix timestamp

Implements spunQ_IConfiguration.

Definition at line 237 of file Configuration.class.php.

spunQ_Configuration::getMultipleBooleanValues ( key  ) 

Multiple value version of getBooleanValue().

Parameters:
$key The key string to get configuration value for.
Returns:
array<bool>

Implements spunQ_IConfiguration.

Definition at line 132 of file Configuration.class.php.

spunQ_Configuration::getMultipleFileValues ( key  ) 

Multiple value version of getFileValue().

Parameters:
$key The key string to get configuration value for.
Returns:
array<bool>

Implements spunQ_IConfiguration.

Definition at line 156 of file Configuration.class.php.

spunQ_Configuration::getMultipleFolderValues ( key  ) 

Multiple value version of getFolderValue().

Parameters:
$key The key string to get configuration value for.
Returns:
array<bool>

Implements spunQ_IConfiguration.

Definition at line 180 of file Configuration.class.php.

spunQ_Configuration::getMultipleStringValues ( prefix  ) 

Returns all key-value pairs where the key starts with given string.

Parameters:
$prefix Prefix to get keys for
Returns:
array Mapping keys to values.

Implements spunQ_IConfiguration.

Definition at line 106 of file Configuration.class.php.

spunQ_Configuration::getSourceFolders (  ) 

Returns the folder containing all source code.

Returns:
string

Definition at line 192 of file Configuration.class.php.

spunQ_Configuration::getStringsForPrefix ( prefix  ) 

Returns multiple strings, for which the key starts with given string.

Parameters:
$prefix The string that a key must begin with to be returned.
Returns:
array<string> Associative array mapping keys to string values. The keys all have their prefix stripped.

Implements spunQ_IConfiguration.

Definition at line 82 of file Configuration.class.php.

spunQ_Configuration::getStringValue ( key,
default = NULL 
)

Returns the configuration value for a key.

Parameters:
$key The key string to get configuration value for.
$default The value to return if the key is not defined.
Returns:
string

Implements spunQ_IConfiguration.

Definition at line 93 of file Configuration.class.php.

spunQ_Configuration::getTypeParser (  ) 

Returns the TypeParser to use for parsing source files.

Returns:
spunQ_TypeParser

Definition at line 211 of file Configuration.class.php.


Member Data Documentation

spunQ_Configuration::$configurations = array() [private]

The actual configuration objects.

Type:
spunQ_IConfiguration

Definition at line 37 of file Configuration.class.php.

spunQ_Configuration::$languageFile = NULL [private]

The path to a language file.

Type:
string

Definition at line 31 of file Configuration.class.php.

spunQ_Configuration::$sourceFolders = NULL [private]

The folders containing source code.

Will be extracted from the modules configured.

Type:
array<spunQ.file.SourceFolder>

Definition at line 19 of file Configuration.class.php.

spunQ_Configuration::$typeParser [private]

The TypeParser to use for parsing source files.

Type:
spunQ.init.TypeParser

Definition at line 25 of file Configuration.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:39 2011 for spunQ3 by  doxygen 1.5.9