Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Command

kherge edited this page Aug 20, 2012 · 4 revisions

The Amend command provides a quick way of adding update and upgrade functionality to any Console application.

Table of Contents

Customizing

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.

$extract

<?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.

$integrity

The $integrity value is a callable used to verify the integrity of a temporarily downloaded file.

See getFile for more information.

$lock

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.

$match

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.

$rename

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.

$url

The $url value is the GitHUB API base url.

See setURL for more information.

Clone this wiki locally