定制 funkjedi/composer-include-files 二次开发

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

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

funkjedi/composer-include-files

最新稳定版本:1.1.0

Composer 安装命令:

composer require funkjedi/composer-include-files

包简介

Include files at a higher priority than autoload files.

README 文档

README

When using the Composer Autoloader if you need project files included prior to files autoloaded by any of your dependencies your out of luck. No longer!

Installation

composer require funkjedi/composer-include-files

Usage

Just add the files you need included using "include_files" and they will be include prior to any files included by your dependencies.

// composer.json (project)
{
    "extra": {
        "include_files": [
            "/path/to/file/you/want/to/include",
            "/path/to/another/file/you/want/to/include"
        ]
    },
}

Specific Use Case

A good example of where this is required is when overriding helpers provided by Laravel.

In the past simply modifying bootstrap/autoload.php to include helpers was sufficient. However new versions of PHPUnit include the Composer Autoloader prior to executing the PHPUnit bootstrap file. Consequently this method of overriding helpers is no longer viable as it will trigger a fatal error when your bootstrap file is included.

But now we can use Composer - Include Files Plugin to have Composer include the files in the necessary order.

// composer.json (project)
{
    "require": {
        "laravel/framework": "^5.2",
        "funkjedi/composer-include-files": "^1.0",
    },
    "extra": {
        "include_files": [
            "app/helpers.php"
        ]
    },
}

统计信息

  • 总下载量: 3.13M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 128
  • 点击次数: 1
  • 依赖项目数: 19
  • 推荐数: 0

GitHub 信息

  • Stars: 126
  • Watchers: 7
  • Forks: 22
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-05