PHP Class Platformsh\Cli\SelfUpdate\ManifestStrategy

Inheritance: implements Humbug\SelfUpdate\Strategy\StrategyInterface
Afficher le fichier Open project: commerceguys/platform-cli Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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 méthode

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

getCurrentLocalVersion() public méthode

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

getCurrentRemoteVersion() public méthode

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

getUpdateNotes() public méthode

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

setManifestTimeout() public méthode

public setManifestTimeout ( integer $manifestTimeout )
$manifestTimeout integer