PHP Class AppserverIo\Appserver\Core\Utilities\AppEnvironmentHelper

Author: Bernhard Wick ([email protected])
Author: Hans Höchtl ([email protected])
Show file Open project: appserver-io/appserver Class Usage Examples

Protected Properties

Property Type Description
$cachedProperties AppserverIo\Properties\Properties Cached configuration properties

Public Methods

Method Description
getEnvironmentAwareGlobPattern ( string $appBase, string $fileGlob, integer $flags, string $fileExtension = 'xml' ) : string Will take a segmented path to a file (which might contain glob type wildcards) and return it fixed to the currently active environment modifier.
getEnvironmentModifier ( string $appBase ) : string Get the environment modifier (if any) which helps to switch the configuration environment

Protected Methods

Method Description
globDir ( string $pattern, integer $flags, boolean $recursive = true ) : array Parses and returns the directories and files that matches the passed glob pattern in a recursive way (if wanted).

Method Details

getEnvironmentAwareGlobPattern() public static method

E.g. AppEnvironmentHelper::getEnvironmentAwareFilePath('webapps/example', 'META-INF/*-ds') => 'webapps/example/META-INF/*-ds.dev.xml'
public static getEnvironmentAwareGlobPattern ( string $appBase, string $fileGlob, integer $flags, string $fileExtension = 'xml' ) : string
$appBase string The base file path to the application
$fileGlob string The intermediate path (or glob pattern) from app base path to file extension
$flags integer The flags passed to the glob function
$fileExtension string The extension of the file, will default to 'xml'
return string

getEnvironmentModifier() public static method

Get the environment modifier (if any) which helps to switch the configuration environment
public static getEnvironmentModifier ( string $appBase ) : string
$appBase string The base of the application we are dealing with
return string

globDir() protected static method

Parses and returns the directories and files that matches the passed glob pattern in a recursive way (if wanted).
protected static globDir ( string $pattern, integer $flags, boolean $recursive = true ) : array
$pattern string The glob pattern used to parse the directories
$flags integer The flags passed to the glob function
$recursive boolean Whether or not to parse directories recursively
return array The directories matches the passed glob pattern

Property Details

$cachedProperties protected static property

Cached configuration properties
protected static Properties,AppserverIo\Properties $cachedProperties
return AppserverIo\Properties\Properties