Class Conf

Description

Read and write global configuration settings

This class manages the global configuration settings, defined in the $P2G_USER_CFG array and processed by the framework's initialization script (via Init class).

Located in /core/Conf.class.php (line 41)


	
			
Variable Summary
array $config
Method Summary
static array|FALSE getConnectionParameters ([string $connectionId = NULL])
static Conf &getInstance ()
Conf Conf ()
array &getAll ()
mixed getConfig (string $configName, [mixed $fallback = FALSE])
void loadConfig (string $configModule)
void setConfig (string|array $configName, [mixed $configValue = ''])
Variables
array $config (line 49)

Configuration settings

  • access: private
Methods
static method getConnectionParameters (line 86)

Get database connection settings for a given connetion ID

If the $connectionId argument is missing, the method will try to use the DATABASE.DEFAULT_CONNECTION setting or the first key of the DATABASE.CONNECTIONS array.

  • return: Connection properties or FALSE in case of error
static array|FALSE getConnectionParameters ([string $connectionId = NULL])
  • string $connectionId: Connection ID
static method getInstance (line 68)

Get the singleton of the Conf class

static Conf &getInstance ()
Constructor Conf (line 59)

Class constructor

Shouldn't be called directly. Always use getInstance when you need to read, add or modify configuration settings.

Conf Conf ()
getAll (line 185)

Get all configuration settings

array &getAll ()
getConfig (line 176)

Get a configuration setting

mixed getConfig (string $configName, [mixed $fallback = FALSE])
  • string $configName: Config key
  • mixed $fallback: Return value to be used when the key is not found
loadConfig (line 141)

Load a new set of configuration entries from a given file

This method is used by Init class to initialize global configuration settings.

void loadConfig (string $configModule)
  • string $configModule: Configuration file path
setConfig (line 158)

Create or replace a single configuration entry or a set of entries

  1.  $Conf =Conf::getInstance();
  2.  $Conf->setConfig('LOCALE''en-us');
  3.  $Conf->setConfig(array('KEY'=>'value''ANOTHER_KEY'=>'another_value'));

  • todo: Allow setting array members by using a dot path
void setConfig (string|array $configName, [mixed $configValue = ''])
  • string|array $configName: Config key or a key=>value hashmap
  • mixed $configValue: Value

Documentation generated on Sun, 07 Oct 2007 19:21:50 -0300 by phpDocumentor 1.3.2