-
Notifications
You must be signed in to change notification settings - Fork 5
Command
The Amend command provides a quick way of adding update and upgrade functionality to any Console application.
The command will not function unless you create your own class extending KevinGH\Amend\Command
. This is required in order for you to set the class property values needed, as well as the actual name of the command.
<?php $this->extract = '/^name\-(.+?)\.phar$/';
The $extract
value is a regular expression used to match on the download's file name and extract the version number contained within.
The command will create a closure using the set regular expression to extract a version number from the name of a download file. The download name is acquired through the helper's getDownloads
method.
The $integrity
value is a callable used to verify the integrity of a temporarily downloaded file.
See getFile
for more information.
The $lock
value is a boolean value used lock a downloads to the current major version.
See setLock
for more information. By default, this value is null
. If set, it will override the user's request to upgrade to the next major version.
The $match
value is a regular expression used to filter out downloads with a name that are irrelevant.
The command will create a closure using the set regular expression to match the name of a download file. It is used by the helper's getDownloads
method.
The $rename
value is the name of the temporary file that is downloaded.
The new name is used by getFile
for the temporary file's name, instead of the default one specified by the download itself. This is useful if the file name has a strict convention.
The $url
value is the GitHUB API base url.
See setURL
for more information.