Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

ConfigCache Class Reference

Inheritance diagram for ConfigCache:

Inheritance graph
[legend]
Collaboration diagram for ConfigCache:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ConfigCache ()
GetInstance ()
 _UpdateSession ()
_ConfigBackendFactory ($petition)
 _GetBackendMethod ($petition)
 GetPetition ($petition)
 _GetPetitionModule ($petition)
 _GetPetitionGroup ($petition, &$cache)
 _GetPetitionUser ($petition, &$cache)
 SetPetition ($petition, $values)

Public Attributes

 $system
 The system configuration.

 $systemgroup
 The system configuration for the groups.

 $module
 The module configuration.

 $modulegroup
 The module configuration for the groups.


Detailed Description

Class that implements a cache between the backend configuration classes and the client classes in order to make the access more efficient.

The data struct where the information is going to be stored is as follows:

Currently, the cache is implemented as a non-write-allocate cache, but it's easy to change it or to make it user choosable.

Definition at line 41 of file ConfigCache.class.php.


Constructor & Destructor Documentation

ConfigCache::ConfigCache  ) 
 

Constructs an object of this class with the default values for all attributes.

This constructor should not be used directly. To get an instance of this class use the static method GetInstance, instead.

Definition at line 56 of file ConfigCache.class.php.

Referenced by GetInstance().


Member Function Documentation

& ConfigCache::_ConfigBackendFactory petition  ) 
 

Creates the proper ConfigBackend object according to the petition and the established storage method.

See the storage-method.inc file for a better knowledge of how it works.

Parameters:
petition A ConfigPetition
Returns:
IConfigBackend

Definition at line 120 of file ConfigCache.class.php.

ConfigCache::_GetBackendMethod petition  ) 
 

Returns the storage method established for this petition.

See the storage-method.inc file for a better knowledge of how it works.

Parameters:
petition A ConfigPetition
Returns:
string with the storage method.

Definition at line 149 of file ConfigCache.class.php.

ConfigCache::_GetPetitionGroup petition,
&$  cache
 

Returns the petition. If it is in the cache, it just gets it. Otherwise, it access to a permanent storage via a ConfigBackend and returns the petition (storing the data in cache too).

Parameters:
petition A ConfigPetition
cache An array with the piece of cache where we have to access.
Returns:
Array of keys, values pairs

Definition at line 244 of file ConfigCache.class.php.

ConfigCache::_GetPetitionModule petition  ) 
 

Returns the petition. If it is in the cache, it just gets it. Otherwise, it access to a permanent storage via a ConfigBackend and returns the petition (storing the data in cache too).

Parameters:
petition A ConfigPetition
Returns:
Array of keys, values pairs.

Definition at line 208 of file ConfigCache.class.php.

ConfigCache::_GetPetitionUser petition,
&$  cache
 

Returns the petition. If it is in the cache, it just gets it. Otherwise, it access to a permanent storage via a ConfigBackend and returns the petition (storing the data in cache too).

Parameters:
petition A ConfigPetition
cache An array with the piece of cache where we have to access.
Returns:
Array of keys, values pairs

Definition at line 265 of file ConfigCache.class.php.

ConfigCache::_UpdateSession  ) 
 

Re-stores the object in the session.

Definition at line 105 of file ConfigCache.class.php.

References JSession::SetVar().

Referenced by GetInstance().

& ConfigCache::GetInstance  ) 
 

Static method that returns the ConfigCache object stored in session.

If there isn't any, it will construct a new one.

This method makes use of the PHP register_shutdown_function that is used to store the changes made in the object into the session when its execution finishes.

Returns:
ConfigCache

Definition at line 76 of file ConfigCache.class.php.

References _UpdateSession(), ConfigCache(), JSession::ExistsVar(), and JSession::GetVar().

Referenced by ModuleInstall::_ConfigSetDefault(), JConfig::_UpdateData(), and JConfig::SetValue().

ConfigCache::GetPetition petition  ) 
 

Returns the petition. If it is in the cache, it just gets it. Otherwise, it access to a permanent storage via a ConfigBackend and returns the petition (storing the data in cache too).

Parameters:
petition A ConfigPetition
Returns:
Array of keys, values pairs.

Definition at line 174 of file ConfigCache.class.php.

ConfigCache::SetPetition petition,
values
 

Saves an array of changes into the permanent store.

Parameters:
petition A ConfigPetition
values Array of (keys, values) pairs.

Definition at line 297 of file ConfigCache.class.php.


Member Data Documentation

ConfigCache::$module
 

The module configuration.

Definition at line 46 of file ConfigCache.class.php.

ConfigCache::$modulegroup
 

The module configuration for the groups.

Definition at line 47 of file ConfigCache.class.php.

ConfigCache::$system
 

The system configuration.

Definition at line 43 of file ConfigCache.class.php.

ConfigCache::$systemgroup
 

The system configuration for the groups.

Definition at line 44 of file ConfigCache.class.php.


The documentation for this class was generated from the following file:
Generated on Wed Nov 19 20:29:35 2003 for James by doxygen 1.3.4