Class NEnvironment
Nette environment and configuration.
final public
|
#
__construct(
)
Static class – cannot be instantiated. Static class – cannot be instantiated. |
public static
void
|
#
setConfigurator(
NConfigurator
$configurator
)
Sets „class behind Environment“ configurator. Sets „class behind Environment“ configurator. Parameters$configurator NConfigurator |
public static
NConfigurator
|
#
getConfigurator(
)
Gets „class behind Environment“ configurator. Gets „class behind Environment“ configurator. |
public static
void
|
#
setName(
string
$name
)
Sets the current environment name. |
public static
string
|
#
getName(
)
Returns the current environment name. Returns the current environment name. |
public static
void
|
#
setMode(
string
$mode,
bool
$value = true
)
Sets the mode. Sets the mode. Parameters$mode string mode identifier$value bool set or unset |
public static
bool
|
#
getMode(
string
$mode
)
Returns the mode. Returns the mode. Parameters$mode string mode identifier |
public static
bool
|
#
isConsole(
)
Detects console (non-HTTP) mode. Detects console (non-HTTP) mode. |
public static
bool
|
#
isProduction(
)
Determines whether a server is running in production mode. Determines whether a server is running in production mode. |
public static
void
|
#
setVariable(
string
$name,
mixed
$value,
bool
$expand = true
)
Sets the environment variable. Sets the environment variable. Parameters$name string$value mixed$expand bool |
public static
mixed
|
#
getVariable(
string
$name,
mixed
$default = NULL
)
Returns the value of an environment variable or $default if there is no element set. Returns the value of an environment variable or $default if there is no element set. Parameters$name string$default mixed default value to use if key not foundThrows |
public static
array
|
#
getVariables(
)
Returns the all environment variables. Returns the all environment variables. |
public static
string
|
#
expand(
string
$var
)
Returns expanded variable. |
public static
IContext
|
#
getContext(
)
Get initial instance of context. Get initial instance of context. |
public static
object
|
#
getService(
string
$name,
array
$options = NULL
)
Gets the service object of the specified type. Gets the service object of the specified type. Parameters$name string service name$options array options in case service is not singleton |
public static
void
|
#
setServiceAlias(
string
$service,
string
$alias
)
Adds new NEnvironment::get<Service>() method. Adds new NEnvironment::get<Service>() method. Parameters$service string service name$alias string alias name |
public static
object
|
#
__callStatic(
string
$name,
array
$args
)
Calling to undefined static method. Calling to undefined static method. Parameters$name string method name$args array argumentsReturnsobject service
|
public static
NHttpRequest
|
#
getHttpRequest(
)
|
public static
NHttpContext
|
#
getHttpContext(
)
|
public static
NHttpResponse
|
#
getHttpResponse(
)
|
public static
NApplication
|
#
getApplication(
)
|
public static
NUser
|
#
getUser(
)
|
public static
NRobotLoader
|
#
getRobotLoader(
)
|
public static
NCache
|
#
getCache(
string
$namespace = ''
)
Parameters$namespace string |
public static
NSession
|
#
getSession(
string
$namespace = NULL
)
Returns instance of session or session namespace. Returns instance of session or session namespace. Parameters$namespace string |
public static
ArrayObject
|
#
loadConfig(
string|NConfig
$file = NULL
)
Loads global configuration from file and process it. Loads global configuration from file and process it. Parameters$file string|NConfig file name or Config object |
public static
mixed
|
#
getConfig(
string
$key = NULL,
mixed
$default = NULL
)
Returns the global configuration. Returns the global configuration. Parameters$key string key$default mixed default value |