PHP Class Neos\Flow\Utility\Environment

Show file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$context Neos\Flow\Core\ApplicationContext
$request Neos\Flow\Mvc\ActionRequest
$temporaryDirectory string
$temporaryDirectoryBase string The base path of $temporaryDirectory. This property can (and should) be set from outside.

Public Methods

Method Description
__construct ( ApplicationContext $context ) Initializes the environment instance.
getContext ( ) : ApplicationContext
getMaximumPathLength ( ) : integer Retrieves the maximum path length that is valid in the current environment.
getPathToTemporaryDirectory ( ) : string Returns the full path to Flow's temporary directory.
isRewriteEnabled ( ) : boolean Whether or not URL rewriting is enabled.
setTemporaryDirectoryBase ( string $temporaryDirectoryBase ) : void Sets the base path of the temporary directory

Protected Methods

Method Description
createTemporaryDirectory ( string $temporaryDirectoryBase ) : string Creates Flow's temporary directory - or at least asserts that it exists and is writable.

Method Details

__construct() public method

Initializes the environment instance.
public __construct ( ApplicationContext $context )
$context Neos\Flow\Core\ApplicationContext The Flow context

createTemporaryDirectory() protected method

For each Flow Application Context, we create an extra temporary folder, and for nested contexts, the folders are prefixed with "SubContext" to avoid ambiguity, and look like: Data/Temporary/Production/SubContextLive
protected createTemporaryDirectory ( string $temporaryDirectoryBase ) : string
$temporaryDirectoryBase string Full path to the base for the temporary directory
return string The full path to the temporary directory

getContext() public method

public getContext ( ) : ApplicationContext
return Neos\Flow\Core\ApplicationContext

getMaximumPathLength() public method

Retrieves the maximum path length that is valid in the current environment.
public getMaximumPathLength ( ) : integer
return integer The maximum available path length

getPathToTemporaryDirectory() public method

Returns the full path to Flow's temporary directory.
public getPathToTemporaryDirectory ( ) : string
return string Path to PHP's temporary directory

isRewriteEnabled() public method

Whether or not URL rewriting is enabled.
public isRewriteEnabled ( ) : boolean
return boolean

setTemporaryDirectoryBase() public method

Sets the base path of the temporary directory
public setTemporaryDirectoryBase ( string $temporaryDirectoryBase ) : void
$temporaryDirectoryBase string Base path of the temporary directory, with trailing slash
return void

Property Details

$context protected property

protected ApplicationContext,Neos\Flow\Core $context
return Neos\Flow\Core\ApplicationContext

$request protected property

protected ActionRequest,Neos\Flow\Mvc $request
return Neos\Flow\Mvc\ActionRequest

$temporaryDirectory protected property

protected string $temporaryDirectory
return string

$temporaryDirectoryBase protected property

The base path of $temporaryDirectory. This property can (and should) be set from outside.
protected string $temporaryDirectoryBase
return string