Class Core_Config
Package: HostCMS\Core
Copyright:
© 2005-2021 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru
Author:
Hostmake LLC
Version:
6.x
Located at core/config.php
Methods summary
public static
object
|
#
instance( )
Register an existing instance as a singleton.
Register an existing instance as a singleton.
Returns
object
|
protected
string
|
#
_correctName( string $name )
Correct config name
Parameters
Returns
string
|
public
mixed
|
#
get( string $name, mixed $defaultValue = NULL )
Get config, e.g. 'Core_Myconfig' requires modules/core/config/myconfig.php
Get config, e.g. 'Core_Myconfig' requires modules/core/config/myconfig.php
Parameters
- $name
- $name, e.g. 'Core_Myconfig'
- $defaultValue
Returns
mixed Config or NULL
$aConfigValues = Core_Config::instance()->get('mymodule_config') + array('foo' => 'baz');
echo $aConfigValues['foo'];
|
public
Core_Config
|
#
set( string $name, array $value )
Set config value
Parameters
- $name
- Config name, e.g. 'Core_Myconfig' set modules/core/config/myconfig.php
- $value
- Config value, e.g. array('key' => 'value')
Returns
Core_Config Core_Config::instance()->set( 'mymodule_config', array( 'foo' => 'bar'));
|
public
Core_Config
|
#
replace( string $name, array $value )
Replace config without changing config file
Replace config without changing config file
Parameters
- $name
- Config name, e.g. 'Core_Myconfig' set modules/core/config/myconfig.php
- $value
- Config value, e.g. array('key' => 'value')
Returns
|
public
string
|
#
getPath( string $name )
Get config path
Parameters
Returns
string
|
protected
string
|
#
_toString( mixed $value, $level = 1 )
Convert value to string
Parameters
- $value
- Value
- $level
- of tabs, default 1
Returns
string
|
protected
mixed
|
#
_escape( mixed $value )
Escape key or value
Parameters
Returns
mixed
|