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 Application |
|
static Cache |
getCache
([string $namespace =
'' ])
|
static mixed |
Returns the global configuration.
|
static Configurator |
Gets "class behind Environment" configurator.
|
static HttpContext |
|
static HttpRequest |
|
static HttpResponse |
|
static bool |
getMode
(string $mode)
Returns the mode.
|
static string |
getName
()
Returns the current environment name.
|
static object |
getService
(string $name, [$options =
NULL ])
Gets the service object of the specified type.
|
static IServiceLocator |
Get initial instance of service locator.
|
static Session |
getSession
([string $namespace =
NULL ])
Returns instance of session or session namespace.
|
static User |
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 array |
getVariables
()
Returns the all environment variables.
|
static bool |
isConsole
()
Detects console (non-HTTP) mode.
|
static void |
isDebugging
()
|
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 $value =
TRUE ])
Sets the mode.
|
static void |
setName
(string $name)
Sets the current environment name.
|
static void |
setServiceAlias
(string $service, string $alias)
Adds new Environment::get<Service>() method.
|
static void |
setVariable
(string $name, mixed $value, [bool $expand =
TRUE ])
Sets the environment variable.
|
static object service |
__callStatic
(string $name, array $args)
Calling to undefined static method.
|
Constant Summary | |||
---|---|---|---|
string | CONSOLE |
'console' |
line 26 environment name |
string | DEBUG |
'debug' |
line 31 mode name |
string | DEVELOPMENT |
'development' |
line 24 environment name |
string | LAB |
'lab' |
line 27 environment name |
string | PERFORMANCE |
'performance' |
line 32 mode name |
string | PRODUCTION |
'production' |
line 25 environment name |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 70 __constructpublic Environment __construct () Static class - cannot be instantiated.
|
|||||||||||||||||||||
line 280 expandpublic static string expand (string $var) Returns expanded variable.
|
|||||||||||||||||||||
line 421 getApplicationpublic static Application getApplication ()
|
|||||||||||||||||||||
line 446 getCachepublic static Cache getCache ([string $namespace =
|
|||||||||||||||||||||
line 491 getConfigpublic static mixed getConfig ([string $key = Returns the global configuration.
|
|||||||||||||||||||||
line 93 getConfiguratorpublic static Configurator getConfigurator () Gets "class behind Environment" configurator.
|
|||||||||||||||||||||
line 401 getHttpContextpublic static HttpContext getHttpContext ()
|
|||||||||||||||||||||
line 391 getHttpRequestpublic static HttpRequest getHttpRequest ()
|
|||||||||||||||||||||
line 411 getHttpResponsepublic static HttpResponse getHttpResponse ()
|
|||||||||||||||||||||
line 161 getModepublic static bool getMode (string $mode) Returns the mode.
|
|||||||||||||||||||||
line 129 getNamepublic static string getName () Returns the current environment name.
|
|||||||||||||||||||||
line 351 getServicepublic static object getService (string $name, [$options = Gets the service object of the specified type.
|
|||||||||||||||||||||
line 335 getServiceLocatorpublic static IServiceLocator getServiceLocator () Get initial instance of service locator.
|
|||||||||||||||||||||
line 461 getSessionpublic static Session getSession ([string $namespace = Returns instance of session or session namespace.
|
|||||||||||||||||||||
line 431 getUserpublic static User getUser ()
|
|||||||||||||||||||||
line 233 getVariablepublic static mixed getVariable (string $name, [mixed $default = Returns the value of an environment variable or $default if there is no element set.
|
|||||||||||||||||||||
line 263 getVariablespublic static array getVariables () Returns the all environment variables.
|
|||||||||||||||||||||
line 177 isConsolepublic static bool isConsole () Detects console (non-HTTP) mode.
|
|||||||||||||||||||||
line 198 isDebuggingpublic static void isDebugging ()
|
|||||||||||||||||||||
line 188 isProductionpublic static bool isProduction () Determines whether a server is running in production mode.
|
|||||||||||||||||||||
line 478 loadConfigpublic static ArrayObject loadConfig ([string|Nette\Config\Config $file = Loads global configuration from file and process it.
|
|||||||||||||||||||||
line 82 setConfiguratorpublic static void setConfigurator (Configurator $configurator) Sets "class behind Environment" configurator.
|
|||||||||||||||||||||
line 148 setModepublic static void setMode (string $mode, [bool $value = Sets the mode.
|
|||||||||||||||||||||
line 113 setNamepublic static void setName (string $name) Sets the current environment name.
|
|||||||||||||||||||||
line 364 setServiceAliaspublic static void setServiceAlias (string $service, string $alias) Adds new Environment::get<Service>() method.
|
|||||||||||||||||||||
line 216 setVariablepublic static void setVariable (string $name, mixed $value, [bool $expand = Sets the environment variable.
|
|||||||||||||||||||||
line 377 __callStaticpublic static object service __callStatic (string $name, array $args) Calling to undefined static method.
|