ExtensionUpdater
in package
Tags
Table of Contents
Properties
- $model : mixed
- Extension model, e.g. Theme or Plugin class.
- $useStable : bool
- If true, fetch stable version info.
- $useUnstable : bool
- If true, fetch unstable version info.
Methods
- __construct() : mixed
- convertExtensionType() : string
- Convert from single char $type to fullword.
- createUpdaters() : array<string|int, mixed>
- Create an updater object for every extension of corresponding type.
- fetchVersions() : array<string|int, mixed>
- Fetch all new available version from each version fetcher.
- foundSecurityVersion() : bool
- Returns true if $versions contain a security version.
- getCurrentVersion() : string
- Returns currently installed version of this extension
- getExtensionConfig() : ExtensionConfig
- Get extension config object for this extension.
- getExtensionName() : string
- Fetch extension name from extension model.
- getExtensionType() : string
- Fetch extension type from extension model.
- getLatestVersion() : array<string|int, mixed>|null
- getVersionMessage() : string
- Compose version message to display of $versions.
- implodeVersions() : string
- Implode $versions into string, stripping security version field.
- setUseUnstable() : void
- versionHigherThan() : bool
- Returns true if $newVersion is strictly higher than currently installed version
- versionIsStable() : bool
- Returns true if $version is stable.
Properties
$model
Extension model, e.g. Theme or Plugin class.
protected
mixed
$model
= null
Tags
$useStable
If true, fetch stable version info.
protected
bool
$useStable
= true
$useUnstable
If true, fetch unstable version info.
protected
bool
$useUnstable
= false
Methods
__construct()
public
__construct(mixed $model) : mixed
Parameters
- $model : mixed
-
Plugin model, theme model, etc, depending on extension type.
convertExtensionType()
Convert from single char $type to fullword.
public
convertExtensionType(string $type) : string
Parameters
- $type : string
Return values
stringcreateUpdaters()
Create an updater object for every extension of corresponding type.
public
abstract static createUpdaters() : array<string|int, mixed>
Return values
array<string|int, mixed> —[ExtensionUpdater[] $updaters, string[] $errorMessages]
fetchVersions()
Fetch all new available version from each version fetcher.
public
fetchVersions() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —$versions
foundSecurityVersion()
Returns true if $versions contain a security version.
public
foundSecurityVersion(array<string|int, mixed> $versions) : bool
Parameters
- $versions : array<string|int, mixed>
-
Each version has keys 'version' and 'isSecurityVersion'.
Return values
boolgetCurrentVersion()
Returns currently installed version of this extension
public
abstract getCurrentVersion() : string
Return values
stringgetExtensionConfig()
Get extension config object for this extension.
public
abstract getExtensionConfig() : ExtensionConfig
Return values
ExtensionConfiggetExtensionName()
Fetch extension name from extension model.
public
abstract getExtensionName() : string
Extension type specific implementation.
Return values
stringgetExtensionType()
Fetch extension type from extension model.
public
abstract getExtensionType() : string
Extension type specific implementation.
Return values
stringgetLatestVersion()
public
getLatestVersion(array<string|int, mixed> $versions) : array<string|int, mixed>|null
Parameters
- $versions : array<string|int, mixed>
Return values
array<string|int, mixed>|nullgetVersionMessage()
Compose version message to display of $versions.
public
getVersionMessage(array<string|int, mixed> $versions) : string
Parameters
- $versions : array<string|int, mixed>
-
Each version has keys 'version' and 'isSecurityVersion', etc.
Return values
stringimplodeVersions()
Implode $versions into string, stripping security version field.
public
implodeVersions(array<string|int, mixed> $versions) : string
Parameters
- $versions : array<string|int, mixed>
-
Each version has keys 'version' and 'isSecurityVersion'.
Return values
stringsetUseUnstable()
public
setUseUnstable() : void
versionHigherThan()
Returns true if $newVersion is strictly higher than currently installed version
public
versionHigherThan(string $newVersion) : bool
Parameters
- $newVersion : string
Return values
boolversionIsStable()
Returns true if $version is stable.
public
versionIsStable(string $version) : bool
The version is stable IF it does not contain alpha, beta or rc suffixes.
Parameters
- $version : string