PHP Class Airship\Engine\Continuum\AutoUpdater

The base class for the auto-updaters.
Inheritance: use trait LogBolt
Afficher le fichier Open project: paragonie/airship

Protected Properties

Свойство Type Description
$bypassSecurityAndJustInstall boolean
$channels Channel[]
$continuumLogger Log
$ext string
$filePath string
$hail Hail
$localUpdateFile UpdateFile
$manifest array
$name string
$pharAlias string
$supplier Supplier
$type string

Méthodes publiques

Méthode Description
bypassSecurityAndJustInstall ( boolean $set = false ) : self This is for manual installations and update scripts. It should never be invoked automatically.
checkKeyggdrasil ( UpdateInfo $info, UpdateFile $file ) : boolean Was the checksum of this update stored in Keyggdrasil?
downloadUpdateFile ( UpdateInfo $update, string $apiEndpoint = 'download' ) : UpdateFile Download an update into a temp file
manualUpdate ( string $desiredVersion ) : boolean Process manual updates:
updateCheck ( string $supplier = '', string $packageName = '', string $minVersion = '', string $apiEndpoint = 'version' ) : array Are any updates available?
updateDBRecord ( string $type, UpdateInfo $info ) : boolean Update the version string in airship_package_cache
useLocalUpdateFile ( string $path, string $version = '' ) : self For CLI usage: Bypass the download process, use a local file instead.
verifyUpdateSignature ( UpdateInfo $info, UpdateFile $file ) : boolean Verify the Ed25519 signature of the update file against the supplier's public key.

Méthodes protégées

Méthode Description
autoRunScript ( array $autoRun ) : mixed Automatic script execution
bringSiteBackUp ( ) After we finish our update, we should bring the site back online:
bringSiteDown ( ) Let's bring the site down while we're upgrading:
checkVersionSettings ( UpdateInfo $info, string $currentVersion ) : boolean Should this automatic update be permitted?
getChannel ( string $name ) : Channel Get the channels
getLogContext ( UpdateInfo $updateInfo, UpdateFile $updateFile ) : array Get information for logging purposes
install ( UpdateInfo $info, UpdateFile $file ) This is the method that actually does the installation
sortUpdatesByVersion ( variadic $updates ) : array Sort updates by version (newest to latest)

Method Details

autoRunScript() protected méthode

Automatic script execution
protected autoRunScript ( array $autoRun ) : mixed
$autoRun array
Résultat mixed

bringSiteBackUp() protected méthode

After we finish our update, we should bring the site back online:
protected bringSiteBackUp ( )

bringSiteDown() protected méthode

Let's bring the site down while we're upgrading:
protected bringSiteDown ( )

bypassSecurityAndJustInstall() public méthode

This is for manual installations and update scripts. It should never be invoked automatically.
public bypassSecurityAndJustInstall ( boolean $set = false ) : self
$set boolean
Résultat self

checkKeyggdrasil() public méthode

Dear future security auditors: This is important.
public checkKeyggdrasil ( UpdateInfo $info, UpdateFile $file ) : boolean
$info UpdateInfo
$file UpdateFile
Résultat boolean

checkVersionSettings() protected méthode

Should this automatic update be permitted?
protected checkVersionSettings ( UpdateInfo $info, string $currentVersion ) : boolean
$info UpdateInfo
$currentVersion string
Résultat boolean

downloadUpdateFile() public méthode

Download an update into a temp file
public downloadUpdateFile ( UpdateInfo $update, string $apiEndpoint = 'download' ) : UpdateFile
$update UpdateInfo
$apiEndpoint string
Résultat UpdateFile

getChannel() protected méthode

Get the channels
protected getChannel ( string $name ) : Channel
$name string
Résultat Channel

getLogContext() protected méthode

Get information for logging purposes
protected getLogContext ( UpdateInfo $updateInfo, UpdateFile $updateFile ) : array
$updateInfo UpdateInfo
$updateFile UpdateFile
Résultat array

install() abstract protected méthode

This is the method that actually does the installation
abstract protected install ( UpdateInfo $info, UpdateFile $file )
$info UpdateInfo
$file UpdateFile

manualUpdate() public méthode

1. Check if a new update is available. 2. Download the upload file, store in a temporary file. 3. Verify the signature (via Halite). 4. Verify the update is recorded in Keyggdrasil. 5. If all is well, run the update script.
public manualUpdate ( string $desiredVersion ) : boolean
$desiredVersion string
Résultat boolean

sortUpdatesByVersion() protected méthode

Sort updates by version (newest to latest)
protected sortUpdatesByVersion ( variadic $updates ) : array
$updates variadic
Résultat array

updateCheck() public méthode

Are any updates available?
public updateCheck ( string $supplier = '', string $packageName = '', string $minVersion = '', string $apiEndpoint = 'version' ) : array
$supplier string
$packageName string
$minVersion string
$apiEndpoint string
Résultat array

updateDBRecord() public méthode

Update the version string in airship_package_cache
public updateDBRecord ( string $type, UpdateInfo $info ) : boolean
$type string
$info UpdateInfo
Résultat boolean

useLocalUpdateFile() public méthode

For CLI usage: Bypass the download process, use a local file instead.
public useLocalUpdateFile ( string $path, string $version = '' ) : self
$path string
$version string
Résultat self

verifyUpdateSignature() public méthode

Dear future security auditors: This is important.
public verifyUpdateSignature ( UpdateInfo $info, UpdateFile $file ) : boolean
$info UpdateInfo
$file UpdateFile
Résultat boolean

Property Details

$bypassSecurityAndJustInstall protected_oe property

protected bool $bypassSecurityAndJustInstall
Résultat boolean

$channels protected_oe static_oe property

protected static Channel[],Airship\Engine\Continuum $channels
Résultat Channel[]

$continuumLogger protected_oe static_oe property

protected static Log,Airship\Engine\Continuum $continuumLogger
Résultat Log

$ext protected_oe property

protected string $ext
Résultat string

$filePath protected_oe property

protected string $filePath
Résultat string

$hail protected_oe property

protected Hail $hail
Résultat Hail

$localUpdateFile protected_oe property

protected UpdateFile $localUpdateFile
Résultat UpdateFile

$manifest protected_oe property

protected array $manifest
Résultat array

$name protected_oe property

protected string $name
Résultat string

$pharAlias protected_oe property

protected string $pharAlias
Résultat string

$supplier protected_oe property

protected Supplier,Airship\Engine\Continuum $supplier
Résultat Supplier

$type protected_oe property

protected string $type
Résultat string