diff --git a/docs/reference/Interfaces/ReleaseBundlerInterface.md b/docs/reference/Interfaces/ReleaseBundlerInterface.md new file mode 100644 index 0000000..54b51ef --- /dev/null +++ b/docs/reference/Interfaces/ReleaseBundlerInterface.md @@ -0,0 +1,23 @@ +# Libgossamer API Reference - ReleaseBundlerInterface + +* **Fully Qualified Interface Name**: `ParagonIE\Gossamer\Interfaces\ReleaseBundlerInterface` + +## Interface Methods + +### `setWorkDirectory()` + +Performs an HTTP GET request. + +**Arguments**: + +1. `string` - Directory path + +Returns this object that implements `ReleaseBundlerInterface`. + +### `bundle()` + +**Arguments**: + +1. `string` - Output file path + +Returns TRUE on success and FALSE on failure. diff --git a/docs/reference/README.md b/docs/reference/README.md index c7990bc..7a3c219 100644 --- a/docs/reference/README.md +++ b/docs/reference/README.md @@ -17,6 +17,7 @@ writing code that needs to use the library. * [HttpInterface](Interfaces/HttpInterface.md) * [LedgerInterface](Interfaces/LedgerInterface.md) * [LedgerVerifierInterface](Interfaces/LedgerVerifierInterface.md) + * [ReleaseBundlerInterface](Interfaces/ReleaseBundlerInterface.md) * [ScribeInterface](Interfaces/ScribeInterface.md) * [SourceInterface](Interfaces/SourceInterface.md) * [VerifierInterface](Interfaces/VerifierInterface.md) @@ -26,6 +27,12 @@ writing code that needs to use the library. * [Packet](Protocol/Packet.md) * [SignedMessage](Protocol/SignedMessage.md) * [Release](Release) + * [Bundler](Release/Bundler) + * [AbstractBundler](Release/Bundler/AbstractBundler.md) + * [GitDiffBundler](Release/Bundler/GitDiffBundler.md) + * [PharBundler](Release/Bundler/PharBundler.md) + * [TarBundler](Release/Bundler/TarBundler.md) + * [ZipBundler](Release/Bundler/ZipBundler.md) * [Common](Release/Common.md) * [Signer](Release/Signer.md) * [Verifier](Release/Verifier.md) @@ -35,7 +42,7 @@ writing code that needs to use the library. * [Chronicle](Source/Chronicle.md) * [Verifier](Verifier) * [Chronicle](Verifier/Chronicle.md) -* [GossamerException](GossmerException.md) +* [GossamerException](GossamerException.md) * [Response](Response.md) * [Synchronizer](Synchronizer.md) * [Util](Util.md) diff --git a/docs/reference/Release/Bundler/AbstractBundler.md b/docs/reference/Release/Bundler/AbstractBundler.md new file mode 100644 index 0000000..7a3ab4d --- /dev/null +++ b/docs/reference/Release/Bundler/AbstractBundler.md @@ -0,0 +1,15 @@ +# Libgossamer API Reference - Release - Bundler - AbstractBundler ([ReleaseBundlerInterface](../../Interfaces/ReleaseBundlerInterface.md)) + +* **Fully Qualified Class Name**: `ParagonIE\Gossamer\Release\Bundler\AbstractBundler` + +## Methods + +### `setWorkDirectory()` + +See [ReleaseBundlerInterface::setWorkDirectory()](../../Interfaces/ReleaseBundlerInterface.md#setworkdirectory). + +**Arguments**: + +1. `string` - Full path to a project's root directory + +Returns this object. diff --git a/docs/reference/Release/Bundler/GitDiffBundler.md b/docs/reference/Release/Bundler/GitDiffBundler.md new file mode 100644 index 0000000..38d0ec2 --- /dev/null +++ b/docs/reference/Release/Bundler/GitDiffBundler.md @@ -0,0 +1,31 @@ +# Libgossamer API Reference - Release - Bundler - GitDiffBundler + +* **Fully Qualified Class Name**: `ParagonIE\Gossamer\Release\Bundler\GitDiffBundler` + +This class inherits all methods from [AbstractBundler](AbstractBundler.md). + +## Methods + +### `setPreviousIdentifier()` + +Sets the git identifier (commit, branch, or tag) to be compared against. + +**Arguments**: + +1. `string` - Git identifier + +Returns this object. + +### `bundle()` + +See [ReleaseBundlerInterface::bundle()](../../Interfaces/ReleaseBundlerInterface.md#bundle). + +**Arguments**: + +1. `string` - Output file path +2. `string` - Current git identifier (default: `HEAD`) + +Returns TRUE on success and FALSE on failure. + +This creates a patch file (in `git diff` format) based on the changes between two git +identifiers (commits, branches, or tags). diff --git a/docs/reference/Release/Bundler/PharBundler.md b/docs/reference/Release/Bundler/PharBundler.md new file mode 100644 index 0000000..38839df --- /dev/null +++ b/docs/reference/Release/Bundler/PharBundler.md @@ -0,0 +1,31 @@ +# Libgossamer API Reference - Release - Bundler - PharBundler + +* **Fully Qualified Class Name**: `ParagonIE\Gossamer\Release\Bundler\PharBundler` + +This class inherits all methods from [AbstractBundler](AbstractBundler.md). + +## Methods + +### `setDefaultStubFilename()` + +Sets the filename for the default stub in the PHP Archive. + +**Arguments**: + +1. `string` - Filename (e.g. `index.php`) + +Returns this object. + +### `bundle()` + +See [ReleaseBundlerInterface::bundle()](../../Interfaces/ReleaseBundlerInterface.md#bundle). + +> **Warning**: This method cannot be called unless `phar.readonly = 0` in your php.ini configuration. + +**Arguments**: + +1. `string` - Output file path + +Returns TRUE on success and FALSE on failure. + +This creates a Phar archive at the destination output file. diff --git a/docs/reference/Release/Bundler/README.md b/docs/reference/Release/Bundler/README.md new file mode 100644 index 0000000..cd031d9 --- /dev/null +++ b/docs/reference/Release/Bundler/README.md @@ -0,0 +1,9 @@ +# Libgossamer API Reference - Release Bundlers + +The classes contained within facilitate the bundling of release deliverables. + +* [AbstractBundler](AbstractBundler.md) +* [GitDiffBundler](GitDiffBundler.md) +* [PharBundler](PharBundler.md) +* [TarBundler](TarBundler.md) +* [ZipBundler](ZipBundler.md) diff --git a/docs/reference/Release/Bundler/TarBundler.md b/docs/reference/Release/Bundler/TarBundler.md new file mode 100644 index 0000000..faeb2ef --- /dev/null +++ b/docs/reference/Release/Bundler/TarBundler.md @@ -0,0 +1,33 @@ +# Libgossamer API Reference - Release - Bundler - TarBundler + +* **Fully Qualified Class Name**: `ParagonIE\Gossamer\Release\Bundler\TarBundler` + +This class inherits all methods from [AbstractBundler](AbstractBundler.md). + +## Methods + +### `setCompression()` + +Toggle the type of compression to be used with this Tarball. + +**Arguments**: + +1. `string|null` - Compression type. Acceptable values: + * `NULL` - no compression + * `"gz"` - Gzip Compression + * `"bz2"` - Bzip2 Compression + * `"lzma2"` - LZMA 2 Compression + +Returns this object. + +### `bundle()` + +See [ReleaseBundlerInterface::bundle()](../../Interfaces/ReleaseBundlerInterface.md#bundle). + +**Arguments**: + +1. `string` - Output file path + +Returns TRUE on success and FALSE on failure. + +This creates a Tar archive at the destination output file. diff --git a/docs/reference/Release/Bundler/ZipBundler.md b/docs/reference/Release/Bundler/ZipBundler.md new file mode 100644 index 0000000..7900939 --- /dev/null +++ b/docs/reference/Release/Bundler/ZipBundler.md @@ -0,0 +1,19 @@ +# Libgossamer API Reference - Release - Bundler - ZipBundler + +* **Fully Qualified Class Name**: `ParagonIE\Gossamer\Release\Bundler\ZipBundler` + +This class inherits all methods from [AbstractBundler](AbstractBundler.md). + +## Methods + +### `bundle()` + +See [ReleaseBundlerInterface::bundle()](../../Interfaces/ReleaseBundlerInterface.md#bundle). + +**Arguments**: + +1. `string` - Output file path + +Returns TRUE on success and FALSE on failure. + +This creates a Zip archive at the destination output file. diff --git a/docs/reference/Release/README.md b/docs/reference/Release/README.md index 149833b..9cd1fb8 100644 --- a/docs/reference/Release/README.md +++ b/docs/reference/Release/README.md @@ -5,9 +5,12 @@ version releases for packages. ## Classes -* [Backends](../CryptoBackends) - * [SodiumBackend](../CryptoBackends/SodiumBackend.md) +* [Bundler](Bundler) + * [AbstractBundler](Bundler/AbstractBundler.md) + * [GitDiffBundler](Bundler/GitDiffBundler.md) + * [PharBundler](Bundler/PharBundler.md) + * [TarBundler](Bundler/TarBundler.md) + * [ZipBundler](Bundler/ZipBundler.md) * [Common](Common.md) -* [CryptoBakendInterface](../Interfaces/CryptoBackendInterface.md) * [Signer](Signer.md) * [Verifier](Verifier.md) diff --git a/docs/reference/TypeHelperTrait.md b/docs/reference/TypeHelperTrait.md new file mode 100644 index 0000000..d7c6db3 --- /dev/null +++ b/docs/reference/TypeHelperTrait.md @@ -0,0 +1,17 @@ +# Libgossamer API Reference - TypeHelperTrait + +* **Fully Qualified Trait Name**: `ParagonIE\Gossamer\TypeHelperTrait` + +## Methods + +### `assert()` + +Throw a condition if a statement is not true. + +**Arguments**: + +1. `bool` Statement +2. `string` Error message if statement is false +3. `class-string` Error/Exception class to instantiate + +Does not return a value, but will throw if the Statement is false (or falsy). diff --git a/lib/Release/Bundler/AbstractBundler.php b/lib/Release/Bundler/AbstractBundler.php index 1fa47f0..a4a8f99 100644 --- a/lib/Release/Bundler/AbstractBundler.php +++ b/lib/Release/Bundler/AbstractBundler.php @@ -10,7 +10,6 @@ abstract class AbstractBundler implements ReleaseBundlerInterface { use TypeHelperTrait; - /** @var string $directory */ protected $directory = '';