eZPublishCommunityProject  2013.5
eZ\Publish\Core\Base\ConfigurationManager Class Reference

Configuration manager class. More...

Public Member Functions

 __construct (array $globalConfiguration, array $globalPaths=array( 'base'=> array( 'settings/'), 'modules'=> array( 'eZ/Publish/Core/settings/'), 'access'=> array(), 'global'=> array( 'settings/override/'),))
 Create a instance of Configuration Manager. More...
 
 getConfiguration ($moduleName= 'base')
 Get configuration instance and load it automatically. More...
 
 getGlobalConfiguration ()
 Get global configuration data. More...
 
 getGlobalDirs ($scope=null)
 Get raw global override path list data. More...
 
 reset ($moduleName=null)
 Reset instance list, in most cases it should be enough to call reloadAll. More...
 
 setGlobalDirs (array $paths, $scope=null)
 Set raw global override path list data. More...
 

Protected Attributes

 $globalConfiguration = array()
 
 $globalPaths
 
 $instances = array()
 

Detailed Description

Configuration manager class.

Setup:

// Setup global configuration that needs to be defined before loading setting files
$manager = new ConfigurationManager( include 'config.php' );

Usage:

// Default value on $module is 'base', so this will parse base.ini[.append.php] files given setup above
$bool = $manager->getConfiguration( 'base' )->get( 'ClassLoader', 'Repositories' );

Usage2:

$array = $manager->getConfiguration( 'content' )->get( 'Fields', 'Type' );

When generating cache files.

Constructor & Destructor Documentation

eZ\Publish\Core\Base\ConfigurationManager::__construct ( array  $globalConfiguration,
array  $globalPaths = array(            'base' => array( 'settings/' ),            'modules' => array( 'eZ/Publish/Core/settings/' ),            'access' => array(),            'global' => array( 'settings/override/' ),        ) 
)

Create a instance of Configuration Manager.

Parameters
array$globalConfiguration

Member Function Documentation

eZ\Publish\Core\Base\ConfigurationManager::getConfiguration (   $moduleName = 'base')

Get configuration instance and load it automatically.

load() Used the first time an instance is created

Parameters
string$moduleNameThe name of the module (w/o .ini suffix as we would want to support other formats in the future)
Returns
eZ\Publish\Core\Base\ConfigurationManager::getGlobalConfiguration ( )

Get global configuration data.

Returns
array
eZ\Publish\Core\Base\ConfigurationManager::getGlobalDirs (   $scope = null)

Get raw global override path list data.

Exceptions
InvalidArgumentValueIf scope has wrong value
Parameters
string$scopeSee $globalPaths for scope values (first level keys)
Returns
array
eZ\Publish\Core\Base\ConfigurationManager::reset (   $moduleName = null)

Reset instance list, in most cases it should be enough to call reloadAll.

Parameters
string | null$moduleNameOptionally Reset a specific instance if string

Referenced by eZ\Publish\Core\Base\ConfigurationManager\setGlobalDirs().

eZ\Publish\Core\Base\ConfigurationManager::setGlobalDirs ( array  $paths,
  $scope = null 
)

Set raw global override path list data.

Note: Full reset of Configuration instances are done when this function is called.

Exceptions
InvalidArgumentValueIf scope has wrong value
Parameters
array$paths
string$scopeSee $globalPaths for scope values (first level keys)
Returns
boolean Return true if paths actually changed, and thus instances where reset.

Member Data Documentation

eZ\Publish\Core\Base\ConfigurationManager::$globalConfiguration = array()
protected
eZ\Publish\Core\Base\ConfigurationManager::$globalPaths
protected
eZ\Publish\Core\Base\ConfigurationManager::$instances = array()
protected

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