Table of Contents

setConfiguration

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JApplication Method setConfiguration Reference setConfiguration() Never Work in Progress

Sets up the configuration registry. This method will include the specified file, which should specify a class definition for the JConfig class with the appropriate default values for the system configuration parameters. A registry will then be created and the configuration values will be loaded into the registry.

Syntax

void setConfiguration ( $file, $type )

$file string is a string containing the path to the configuration file
$type string is a string containing the type of the configuration file. This parameter is optional and if omitted, defaults to ‘config’.

Examples

The Joomla! core calls this method as follows:

Example

$mainframe->setConfiguration(JPATH_CONFIGURATION . DS . 'configuration.php');

JPATH_CONFIGURATION contains the path to the directory that contains the configuration file. Once the configuration registry has been created, the configuration values can then be retrieved using the JApplication::getCfg method.