2017 © Pedro Peláez
 

composer-plugin composer-include-files

Include files at a higher priority than autoload files.

image

funkjedi/composer-include-files

Include files at a higher priority than autoload files.

  • Friday, March 2, 2018
  • by funkjedi
  • Repository
  • 5 Watchers
  • 35 Stars
  • 55,686 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 2 Versions
  • 20 % Grown

The README.md

Composer - Include Files Plugin

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!, (*1)

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., (*2)

// 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., (*3)

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., (*4)

But now we can use Composer - Include Files Plugin to have Composer include the files in the necessary order., (*5)

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

The Versions

02/03 2018

dev-master

9999999-dev https://github.com/funkjedi/composer-include-files

Include files at a higher priority than autoload files.

  Sources   Download

MIT

The Requires

  • composer-plugin-api ^1.0

 

by Tim Robertson

composer autoload

23/12 2016

1.0.0

1.0.0.0 https://github.com/funkjedi/composer-include-files

Include files at a higher priority than autoload files.

  Sources   Download

MIT

The Requires

  • composer-plugin-api ^1.0

 

by Tim Robertson

composer autoload