Neos\Flow\Configuration\ConfigurationManager::getConfiguration PHP Method

getConfiguration() public method

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
return array The configuration
    public function getConfiguration($configurationType, $configurationPath = null)
    {
        $configurationProcessingType = $this->resolveConfigurationProcessingType($configurationType);
        $configuration = [];
        switch ($configurationProcessingType) {
            case self::CONFIGURATION_PROCESSING_TYPE_DEFAULT:
            case self::CONFIGURATION_PROCESSING_TYPE_ROUTES:
            case self::CONFIGURATION_PROCESSING_TYPE_POLICY:
            case self::CONFIGURATION_PROCESSING_TYPE_APPEND:
                if (!isset($this->configurations[$configurationType])) {
                    $this->loadConfiguration($configurationType, $this->packages);
                }
                if (isset($this->configurations[$configurationType])) {
                    $configuration =& $this->configurations[$configurationType];
                }
                break;
            case self::CONFIGURATION_PROCESSING_TYPE_SETTINGS:
                if (!isset($this->configurations[$configurationType]) || $this->configurations[$configurationType] === []) {
                    $this->configurations[$configurationType] = [];
                    $this->loadConfiguration($configurationType, $this->packages);
                }
                if (isset($this->configurations[$configurationType])) {
                    $configuration =& $this->configurations[$configurationType];
                }
                break;
            case self::CONFIGURATION_PROCESSING_TYPE_OBJECTS:
                if (!isset($this->configurations[$configurationType]) || $this->configurations[$configurationType] === []) {
                    $this->loadConfiguration($configurationType, $this->packages);
                }
                if (isset($this->configurations[$configurationType])) {
                    $configuration =& $this->configurations[$configurationType];
                }
                break;
        }
        if ($configurationPath !== null && $configuration !== null) {
            return Arrays::getValueByPath($configuration, $configurationPath);
        } else {
            return $configuration;
        }
    }

Usage Example

Beispiel #1
0
 /**
  * Gets the authentication provider configuration needed
  *
  * @return void
  */
 public function initializeObject()
 {
     $settings = $this->configurationManager->getConfiguration(\Neos\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow');
     if (isset($settings['security']['authentication']['providers']['Typo3SetupProvider']['providerOptions']['keyName'])) {
         $this->keyName = $settings['security']['authentication']['providers']['Typo3SetupProvider']['providerOptions']['keyName'];
     }
 }
All Usage Examples Of Neos\Flow\Configuration\ConfigurationManager::getConfiguration