PHPackages                             wemakecustom/directory-loader-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wemakecustom/directory-loader-bundle

AbandonedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

wemakecustom/directory-loader-bundle
====================================

Symfony DirectoryLoaderBundle to recursively import directories of configuration

v1.0(10y ago)18731MITPHPPHP &gt;=5.3.2

Since Feb 18Pushed 10y ago4 watchersCompare

[ Source](https://github.com/wemakecustom/DirectoryLoaderBundle)[ Packagist](https://packagist.org/packages/wemakecustom/directory-loader-bundle)[ Docs](http://github.com/wemakecustom/DirectoryLoaderBundle)[ RSS](/packages/wemakecustom-directory-loader-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Symfony Directory Loader
========================

[](#symfony-directory-loader)

Recursively import directories of configuration.

This works for your main configuration files and the router.

See

Since [symfony/symfony#14700](https://github.com/symfony/symfony/pull/14700) has been merged (Symfony 2.8+), the directory loader is included by default in Symfony. The documentation is kept here however for reference purposes.

Please refer to [http://symfony.com/doc/current/cookbook/configuration/configuration\_organization.html](http://symfony.com/doc/current/cookbook/configuration/configuration_organization.html) for further use-cases of the DirectoryLoader.

Installation
------------

[](#installation)

Add the following in your root composer.json file:

```
{
    "require": {
        "wemakecustom/directory-loader-bundle": "^1.0"
    },
}
```

And modify your `app/AppKernel.php`:

```

```

Strictly speaking, registering the Bundle is only necessary if you want the fonctionnality in the routing files and overloading the ContainerLoader is only necessary for the main configuration files, but you do what you want.

Usage
-----

[](#usage)

The main goal of this bundle is to drop configuration files in folder without modifying the main `config.yml`. This way, each file can group all (and only) the configuration related to a specific bundle.

### Using a directory based on the environment

[](#using-a-directory-based-on-the-environment)

Instead of using `config_ENV.yml`, one may use a directory for each environment.

For example:

```
└── app
   ├── config
   │  ├── common
   │  │  └── assetic.yml
   │  │  └── framework.yml
   │  │  └── security.yml
   │  ├── dev
   │  │  └── framework.yml
   │  │  └── assetic.yml
   │  ├── prod
   │  │  └── assetic.yml
   │  │  └── google_analytics.yml
   │  ├── config.yml
   │  └── parameters.yml
   └── AppKernel.php

```

```
