Interface IEnvironment
Responsibility - detecting environment, optionally by in system config.
- Environment management and detection by: - comparing server and client IP, by value or regular expression. - comparing server hostname or IP, by value or regular expression. - checking system environment variable existence, value or by regular exp.
-
MvcCore\IEnvironment
implements
MvcCore\Environment\IConstants
Methods summary
public static
string[]
|
#
GetAllNames( )
Get all available nevironment names.
Get all available nevironment names.
Returns
string[]
|
public static
boolean
|
#
SetDetectionBySystemConfig( boolean $detectionBySystemConfig = TRUE )
Set TRUE , if environment is necessary to detected by loaded system config, FALSE otherwise.
Set TRUE , if environment is necessary to detected by loaded system config, FALSE otherwise.
Parameters
- $detectionBySystemConfig
TRUE by default.
Returns
boolean
|
public static
boolean
|
#
GetDetectionBySystemConfig( )
Get TRUE , if environment is necessary to detected by loaded system config, FALSE otherwise.
Get TRUE , if environment is necessary to detected by loaded system config, FALSE otherwise.
Returns
boolean
|
public static
MvcCore\Environment
|
#
CreateInstance( )
Create empty environment detection instance.
Detection will be executed ondemand later.
Create empty environment detection instance.
Detection will be executed ondemand later.
Returns
|
public
boolean
|
#
IsDevelopment( )
Return TRUE if environment is "dev" .
Return TRUE if environment is "dev" .
Returns
boolean
|
public
boolean
|
#
IsBeta( )
Return TRUE if environment is "beta" .
Return TRUE if environment is "beta" .
Returns
boolean
|
public
boolean
|
#
IsAlpha( )
Return TRUE if environment is "alpha" .
Return TRUE if environment is "alpha" .
Returns
boolean
|
public
boolean
|
#
IsProduction( )
Return TRUE if environment is "production" .
Return TRUE if environment is "production" .
Returns
boolean
|
public
boolean
|
#
IsDetected( )
Return TRUE if environment has already detected name.
Return TRUE if environment has already detected name.
Returns
boolean
|
public
string
|
#
SetName( string $name = \MvcCore\IEnvironment::PRODUCTION )
Set environment name as string,
defined by constants: \MvcCore\IEnvironment::<NAME> .
Set environment name as string,
defined by constants: \MvcCore\IEnvironment::<NAME> .
Parameters
Returns
string
|
public
string
|
#
GetName( )
Get environment name as string,
defined by constants: \MvcCore\IEnvironment::<NAME> .
Get environment name as string,
defined by constants: \MvcCore\IEnvironment::<NAME> .
Returns
string
|
public static
string
|
#
DetectByIps( )
First environment value setup - by server and client IP address.
First environment value setup - by server and client IP address.
Returns
string Detected environment string.
|
public static
string
|
#
DetectBySystemConfig( array $environmentsSectionData = [] )
Second environment value setup - by system config data environment record.
Second environment value setup - by system config data environment record.
Parameters
- $environmentsSectionData
- System config environment section data part.
Returns
string Detected environment string.
|