zfcampus/zf-deploy — pull request #7 by weierophinney (2014-04-18 13:57:29+00:00)
Title: Rewrite to use OOP

Rewrote the `src/zfdeploy.php` file as an OOP class, `ZF\Deploy\Deploy`. This class accepts a script name and a `Zend\Console\Adapter\AdapterInterface` as constructor arguments, and then exposes a facade, `execute($args)`, for performing the work of the script.

This affords several possibilities:

- We can now start adding actual unit tests. Most methods are protected, but we can either make them public or use reflection to test them.
- Using `Zend\Console` adapters makes the script more portable across different OS environments.
- Users can extend the class in order to alter behavior, or compose it in order to create custom workflows with other toolchains.

A few other changes were made:

- Fixed the `box.json` to include the `config/` directory -- which is necessary for creating ZPK files!
- Modified the logic for creating tar/tgz/tar.gz files to use `buildFromIterator()`; this is far faster than `addFile()`.
- All option validation was moved into Getopt option callbacks.