Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • none

Classes

  • ArrayHash
  • ArrayList
  • Callback
  • DateTime
  • Environment
  • Framework
  • FreezableObject
  • Image
  • Object
  • ObjectMixin

Interfaces

  • IFreezable

Exceptions

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

Class Environment

Nette environment and configuration.

Namespace: Nette
Deprecated
Author: David Grudl
Located at common/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
public static boolean
# isProduction( )

Determines whether a server is running in production mode.

Determines whether a server is running in production mode.

Returns

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

Enables or disables production mode.

Enables or disables production mode.

Parameters

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

Sets the environment variable.

Sets the environment variable.

Parameters

$name
string
$value
mixed
$expand
boolean
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 found

Returns

mixed

Throws

Nette\InvalidStateException
public static array
# getVariables( )

Returns the all environment variables.

Returns the all environment variables.

Returns

array
public static string
# expand( string $s )

Returns expanded variable.

Returns expanded variable.

Parameters

$s
string

Returns

string

Throws

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

Sets initial instance of context.

Sets initial instance of context.

public static SystemContainer|Nette\DI\Container
# getContext( )

Get initial instance of context.

Get initial instance of context.

Returns

SystemContainer|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
string
service name

Returns

object
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
arguments

Returns

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

Returns

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

Returns

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

Returns

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

Returns

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

Returns

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

Returns

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

Parameters

$namespace
string

Returns

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
string

Returns

Nette\Http\Session
public static Nette\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
string
$section
string

Returns

Nette\ArrayHash
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

Returns

mixed
Constants summary
string DEVELOPMENT 'development'
#

environment name

environment name

string PRODUCTION 'production'
#

environment name

environment name

string CONSOLE 'console'
#

environment name

environment name

Nette 2.0 API documentation generated by ApiGen 2.8.0