PHP Class Contao\Config

Custom settings above or below the ### INSTALL SCRIPT ### markers will be preserved.
ファイルを表示 Open project: contao/core-bundle Class Usage Examples

Protected Properties

Property Type Description
$Files Files Files object
$arrCache array Cache
$arrData array Data
$blnHasLcf boolean Local file existance
$blnIsModified boolean Modification indicator
$objInstance Config Object instance (Singleton)
$strBottom string Bottom content
$strTop string Top content

Public Methods

Method Description
__clone ( ) Prevent cloning of the object (Singleton)
__destruct ( ) Automatically save the local configuration
add ( string $strKey, mixed $varValue ) Add a configuration variable to the local configuration file
delete ( string $strKey ) Remove a configuration variable
get ( string $strKey ) : mixed | null Return a configuration value
getActiveModules ( ) : array Return all active modules as array
getInstance ( ) : static Return the current object instance (Singleton)
has ( string $strKey ) : boolean Check whether a configuration value exists
isComplete ( ) : boolean Return true if the installation is complete
persist ( string $strKey, mixed $varValue ) Permanently set a configuration value
preload ( ) Preload the default and local configuration
remove ( string $strKey ) Permanently remove a configuration value
save ( ) Save the local configuration file
set ( string $strKey, string $varValue ) Temporarily set a configuration value
update ( string $strKey, mixed $varValue ) Alias for Config::add()

Protected Methods

Method Description
__construct ( ) Prevent direct instantiation (Singleton)
escape ( mixed $varValue ) : mixed Escape a value depending on its type
initialize ( ) Load all configuration files
loadParameters ( ) Override the database and SMTP parameters
markModified ( ) Mark the object as modified

Method Details

__clone() final public method

Prevent cloning of the object (Singleton)
final public __clone ( )

__construct() protected method

Prevent direct instantiation (Singleton)
protected __construct ( )

__destruct() public method

Automatically save the local configuration
public __destruct ( )

add() public method

Add a configuration variable to the local configuration file
public add ( string $strKey, mixed $varValue )
$strKey string The full variable name
$varValue mixed The configuration value

delete() public method

Remove a configuration variable
public delete ( string $strKey )
$strKey string The full variable name

escape() protected method

Escape a value depending on its type
protected escape ( mixed $varValue ) : mixed
$varValue mixed The value
return mixed The escaped value

get() public static method

Return a configuration value
public static get ( string $strKey ) : mixed | null
$strKey string The short key
return mixed | null The configuration value

getActiveModules() public method

Return all active modules as array
Deprecation: Deprecated since Contao 4.0, to be removed in Contao 5.0. Use the container parameter "kernel.bundles" instead.
public getActiveModules ( ) : array
return array An array of active modules

getInstance() public static method

Return the current object instance (Singleton)
public static getInstance ( ) : static
return static The object instance

has() public static method

Check whether a configuration value exists
public static has ( string $strKey ) : boolean
$strKey string The short key
return boolean True if the configuration value exists

initialize() protected method

Load all configuration files
protected initialize ( )

isComplete() public static method

Return true if the installation is complete
public static isComplete ( ) : boolean
return boolean True if the installation is complete

loadParameters() protected static method

Override the database and SMTP parameters
protected static loadParameters ( )

markModified() protected method

Mark the object as modified
protected markModified ( )

persist() public static method

Permanently set a configuration value
public static persist ( string $strKey, mixed $varValue )
$strKey string The short key or full variable name
$varValue mixed The configuration value

preload() public static method

Preload the default and local configuration
public static preload ( )

remove() public static method

Permanently remove a configuration value
public static remove ( string $strKey )
$strKey string The short key or full variable name

save() public method

Save the local configuration file
public save ( )

set() public static method

Temporarily set a configuration value
public static set ( string $strKey, string $varValue )
$strKey string The short key
$varValue string The configuration value

update() public method

Alias for Config::add()
public update ( string $strKey, mixed $varValue )
$strKey string The full variable name
$varValue mixed The configuration value

Property Details

$Files protected_oe property

Files object
protected Files,contao $Files
return Files

$arrCache protected_oe property

Cache
protected array $arrCache
return array

$arrData protected_oe property

Data
protected array $arrData
return array

$blnHasLcf protected_oe static_oe property

Local file existance
protected static bool $blnHasLcf
return boolean

$blnIsModified protected_oe property

Modification indicator
protected bool $blnIsModified
return boolean

$objInstance protected_oe static_oe property

Object instance (Singleton)
protected static Config,contao $objInstance
return Config

$strBottom protected_oe property

Bottom content
protected string $strBottom
return string

$strTop protected_oe property

Top content
protected string $strTop
return string