labcoding/merge-module-config
Composer 安装命令:
composer require labcoding/merge-module-config
包简介
ZF2 module for automated merging config files in modules
README 文档
README
This module automated merging config files in modules.
All *.php files in ModuleName/config/autoload folder will be merged automatically.
If you have many "....config.php" files in one module, for sample:
- 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
<?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:
Application
- config
- module.config.php
- route.config.php
- service_manger.config.php
- controller.config.php
- ....
and some similar code in module.config.php file:
<?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:
<?php return array( 'view_manager' => array( 'template_path_stack' => array( __DIR__ . '/../view', ), ), );
and file structure config folder change to:
Application
- config
- autoload
- route.config.php
- service_manger.config.php
- controllers.config.php
- module.config.php
- autoload
- ....
Installation
Add this project in your composer.json:
"require": { "labcoding/merge-module-config": "~2.0.0" }
Now tell composer to download library by running the command:
$ php composer.phar update
OR
Run command in console
$ php composer.phar require "labcoding/merge-module-config"
Post installation
Enabling it in your application.config.phpfile.
<?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.
统计信息
- 总下载量: 94
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-01-30