Programming Language PHP
Namespace Oro\Component\Config\Loader
Class CumulativeConfigProcessorUtil
Method/Function processConfiguration
Total Examples 15
15 code examples of PHP Oro\Component\Config\Loader\CumulativeConfigProcessorUtil::processConfiguration extracted from open source projects
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$config = [];
$configLoader = new CumulativeConfigLoader(
'oro_sidebar',
new FolderingCumulativeFileLoader(
'{folder}',
'\w+',
new YamlCumulativeFileLoader('Resources/public/sidebar_widgets/{folder}/widget.yml')
)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
$config[\basename(\dirname($resource->path))] = $resource->data;
}
return CumulativeConfigProcessorUtil::processConfiguration(
'Resources/public/sidebar_widgets/*/widget.yml',
new WidgetDefinitionConfiguration(),
[$config]
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_security_permissions',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
if (\array_key_exists(PermissionConfiguration::ROOT_NODE, $resource->data)) {
$configs[$resource->bundleClass] = $resource->data;
}
}
$merger = new ConfigurationMerger($this->bundles);
$mergedConfig = $merger->mergeConfiguration($configs);
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new PermissionConfiguration(),
$mergedConfig
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_security_permissions',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
if (\array_key_exists(ConfigurablePermissionConfiguration::ROOT_NODE, $resource->data)) {
$configs[$resource->bundleClass] = $resource->data;
}
}
$merger = new ConfigurationMerger($this->bundles);
$mergedConfig = $merger->mergeConfiguration($configs);
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new ConfigurablePermissionConfiguration(),
$mergedConfig
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_search',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
if (!empty($resource->data[MappingConfiguration::ROOT_NODE])) {
$configs[] = $resource->data[MappingConfiguration::ROOT_NODE];
}
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new MappingConfiguration(),
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_query_designer',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
$config = $resource->data[Configuration::ROOT_NODE_NAME];
$vendor = strtolower(substr($resource->bundleClass, 0, strpos($resource->bundleClass, '\\')));
$this->updateLabelsOfFunctions($config, 'converters', $vendor);
$this->updateLabelsOfFunctions($config, 'aggregates', $vendor);
$configs[] = $config;
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
$this->configuration,
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_locale_name_format',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
$configs[] = $resource->data;
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new NameFormatConfiguration(),
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_locale_data',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
$configs[] = $resource->data;
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new LocaleDataConfiguration(),
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_locale_address_format',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
$configs[] = $resource->data;
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new AddressFormatConfiguration(),
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$resources = array_merge($this->loadThemeResources($resourcesContainer));
foreach ($resources as $resource) {
$configs[] = $this->getThemeConfig($resource);
}
$resources = $this->loadAdditionalResources($resourcesContainer);
foreach ($resources as $resource) {
$configs[] = $this->getAdditionalConfig($resource);
}
return CumulativeConfigProcessorUtil::processConfiguration(
'Resources/views/layouts/*/theme.yml',
$this->configuration,
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_integration_settings',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
if (!empty($resource->data[IntegrationConfiguration::ROOT_NODE])) {
$configs[] = $resource->data[IntegrationConfiguration::ROOT_NODE];
}
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new IntegrationConfiguration(),
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_help',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
if (\array_key_exists(HelpConfiguration::ROOT_NODE, $resource->data)) {
$configs[] = $resource->data[HelpConfiguration::ROOT_NODE];
}
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new HelpConfiguration(),
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_entity_extend',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
if (!empty($resource->data[EntityExtendConfiguration::ROOT_NODE])) {
$configs[] = $resource->data[EntityExtendConfiguration::ROOT_NODE];
}
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new EntityExtendConfiguration(),
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_entity',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
if (!empty($resource->data[EntityConfiguration::ROOT_NODE])) {
$configs[] = $resource->data[EntityConfiguration::ROOT_NODE];
}
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new EntityConfiguration(),
$configs
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$configs = [];
$configLoader = new CumulativeConfigLoader(
'oro_chart',
new YamlCumulativeFileLoader(self::CONFIG_FILE)
);
$resources = $configLoader->load($resourcesContainer);
foreach ($resources as $resource) {
if (!empty($resource->data[Configuration::ROOT_NODE_NAME])) {
$configs[] = $resource->data[Configuration::ROOT_NODE_NAME];
}
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new Configuration(),
[\array_replace_recursive(...$configs)]
);
}
/**
* @inheritdoc
*/
protected function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
{
$mergedConfig = [];
$rawConfigs = $this->getRawConfigs($resourcesContainer);
foreach ($rawConfigs as $sectionName => $configs) {
$merger = new ConfigurationMerger($this->bundles);
$mergedConfig[$sectionName] = $merger->mergeConfiguration(
$this->container->getParameterBag()->resolveValue($configs)
);
}
$this->checkConfiguration($mergedConfig);
if (empty($mergedConfig)) {
return [];
}
return CumulativeConfigProcessorUtil::processConfiguration(
self::CONFIG_FILE,
new Configuration(),
[$mergedConfig]
);
}