2017 © Pedro Peláez
 

library merge-module-config

ZF2 module for automated merging config files in modules

image

labcoding/merge-module-config

ZF2 module for automated merging config files in modules

  • Thursday, August 24, 2017
  • by labcoding
  • Repository
  • 0 Watchers
  • 0 Stars
  • 79 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

ZF2 MergeModuleConfig module

This module automated merging config files in modules. All *.php files in ModuleName/config/autoload folder will be merged automatically., (*1)

If you have many "....config.php" files in one module, for sample:, (*2)

    - route.config.php
    - service_manger.config.php
    - controller.config.php

Marge Module Config merged all files in config/autoload folder, and you don't need to write some like this, (*3)

<?php
    return array(
       'sebaks-view' => require_once 'sebaks-view.config.php',
       'router' => require_once 'router.config.php',
       'controllers' => require_once "controllers.config.php",
    );

Problem

You have some similar file structure:, (*4)

Application - config - module.config.php - route.config.php - service_manger.config.php - controller.config.php - ...., (*5)

and some similar code in module.config.php file:, (*6)

<?php
    return array(
        'sebaks-view' => require_once 'sebaks-view.config.php',
        'router' => require_once 'router.config.php',

       'view_manager' => array(
            'template_path_stack' => array(
                __DIR__ . '/../view',
            ),
        ),
    );

Solution

After including LabCoding\MergeModuleConfig your code in module.config.php file will look like:, (*7)

<?php
    return array(
          'view_manager' => array(
            'template_path_stack' => array(
                __DIR__ . '/../view',
            ),
        ),
    );

and file structure config folder change to:, (*8)

Application - config - autoload - route.config.php - service_manger.config.php - controllers.config.php - module.config.php - ...., (*9)

Installation

Add this project in your composer.json:, (*10)

"require": {
    "labcoding/merge-module-config": "~2.0.0"
}

Now tell composer to download library by running the command:, (*11)

$ php composer.phar update

OR, (*12)

Run command in console, (*13)

$ php composer.phar require "labcoding/merge-module-config"

Post installation

Enabling it in your application.config.phpfile., (*14)

<?php
    return array(
        'modules' => array(
            // ...
            'LabCoding\MergeModuleConfig',
        ),
        // ...
    );

Add config/autoload folder and place it in the configuration files. All *.php files in ModuleName/config/autoload folder will be merged automatically., (*15)

The Versions

24/08 2017

dev-master

9999999-dev https://github.com/labcoding/MergeModuleConfig

ZF2 module for automated merging config files in modules

  Sources   Download

MIT

The Requires

 

by D Bogdanovich

merge zf2 merge config files merge module config

08/04 2017

2.0

2.0.0.0 https://github.com/labcoding/MergeModuleConfig

ZF2 module for automated merging config files in modules

  Sources   Download

MIT

The Requires

 

by D Bogdanovich

merge zf2 merge config files merge module config

17/02 2017

1.0.1

1.0.1.0 https://github.com/labcoding/MergeModuleConfig

ZF2 module for automated merging config files in modules

  Sources   Download

MIT

The Requires

 

by D Bogdanovich

merge zf2 merge config files merge module config

01/02 2017

1.0.0

1.0.0.0 https://github.com/labcoding/MergeModuleConfig

ZF2 module for automated merging config files in modules

  Sources   Download

MIT

The Requires

 

by D Bogdanovich

merge zf2 merge config files merge module config

30/01 2017

0.0.2

0.0.2.0 https://github.com/labcoding/MergeModuleConfig

ZF2 module for automated merging config files in modules

  Sources   Download

MIT

The Requires

 

by D Bogdanovich

merge zf2 merge config files merge module config

30/01 2017

0.0.1

0.0.1.0 https://github.com/labcoding/MergeModuleConfig

ZF2 module for automated merging config files in modules

  Sources   Download

MIT

The Requires

 

by D Bogdanovich

merge zf2 merge config files merge module config