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:
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.
Rewrote the
src/zfdeploy.php
file as an OOP class,ZF\Deploy\Deploy
. This class accepts a script name and aZend\Console\Adapter\AdapterInterface
as constructor arguments, and then exposes a facade,execute($args)
, for performing the work of the script.This affords several possibilities:
Zend\Console
adapters makes the script more portable across different OS environments.A few other changes were made:
buildFromIterator()
; this is far faster thanaddFile()
.