定制 labcoding/merge-module-config 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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
  • ....

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固