Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Utils
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • Callback
  • Configurator
  • Environment
  • Framework
  • FreezableObject
  • Object

Interfaces

  • IFreezable

Exceptions

  • ArgumentOutOfRangeException
  • DeprecatedException
  • DirectoryNotFoundException
  • FileNotFoundException
  • InvalidArgumentException
  • InvalidStateException
  • IOException
  • MemberAccessException
  • NotImplementedException
  • NotSupportedException
  • OutOfRangeException
  • StaticClassException
  • UnexpectedValueException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Environment

Nette environment and configuration.

Namespace: Nette
Deprecated
Located at deprecated/Environment.php
Methods summary
final public
# __construct( )

Static class - cannot be instantiated.

Static class - cannot be instantiated.

public static boolean
# isConsole( )

Detects console (non-HTTP) mode.

Detects console (non-HTTP) mode.

Returns

boolean
bool
public static boolean
# isProduction( )

Determines whether a server is running in production mode.

Determines whether a server is running in production mode.

Returns

boolean
bool
public static
# setProductionMode( boolean $value = TRUE )

Enables or disables production mode.

Enables or disables production mode.

Parameters

$value
public static
# setVariable( string $name, mixed $value, boolean $expand = TRUE )

Sets the environment variable.

Sets the environment variable.

Parameters

$name
$value
$expand
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
$default
value to use if key not found

Returns

mixed
mixed

Throws

Nette\InvalidStateException
InvalidStateException
public static array
# getVariables( )

Returns the all environment variables.

Returns the all environment variables.

Returns

array
array
public static string
# expand( string $s )

Returns expanded variable.

Returns expanded variable.

Parameters

$s

Returns

string
string

Throws

Nette\InvalidStateException
InvalidStateException
public static
# setContext( Nette\DI\Container $context )

Sets initial instance of context.

Sets initial instance of context.

public static Nette\DI\Container
# getContext( )

Get initial instance of context.

Get initial instance of context.

Returns

Nette\DI\Container
Nette\DI\Container
public static object
# getService( string $name )

Gets the service object of the specified type.

Gets the service object of the specified type.

Parameters

$name
name

Returns

object
object
public static object
# __callStatic( string $name, array $args )

Calling to undefined static method.

Calling to undefined static method.

Parameters

$name
name
$args
arguments

Returns

object
service
public static Nette\Http\Request
# getHttpRequest( )

Returns

Nette\Http\Request
Nette\Http\Request
public static Nette\Http\Context
# getHttpContext( )

Returns

Nette\Http\Context
Nette\Http\Context
public static Nette\Http\Response
# getHttpResponse( )

Returns

Nette\Http\Response
Nette\Http\Response
public static Nette\Application\Application
# getApplication( )

Returns

Nette\Application\Application
Nette\Application\Application
public static Nette\Security\User
# getUser( )

Returns

Nette\Security\User
Nette\Security\User
public static Nette\Loaders\RobotLoader
# getRobotLoader( )

Returns

Nette\Loaders\RobotLoader
Nette\Loaders\RobotLoader
public static Nette\Caching\Cache
# getCache( string $namespace = '' )

Parameters

$namespace

Returns

Nette\Caching\Cache
Nette\Caching\Cache
public static Nette\Http\Session
# getSession( string $namespace = NULL )

Returns instance of session or session namespace.

Returns instance of session or session namespace.

Parameters

$namespace

Returns

Nette\Http\Session
Nette\Http\Session
public static Nette\Utils\ArrayHash
# loadConfig( string $file = NULL, string $section = NULL )

Loads global configuration from file and process it.

Loads global configuration from file and process it.

Parameters

$file
$section

Returns

Nette\Utils\ArrayHash
Nette\Utils\ArrayHash
public static mixed
# getConfig( string $key = NULL, mixed $default = NULL )

Returns the global configuration.

Returns the global configuration.

Parameters

$key
key
$default
value

Returns

mixed
mixed
Constants summary
string DEVELOPMENT

environment name

environment name

#'development'
string PRODUCTION

environment name

environment name

#'production'
string CONSOLE

environment name

environment name

#'console'
Nette 2.3-20161221 API API documentation generated by ApiGen 2.8.0