Methods summary
public static
string
|
#
GetSystemConfigPath( )
Get system config relative path from app root.
Get system config relative path from app root.
Returns
string
|
public static
string
|
#
SetSystemConfigPath( string $systemConfigPath )
Set system config relative path from app root.
Set system config relative path from app root.
Parameters
Returns
string
|
public static
MvcCore\Config
|
#
SetConfigCache( string $appRootRelativePath, MvcCore\IConfig $config )
Set system config relative path from app root.
Set system config relative path from app root.
Parameters
- $appRootRelativePath
- $config
Returns
|
public static
boolean
|
#
ClearConfigCache( string|null $appRootRelativePath = NULL )
Clear configs memory cache by relative path from app root
or clear whole configs memory cache if NULL specified.
Clear configs memory cache by relative path from app root
or clear whole configs memory cache if NULL specified.
Parameters
Returns
boolean
|
public static
array|stdClass
&
|
#
GetEnvironmentDetectionData( MvcCore\IConfig $config )
Return environment configuration data from system config. Environment
configuration data are always stored under root level section [environments] .
Return environment configuration data from system config. Environment
configuration data are always stored under root level section [environments] .
Parameters
Returns
array|stdClass
|
public static
|
#
SetUpEnvironmentData( MvcCore\IConfig $config, string $environmentName )
Set up config with current environment data immediately after
environment name is detected. This method is used INTERNALLY!
Set up config with current environment data immediately after
environment name is detected. This method is used INTERNALLY!
Parameters
|
public static
MvcCore\Config
|
#
CreateInstance( array $mergedData = [], string $appRootRelativePath = NULL )
This is INTERNAL method.
Return always new instance of statically called class, no singleton.
Always called from \MvcCore\Config::GetSystem() before system config is read.
This is place where to customize any config creation process,
before it's created by MvcCore framework.
This is INTERNAL method.
Return always new instance of statically called class, no singleton.
Always called from \MvcCore\Config::GetSystem() before system config is read.
This is place where to customize any config creation process,
before it's created by MvcCore framework.
Parameters
- $mergedData
- Configuration data for all environments.
- $appRootRelativePath
- Relative config path from app root.
Returns
|
public static
MvcCore\Config |null
|
#
GetSystem( )
Get (optionally cached) system config INI file as stdClass or array ,
placed by default in: "/App/config.ini" .
Get (optionally cached) system config INI file as stdClass or array ,
placed by default in: "/App/config.ini" .
Returns
Throws
RuntimeException
|
public static
MvcCore\Config |null
|
#
GetConfig( string $appRootRelativePath )
Get (optionally cached) config INI file as stdClass or array ,
placed relatively from application document root.
Get (optionally cached) config INI file as stdClass or array ,
placed relatively from application document root.
Parameters
- $appRootRelativePath
- Any config relative path like
'/%appPath%/website.ini' .
Returns
Throws
RuntimeException
|
public static
MvcCore\Config |boolean
|
#
LoadConfig( string $configFullPath, string $systemConfigClass, boolean $isSystemConfig = FALSE )
Try to load and parse config file by absolute path.
Try to load and parse config file by absolute path.
Parameters
- $configFullPath
- $systemConfigClass
- $isSystemConfig
Returns
|
public
boolean
|
#
Save( )
Encode all data into string and store it in \MvcCore\Config::$fullPath .
Encode all data into string and store it in \MvcCore\Config::$fullPath .
Returns
boolean
Throws
Exception Configuration data was not possible to dump or write.
|
public
array
&
|
#
GetData( string|null $environmentName = NULL )
Get internal array store as reference.
Get internal array store as reference.
Parameters
- $environmentName
Return configuration data only for specific
environment name. If NULL , there are
returned data for current environment.
Returns
array
|
public
MvcCore\Config
|
#
SetData( array $data = [], string|null $environmentName = NULL )
Set whole internal array store.
Set whole internal array store.
Parameters
- $data
Data to set into configuration store(s). If second
param is NULL , there are set data for current envirnment.
- $environmentName
Set configuration data for specific
environment name. If NULL , there are
set data for current environment.
Returns
|
public
string
|
#
GetFullPath( )
Full path, where are configuration data stored.
Full path, where are configuration data stored.
Returns
string
|
public
integer
|
#
GetLastChanged( )
Config file last changed UNIX timestamp.
Config file last changed UNIX timestamp.
Returns
integer
|
public
boolean
|
#
IsSystem( )
If TRUE , config contains system data.
If TRUE , config contains system data.
Returns
boolean
|
public
boolean
|
#
Read( )
Load config file and return TRUE for success or FALSE in failure.
- Load all sections for all environment names into $this->envData collection.
- Retype all raw string values into float , int or boolean types.
- Retype collections into \stdClass , if there are no numeric keys.
Load config file and return TRUE for success or FALSE in failure.
- Load all sections for all environment names into $this->envData collection.
- Retype all raw string values into float , int or boolean types.
- Retype collections into \stdClass , if there are no numeric keys.
Returns
boolean
|
public
string
|
#
Dump( )
Dump configuration data (for all environments) into INI configuration
syntax with environment specific sections and data.
Dump configuration data (for all environments) into INI configuration
syntax with environment specific sections and data.
Returns
string
|
public
mixed
|
#
__get( string $key )
Get not defined property from $this->currentData array store,
if there is nothing, return NULL .
Get not defined property from $this->currentData array store,
if there is nothing, return NULL .
Parameters
Returns
mixed
|
public
mixed
|
#
__set( string $key, $value )
Store not defined property inside $this->currentData array store.
Store not defined property inside $this->currentData array store.
Parameters
Returns
mixed
|
public
boolean
|
#
__isset( string $key )
Magic function triggered by: isset($cfg->key); .
Magic function triggered by: isset($cfg->key); .
Parameters
Returns
boolean
|
public
|
#
__unset( string $key )
Magic function triggered by: unset($cfg->key); .
Magic function triggered by: unset($cfg->key); .
Parameters
|