Programming Language PHP

Namespace Oro\Component\Config\Loader

Class CumulativeConfigProcessorUtil

Total Examples 15

15 code examples of PHP Oro\Component\Config\Loader\CumulativeConfigProcessorUtil extracted from open source projects

Was this example useful?
0
                                                    /**
     * @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]
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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)]
        );
    }
                                            
Was this example useful?
0
                                                    /**
     * @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]
        );
    }
                                            
CumulativeConfigProcessorUtil's Other Methods
CumulativeConfigProcessorUtil's Other Methods