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;
}
}