PHP Class Platformsh\Cli\SelfUpdate\ManifestStrategy

Inheritance: implements Humbug\SelfUpdate\Strategy\StrategyInterface
Datei anzeigen Open project: commerceguys/platform-cli Class Usage Examples

Public Methods

Method Description
__construct ( string $localVersion, string $manifestUrl, boolean $allowMajor = false, boolean $allowUnstable = false ) ManifestStrategy constructor.
download ( Humbug\SelfUpdate\Updater $updater )
getCurrentLocalVersion ( Humbug\SelfUpdate\Updater $updater )
getCurrentRemoteVersion ( Humbug\SelfUpdate\Updater $updater )
getUpdateNotes ( Humbug\SelfUpdate\Updater $updater ) : string | false Find update/upgrade notes for the new remote version.
setManifestTimeout ( integer $manifestTimeout )

Private Methods

Method Description
filterByLocalMajorVersion ( array $versions ) : string[] Filter a list of versions to those that match the current local version.
filterByPhpVersion ( array $versions ) : string[] Filter a list of versions to those that allow the current PHP version.
getAvailableVersions ( ) : array Get available versions to update to.
getManifest ( ) : array Download and decode the JSON manifest file.
getRemoteVersionInfo ( Humbug\SelfUpdate\Updater $updater ) : array Get version information for the latest remote version.

Method Details

__construct() public method

ManifestStrategy constructor.
public __construct ( string $localVersion, string $manifestUrl, boolean $allowMajor = false, boolean $allowUnstable = false )
$localVersion string The local version.
$manifestUrl string The URL to a JSON manifest file. The manifest contains an array of objects, each containing a 'version', 'sha1', and 'url'.
$allowMajor boolean Whether to allow updating between major versions.
$allowUnstable boolean Whether to allow updating to an unstable version. Ignored if $localVersion is unstable and there are no new stable versions.

download() public method

public download ( Humbug\SelfUpdate\Updater $updater )
$updater Humbug\SelfUpdate\Updater

getCurrentLocalVersion() public method

public getCurrentLocalVersion ( Humbug\SelfUpdate\Updater $updater )
$updater Humbug\SelfUpdate\Updater

getCurrentRemoteVersion() public method

public getCurrentRemoteVersion ( Humbug\SelfUpdate\Updater $updater )
$updater Humbug\SelfUpdate\Updater

getUpdateNotes() public method

Find update/upgrade notes for the new remote version.
public getUpdateNotes ( Humbug\SelfUpdate\Updater $updater ) : string | false
$updater Humbug\SelfUpdate\Updater
return string | false A string if notes are found, or false otherwise.

setManifestTimeout() public method

public setManifestTimeout ( integer $manifestTimeout )
$manifestTimeout integer