Download the PHP package hnhdigital-os/laravel-console-self-update without Composer
On this page you can find all versions of the php package hnhdigital-os/laravel-console-self-update. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hnhdigital-os/laravel-console-self-update
More information about hnhdigital-os/laravel-console-self-update
Files in hnhdigital-os/laravel-console-self-update
Package laravel-console-self-update
Short Description Provides a trait to use to self-update console binary.
License MIT
Informations about the package laravel-console-self-update
Provides a trait to provide self-updating for Laravel Zero console applications.
This package has been developed by H&H|Digital, an Australian botique developer. Visit us at hnh.digital.
Requirements
- PHP 7.1.3
- Laravel Zero 5.7
Installation
composer require hnhdigital-os/laravel-console-self-update
Implementation
This package is implemented through a trait and an interface (for the constants).
The basic implementation requires setting a base URL setUrl
or providing a flysystem adapter setFlysystem
before calling the runSelfUpdate
method.
Binary versioning is implemented using BRANCH-TAG (eg stable-1.00) but will fallback to TAG (1.0.0) for the more common Laravel Zero version approach.
Latest version
The script checks /latest
for the latest tag (eg it would contain 1.0.1).
Download path to binary
The download path for a specific binary version is sourced from a JSON encoded values sourced from /versions
(default). You can override that by using setVersionsPath
.
By default, the versions file is tag/path. If the versions file contains more than the path, the default path source can be overridden to a specific key using setVersionsTagKey
.
For example:
Hash comparing
The downloaded file is hash checked (SHA256). This hash string by default is found in the same path as the download file path (download/1.0.1/sha256).
You can change the default source by overriding the setHashSource
method and returning a different constant.
If there is a top level json encoded file storing the hashes, set the source to CHECKSUM_TOP_LEVEL
. Specify the file path by using setHashPath
.
NOTE: This array is keyed to the download path discovered through the versions file. It must match to be able to retrieve the hash.
If the hash is included in the versions file, set the source to CHECKSUM_VERSIONS
. Specify the array key using setHashPath
.
Build scripts
Looking for a build script to help create all the necessary files?
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.