PHP 클래스 Neos\Flow\Configuration\ConfigurationManager

파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cacheNeedsUpdate boolean
$configurationSource Neos\Flow\Configuration\Source\YamlSource
$configurationTypes array Defines which Configuration Type is processed by which logic
$configurations array Storage of the raw special configurations
$context Neos\Flow\Core\ApplicationContext The application context of the configuration to manage
$orderedListOfContextNames array Example: Development, Development/Foo, Development/Foo/Bar
$packages array Active packages to load the configuration for
$subRoutesRecursionLevel integer Counts how many SubRoutes have been loaded. If this number exceeds MAXIMUM_SUBROUTE_RECURSIONS, an exception is thrown
$temporaryDirectoryPath string An absolute file path to store configuration caches in. If null no cache will be active.

공개 메소드들

메소드 설명
__construct ( ApplicationContext $context ) Constructs the configuration manager
flushConfigurationCache ( ) : void If a cache file with previously saved configuration exists, it is removed.
getAvailableConfigurationTypes ( ) : array Get the available configuration-types
getConfiguration ( string $configurationType, string $configurationPath = null ) : array Returns the specified raw configuration.
injectConfigurationSource ( YamlSource $configurationSource ) : void Injects the configuration source
isSplitSourceAllowedForConfigurationType ( string $configurationType ) : boolean Check the allowSplitSource setting for the configuration type.
loadConfigurationCache ( ) : boolean If a cache file with previously saved configuration exists, it is loaded.
registerConfigurationType ( string $configurationType, string $configurationProcessingType = self::CONFIGURATION_PROCESSING_TYPE_DEFAULT, boolean $allowSplitSource = false ) : void Registers a new configuration type with the given configuration processing type.
resolveConfigurationProcessingType ( string $configurationType ) : string Resolve the processing type for the configuration type.
setPackages ( array $packages ) : void Sets the active packages to load the configuration for
setTemporaryDirectoryPath ( string $temporaryDirectoryPath ) Set an absolute file path to store configuration caches in. If null no cache will be active.
shutdown ( ) : void Shuts down the configuration manager.
warmup ( ) : void Warms up the complete configuration cache, i.e. fetching every configured configuration type in order to be able to store it into the cache, if configured to do so.

보호된 메소드들

메소드 설명
buildSubRouteConfigurations ( array $routesConfiguration, array $subRoutesConfiguration, string $subRouteKey, array $subRouteOptions ) : array Merges all routes in $routesConfiguration with the sub routes in $subRoutesConfiguration
constructConfigurationCachePath ( ) : string Constructs a path to the configuration cache PHP file.
emitConfigurationManagerReady ( ConfigurationManager $configurationManager ) : void Emits a signal after The ConfigurationManager has been loaded
includeSubRoutesFromSettings ( array &$routeDefinitions ) : void Merges routes from Neos.Flow.mvc.routes settings into $routeDefinitions NOTE: Routes from settings will always be appended to existing route definitions from the main Routes configuration!
loadConfiguration ( string $configurationType, array $packages ) : void Loads special configuration defined in the specified packages and merges them with those potentially existing in the global configuration folders. The result is stored in the configuration manager's configuration registry and can be retrieved with the getConfiguration() method.
mergePolicyConfiguration ( array $firstConfigurationArray, array $secondConfigurationArray ) : array Merges two policy configuration arrays.
mergeRoutesWithSubRoutes ( array &$routesConfiguration ) : void Loads specified sub routes and builds composite routes.
postProcessConfiguration ( array &$configurations ) : void Post processes the given configuration array by replacing constants with their actual value.
replacePlaceholders ( string $string, array $variables ) : string Replaces placeholders in the format with the corresponding variable of the specified $variables collection.
replaceVariablesInValue ( string $value ) : mixed Replaces variables (in the format %CONSTANT% or %ENV::ENVIRONMENT_VARIABLE) in the given (configuration) value string.
saveConfigurationCache ( ) : void Saves the current configuration into a cache file and creates a cache inclusion script in the context's Configuration directory.
validatePolicyConfiguration ( array $policyConfiguration, Neos\Flow\Package\PackageInterface $package ) : void Validates the given $policyConfiguration and throws an exception if its not valid

메소드 상세

__construct() 공개 메소드

Constructs the configuration manager
public __construct ( ApplicationContext $context )
$context Neos\Flow\Core\ApplicationContext The application context to fetch configuration for

buildSubRouteConfigurations() 보호된 메소드

Merges all routes in $routesConfiguration with the sub routes in $subRoutesConfiguration
protected buildSubRouteConfigurations ( array $routesConfiguration, array $subRoutesConfiguration, string $subRouteKey, array $subRouteOptions ) : array
$routesConfiguration array
$subRoutesConfiguration array
$subRouteKey string the key of the sub route:
$subRouteOptions array
리턴 array the merged route configuration

constructConfigurationCachePath() 보호된 메소드

Derived from the temporary path and application context.

emitConfigurationManagerReady() 보호된 메소드

Emits a signal after The ConfigurationManager has been loaded
protected emitConfigurationManagerReady ( ConfigurationManager $configurationManager ) : void
$configurationManager ConfigurationManager
리턴 void

flushConfigurationCache() 공개 메소드

If a cache file with previously saved configuration exists, it is removed.
public flushConfigurationCache ( ) : void
리턴 void

getAvailableConfigurationTypes() 공개 메소드

Get the available configuration-types
public getAvailableConfigurationTypes ( ) : array
리턴 array

getConfiguration() 공개 메소드

The actual configuration will be merged from different sources in a defined order. Note that this is a low level method and mostly makes sense to be used by Flow internally. If possible just use settings and have them injected.
public getConfiguration ( string $configurationType, string $configurationPath = null ) : array
$configurationType string The kind of configuration to fetch - must be one of the CONFIGURATION_TYPE_* constants
$configurationPath string The path inside the configuration to fetch
리턴 array The configuration

includeSubRoutesFromSettings() 보호된 메소드

Merges routes from Neos.Flow.mvc.routes settings into $routeDefinitions NOTE: Routes from settings will always be appended to existing route definitions from the main Routes configuration!
protected includeSubRoutesFromSettings ( array &$routeDefinitions ) : void
$routeDefinitions array
리턴 void

injectConfigurationSource() 공개 메소드

Injects the configuration source
public injectConfigurationSource ( YamlSource $configurationSource ) : void
$configurationSource Neos\Flow\Configuration\Source\YamlSource
리턴 void

isSplitSourceAllowedForConfigurationType() 공개 메소드

Check the allowSplitSource setting for the configuration type.
public isSplitSourceAllowedForConfigurationType ( string $configurationType ) : boolean
$configurationType string
리턴 boolean

loadConfiguration() 보호된 메소드

Loads special configuration defined in the specified packages and merges them with those potentially existing in the global configuration folders. The result is stored in the configuration manager's configuration registry and can be retrieved with the getConfiguration() method.
protected loadConfiguration ( string $configurationType, array $packages ) : void
$configurationType string The kind of configuration to load - must be one of the CONFIGURATION_TYPE_* constants
$packages array An array of Package objects (indexed by package key) to consider
리턴 void

loadConfigurationCache() 공개 메소드

If a cache file with previously saved configuration exists, it is loaded.
public loadConfigurationCache ( ) : boolean
리턴 boolean If cached configuration was loaded or not

mergePolicyConfiguration() 보호된 메소드

Merges two policy configuration arrays.
protected mergePolicyConfiguration ( array $firstConfigurationArray, array $secondConfigurationArray ) : array
$firstConfigurationArray array
$secondConfigurationArray array
리턴 array

mergeRoutesWithSubRoutes() 보호된 메소드

Loads specified sub routes and builds composite routes.
protected mergeRoutesWithSubRoutes ( array &$routesConfiguration ) : void
$routesConfiguration array
리턴 void

postProcessConfiguration() 보호된 메소드

Post processes the given configuration array by replacing constants with their actual value.
protected postProcessConfiguration ( array &$configurations ) : void
$configurations array
리턴 void

registerConfigurationType() 공개 메소드

The processing type must be supported by the ConfigurationManager, see CONFIGURATION_PROCESSING_TYPE_* for what is available.
public registerConfigurationType ( string $configurationType, string $configurationProcessingType = self::CONFIGURATION_PROCESSING_TYPE_DEFAULT, boolean $allowSplitSource = false ) : void
$configurationType string The type to register, may be anything
$configurationProcessingType string One of CONFIGURATION_PROCESSING_TYPE_*, defaults to CONFIGURATION_PROCESSING_TYPE_DEFAULT
$allowSplitSource boolean If TRUE, the type will be used as a "prefix" when looking for split configuration. Only supported for DEFAULT and SETTINGS processing types!
리턴 void

replacePlaceholders() 보호된 메소드

Replaces placeholders in the format with the corresponding variable of the specified $variables collection.
protected replacePlaceholders ( string $string, array $variables ) : string
$string string
$variables array
리턴 string

replaceVariablesInValue() 보호된 메소드

Replaces variables (in the format %CONSTANT% or %ENV::ENVIRONMENT_VARIABLE) in the given (configuration) value string.
protected replaceVariablesInValue ( string $value ) : mixed
$value string
리턴 mixed

resolveConfigurationProcessingType() 공개 메소드

This returns the CONFIGURATION_PROCESSING_TYPE_* to use for the given $configurationType.
public resolveConfigurationProcessingType ( string $configurationType ) : string
$configurationType string
리턴 string

saveConfigurationCache() 보호된 메소드

Saves the current configuration into a cache file and creates a cache inclusion script in the context's Configuration directory.
protected saveConfigurationCache ( ) : void
리턴 void

setPackages() 공개 메소드

Sets the active packages to load the configuration for
public setPackages ( array $packages ) : void
$packages array
리턴 void

setTemporaryDirectoryPath() 공개 메소드

Set an absolute file path to store configuration caches in. If null no cache will be active.
public setTemporaryDirectoryPath ( string $temporaryDirectoryPath )
$temporaryDirectoryPath string

shutdown() 공개 메소드

This method writes the current configuration into a cache file if Flow was configured to do so.
public shutdown ( ) : void
리턴 void

validatePolicyConfiguration() 보호된 메소드

Validates the given $policyConfiguration and throws an exception if its not valid
protected validatePolicyConfiguration ( array $policyConfiguration, Neos\Flow\Package\PackageInterface $package ) : void
$policyConfiguration array
$package Neos\Flow\Package\PackageInterface
리턴 void

warmup() 공개 메소드

Warms up the complete configuration cache, i.e. fetching every configured configuration type in order to be able to store it into the cache, if configured to do so.
또한 보기: Neos\Flow\Configuration\ConfigurationManager::shutdown
public warmup ( ) : void
리턴 void

프로퍼티 상세

$cacheNeedsUpdate 보호되어 있는 프로퍼티

protected bool $cacheNeedsUpdate
리턴 boolean

$configurationSource 보호되어 있는 프로퍼티

protected YamlSource,Neos\Flow\Configuration\Source $configurationSource
리턴 Neos\Flow\Configuration\Source\YamlSource

$configurationTypes 보호되어 있는 프로퍼티

Defines which Configuration Type is processed by which logic
protected array $configurationTypes
리턴 array

$configurations 보호되어 있는 프로퍼티

Storage of the raw special configurations
protected array $configurations
리턴 array

$context 보호되어 있는 프로퍼티

The application context of the configuration to manage
protected ApplicationContext,Neos\Flow\Core $context
리턴 Neos\Flow\Core\ApplicationContext

$orderedListOfContextNames 보호되어 있는 프로퍼티

Example: Development, Development/Foo, Development/Foo/Bar
protected array $orderedListOfContextNames
리턴 array

$packages 보호되어 있는 프로퍼티

Active packages to load the configuration for
protected array $packages
리턴 array

$subRoutesRecursionLevel 보호되어 있는 프로퍼티

Counts how many SubRoutes have been loaded. If this number exceeds MAXIMUM_SUBROUTE_RECURSIONS, an exception is thrown
protected int $subRoutesRecursionLevel
리턴 integer

$temporaryDirectoryPath 보호되어 있는 프로퍼티

An absolute file path to store configuration caches in. If null no cache will be active.
protected string $temporaryDirectoryPath
리턴 string