Class Environment (namespace Nette)
Nette environment and configuration.
Public Method Summary | |
---|---|
Environment |
__construct
()
Static class - cannot be instantiated.
|
static string |
expand
(string $var)
Returns expanded variable.
|
static void |
exportConstant
(string|array $names)
Define one or more variables as constants.
|
static Application |
|
static Cache |
getCache
([string $namespace =
'' ])
|
static mixed |
Returns the global configuration.
|
static Configurator |
Gets "class behind Environment" configurator.
|
static IHttpRequest |
|
static IHttpResponse |
|
static bool |
getMode
(string $mode)
Returns the mode.
|
static string |
getName
()
Returns the current environment name.
|
static mixed |
getService
(string $name, [bool $need =
TRUE ])
Gets the service object of the specified type.
|
static IServiceLocator |
Get initial instance of service locator.
|
static Session|Nette\Web\Session |
getSession
([string $namespace =
NULL ])
Returns instance of session or session namespace.
|
static IUser |
getUser
()
|
static mixed |
getVariable
(string $name, [mixed $default =
NULL ])
Returns the value of an environment variable or $default if there is no element set.
|
static bool |
isConsole
()
Detects console (non-HTTP) mode.
|
static bool |
isDebugging
()
Determines whether the debugger is active.
|
static void |
isLive
()
|
static bool |
isProduction
()
Determines whether a server is running in production mode.
|
static ArrayObject |
loadConfig
([string|Nette\Config\Config $file =
NULL ])
Loads global configuration from file and process it.
|
static void |
setConfigurator
(Configurator $configurator)
Sets "class behind Environment" configurator.
|
static void |
setMode
(string $mode, [bool $flag =
TRUE ])
Sets the mode.
|
static void |
setName
(string $name)
Sets the current environment name.
|
static void |
setVariable
(string $name, mixed $value, [bool $expand =
TRUE ])
Sets the environment variable.
|
Constant Summary | |||
---|---|---|---|
string | CONSOLE |
'console' |
line 35 environment name |
string | DEBUG |
'debug' |
line 40 mode name |
string | DEVELOPMENT |
'development' |
line 33 environment name |
string | LAB |
'lab' |
line 36 environment name |
string | PERFORMANCE |
'performance' |
line 41 mode name |
string | PRODUCTION |
'production' |
line 34 environment name |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 74 __constructpublic Environment __construct () Static class - cannot be instantiated.
|
|||||||||||||||||||||
line 302 expandpublic static string expand (string $var) Returns expanded variable.
|
|||||||||||||||||||||
line 282 exportConstantpublic static void exportConstant (string|array $names) Define one or more variables as constants.
|
|||||||||||||||||||||
line 403 getApplicationpublic static Application getApplication ()
|
|||||||||||||||||||||
line 428 getCachepublic static Cache getCache ([string $namespace =
|
|||||||||||||||||||||
line 473 getConfigpublic static mixed getConfig ([string $key = Returns the global configuration.
|
|||||||||||||||||||||
line 97 getConfiguratorpublic static Configurator getConfigurator () Gets "class behind Environment" configurator.
|
|||||||||||||||||||||
line 383 getHttpRequestpublic static IHttpRequest getHttpRequest ()
|
|||||||||||||||||||||
line 393 getHttpResponsepublic static IHttpResponse getHttpResponse ()
|
|||||||||||||||||||||
line 166 getModepublic static bool getMode (string $mode) Returns the mode.
|
|||||||||||||||||||||
line 133 getNamepublic static string getName () Returns the current environment name.
|
|||||||||||||||||||||
line 373 getServicepublic static mixed getService (string $name, [bool $need = Gets the service object of the specified type.
|
|||||||||||||||||||||
line 357 getServiceLocatorpublic static IServiceLocator getServiceLocator () Get initial instance of service locator.
|
|||||||||||||||||||||
line 443 getSessionpublic static Session|Nette\Web\Session getSession ([string $namespace = Returns instance of session or session namespace.
|
|||||||||||||||||||||
line 413 getUserpublic static IUser getUser ()
|
|||||||||||||||||||||
line 251 getVariablepublic static mixed getVariable (string $name, [mixed $default = Returns the value of an environment variable or $default if there is no element set.
|
|||||||||||||||||||||
line 183 isConsolepublic static bool isConsole () Detects console (non-HTTP) mode.
|
|||||||||||||||||||||
line 216 isDebuggingpublic static bool isDebugging () Determines whether the debugger is active.
|
|||||||||||||||||||||
line 204 isLivepublic static void isLive ()
|
|||||||||||||||||||||
line 194 isProductionpublic static bool isProduction () Determines whether a server is running in production mode.
|
|||||||||||||||||||||
line 460 loadConfigpublic static ArrayObject loadConfig ([string|Nette\Config\Config $file = Loads global configuration from file and process it.
|
|||||||||||||||||||||
line 86 setConfiguratorpublic static void setConfigurator (Configurator $configurator) Sets "class behind Environment" configurator.
|
|||||||||||||||||||||
line 152 setModepublic static void setMode (string $mode, [bool $flag = Sets the mode.
|
|||||||||||||||||||||
line 117 setNamepublic static void setName (string $name) Sets the current environment name.
|
|||||||||||||||||||||
line 234 setVariablepublic static void setVariable (string $name, mixed $value, [bool $expand = Sets the environment variable.
|