clue/phar-composer — pull request #15 by mikey179 (2013-10-26 22:47:06+00:00)
Title: Add support for excluding and including files, fixes #5

This pull request introduces the possibility to explicitly exclude or include additional files by defining them in the `composer.json` file. I decided to make use of the different bundler implementations and to enhance them, so the maintainer of a package has the choice to use the option which gives him less to configure:

Explicit and includes
---------------------------

The `Explicit` bundler already includes things that are explicitly defined in the `composer.json` file only: `bin`, and all files defined via `autoload`. Therefore it makes senses to be able to add some additional files or directories that should be included. For that, a new config option `extra.phar.includes` is introduced. This can be a single value or an array containing several values. The includes are passed to the `Explicit` bundler which than takes care of adding them.

Complete and excludes
--------------------------------

As the `Complete` bundler already adds everything in the package, it doesn't make sense to support additional includes. However, it is useful to be able to exclude certain files or directories. For that, a new config option `extra.phar.excludes` is introduced. This can be a single value or an array containing several values. The excludes are added to the already existing blacklist, so no additional code is required in the `Complete` bundler itself.

Some notes about the current state
-----------------------------------------------

In it's current state the pull request is more a proof of concept to be able to discuss whether this is the right direction to go. I didn't test this against real packages so far. Implementation wise I added some tests before I started work on the `Explicit` bundler as I wanted to refactor it first, so the new logic doesn't bloat the `bundle()` method. While doing so I noticed that the `Base` bundler is used for the `Explicit` bundler only- did you have some further ideas in mind when you split it in two classes? If not I would suggest merging these two classes into one, I can integrate this into the pull request.

I also noted that the whole documentation is currently in the `README.md` file, but it contains nothing about the different bundler options. Do you plan to have separate docs where this can be added or should it simply be added to this file?