<commit_before>Keep your Symfony2 YAML config files organized
==============================================

[![Build Status](https://travis-ci.org/vworldat/C33sSymfonyConfigManipulatorBundle.svg)](https://travis-ci.org/vworldat/C33sSymfonyConfigManipulatorBundle)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/716c4317-aaf1-466c-90bf-48c3d98bf8c0/mini.png)](https://insight.sensiolabs.com/projects/716c4317-aaf1-466c-90bf-48c3d98bf8c0)

Do you hate stuffing tons of config into a single `config.yml` file, losing track of all the sections inside the file? Then this is for you!

This bundle provides some general-purpose YAML and Symfony config manipulation tasks. The most important one
is to split the Symfony `app/config/config*.yml` files into separate sections, leading to a structure like this:

```
# Symfony Standard Edition 2.7.3

app/config
├── config
│   ├── assetic.yml
│   ├── doctrine.yml
│   ├── framework.yml
│   ├── parameters.yml
│   ├── swiftmailer.yml
│   └── twig.yml
│
├── config_dev
│   ├── assetic.yml
│   ├── framework.yml
│   ├── monolog.yml
│   ├── swiftmailer.yml
│   └── web_profiler.yml
│
├── config_prod
│   ├── doctrine.yml
│   ├── framework.yml
│   └── monolog.yml
│
├── config_test
│   ├── framework.yml
│   ├── swiftmailer.yml
│   └── web_profiler.yml
│
├── config_dev.yml
├── config_prod.yml
├── config_test.yml
├── config.yml
│
│   # parameters.yml, routing.yml, security.yml etc. will never be touched
├── parameters.yml
├── parameters.yml.dist
├── routing_dev.yml
├── routing.yml
├── security.yml
└── services.yml
```

The cleaned up `config.yml` looks like this:

```yml
imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }
    - { resource: config/assetic.yml }
    - { resource: config/doctrine.yml }
    - { resource: config/framework.yml }
    - { resource: config/parameters.yml }
    - { resource: config/swiftmailer.yml }
    - { resource: config/twig.yml }
```

`config_dev.yml` content:

```yml
imports:
    - { resource: config.yml }
    - { resource: config_dev/assetic.yml }
    - { resource: config_dev/framework.yml }
    - { resource: config_dev/monolog.yml }
    - { resource: config_dev/swiftmailer.yml }
    - { resource: config_dev/web_profiler.yml }
```

### Advantages:

* Keep an overview which config modules are present by just looking at the sub folders
* By keeping separate files in your git repository, you may easily follow changes for specific config sections
* Working in larger teams becomes a little easier when the main `config.yml` isn't edited by several people at once
* *The configuration sections are copied as YAML text, not array data, so all your comments and formatting are preserved!*
* Manipulating specific config sections programmatically becomes a little easier

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

Require [`c33s/symfony-config-manipulator-bundle`](https://packagist.org/packages/c33s/symfony-config-manipulator-bundle) in your `composer.json` file:

```js
{
    "require": {
        "c33s/symfony-config-manipulator-bundle": "@stable",
    }
}
```

Register the bundle in `app/AppKernel.php`:

```php

    // app/AppKernel.php

    public function registerBundles()
    {<commit_msg>Added composer-yaml hint to README<commit_after>Keep your Symfony2 YAML config files organized
==============================================

[![Build Status](https://travis-ci.org/vworldat/C33sSymfonyConfigManipulatorBundle.svg)](https://travis-ci.org/vworldat/C33sSymfonyConfigManipulatorBundle)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/716c4317-aaf1-466c-90bf-48c3d98bf8c0/mini.png)](https://insight.sensiolabs.com/projects/716c4317-aaf1-466c-90bf-48c3d98bf8c0)

Do you hate stuffing tons of config into a single `config.yml` file, losing track of all the sections inside the file? Then this is for you!

This bundle provides some general-purpose YAML and Symfony config manipulation tasks. The most important one
is to split the Symfony `app/config/config*.yml` files into separate sections, leading to a structure like this:

```
# Symfony Standard Edition 2.7.3

app/config
├── config
│   ├── assetic.yml
│   ├── doctrine.yml
│   ├── framework.yml
│   ├── parameters.yml
│   ├── swiftmailer.yml
│   └── twig.yml
│
├── config_dev
│   ├── assetic.yml
│   ├── framework.yml
│   ├── monolog.yml
│   ├── swiftmailer.yml
│   └── web_profiler.yml
│
├── config_prod
│   ├── doctrine.yml
│   ├── framework.yml
│   └── monolog.yml
│
├── config_test
│   ├── framework.yml
│   ├── swiftmailer.yml
│   └── web_profiler.yml
│
├── config_dev.yml
├── config_prod.yml
├── config_test.yml
├── config.yml
│
│   # parameters.yml, routing.yml, security.yml etc. will never be touched
├── parameters.yml
├── parameters.yml.dist
├── routing_dev.yml
├── routing.yml
├── security.yml
└── services.yml
```

The cleaned up `config.yml` looks like this:

```yml
imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: services.yml }
    - { resource: config/assetic.yml }
    - { resource: config/doctrine.yml }
    - { resource: config/framework.yml }
    - { resource: config/parameters.yml }
    - { resource: config/swiftmailer.yml }
    - { resource: config/twig.yml }
```

`config_dev.yml` content:

```yml
imports:
    - { resource: config.yml }
    - { resource: config_dev/assetic.yml }
    - { resource: config_dev/framework.yml }
    - { resource: config_dev/monolog.yml }
    - { resource: config_dev/swiftmailer.yml }
    - { resource: config_dev/web_profiler.yml }
```

### Advantages:

* Keep an overview which config modules are present by just looking at the sub folders
* By keeping separate files in your git repository, you may easily follow changes for specific config sections
* Working in larger teams becomes a little easier when the main `config.yml` isn't edited by several people at once
* *The configuration sections are copied as YAML text, not array data, so all your comments and formatting are preserved!*
* Manipulating specific config sections programmatically becomes a little easier

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

Require [`c33s/symfony-config-manipulator-bundle`](https://packagist.org/packages/c33s/symfony-config-manipulator-bundle) in your `composer.json` file:

```js
{
    "require": {
        "c33s/symfony-config-manipulator-bundle": "@stable",
    }
}
```

or, if you are using ['composer-yaml'](https://packagist.org/packages/igorw/composer-yaml):

```yml
require:
    c33s/symfony-config-manipulator-bundle:     '@stable'
```

Register the bundle in `app/AppKernel.php`:

```php

    // app/AppKernel.php

    public function registerBundles()
    {
{'fraction_non_alphanumeric': 0.1503522710238345, 'fraction_numerical': 0.01648928196672163, 'mean_word_length': 3.824295010845987, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 11, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6451069', 'n_tokens_mistral': 2450, 'n_tokens_neox': 2276, 'n_words': 632}