You are browsing upcoming documentation for version 6.0 of OroCommerce, OroCRM, and OroPlatform, scheduled for release in 2024. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

Resources Loader Factory

This class provides methods for creating an instance of CumulativeConfigLoader, which allows you to load configuration files from any bundle or application level.


Resources Loader Factory provides the CumulativeConfigLoaderFactory::create('acme_data' and  'Resources/config/oro/acme.yml') method.

This method prepares an instance of CumulativeConfigLoader with configured configuration loaders. Under the hood, the factory transforms the incoming path to configuration files with the ability to load configs from the application layer.

 CumulativeConfigLoaderFactory::create('acme_data', 'Resources/config/oro/acme.yml')

 It should be load configuration from:

     # Load configuration from all bundles
     # Load configuration from application-level

Usage Example

The following example shows how to create a new CumulativeConfigLoader instance using the CumulativeConfigLoaderFactory::create('acme_data', 'Resources/config/oro/acme.yml') static factory method on a simple configuration provider:

namespace Oro\Bundle\AcmeBundle\Configuration;

use Oro\Component\Config\Cache\PhpArrayConfigProvider;
use Oro\Component\Config\Loader\CumulativeConfigProcessorUtil;
use Oro\Component\Config\Loader\Factory\CumulativeConfigLoaderFactory;
use Oro\Component\Config\ResourcesContainerInterface;

class AcmeConfigurationProvider extends PhpArrayConfigProvider
     protected const CONFIG_FILE = 'Resources/config/oro/acme.yml';

     public function doLoadConfig(ResourcesContainerInterface $resourcesContainer)
         $acmeConfig = [];
         /** @var CumulativeConfigLoader $configLoader */
         $configLoader = CumulativeConfigLoaderFactory::create('acme_data', self::CONFIG_FILE);
         $resources = $configLoader->load($resourcesContainer);
         foreach ($resources as $resource) {
              $acmeConfig[] = $resource->data;

         return CumulativeConfigProcessorUtil::processConfiguration(
             new LocaleDataConfiguration(),