LimeSurvey API - Master branch

ExtensionUpdater
in package

AbstractYes
Tags
since
2018-09-26
author

LimeSurvey GmbH

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
todo

Create interface ExtensionModelInterface that all extension model classes implement

$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
string

createUpdaters()

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
todo

Move to parent class?

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
bool

getCurrentVersion()

Returns currently installed version of this extension

public abstract getCurrentVersion() : string
Return values
string

getExtensionName()

Fetch extension name from extension model.

public abstract getExtensionName() : string

Extension type specific implementation.

Return values
string

getExtensionType()

Fetch extension type from extension model.

public abstract getExtensionType() : string

Extension type specific implementation.

Return values
string

getLatestVersion()

public getLatestVersion(array<string|int, mixed> $versions) : array<string|int, mixed>|null
Parameters
$versions : array<string|int, mixed>
Return values
array<string|int, mixed>|null

getVersionMessage()

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
string

implodeVersions()

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
string

versionHigherThan()

Returns true if $newVersion is strictly higher than currently installed version

public versionHigherThan(string $newVersion) : bool
Parameters
$newVersion : string
Return values
bool

versionIsStable()

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
Return values
bool

        
On this page

Search results