UpdateChecker
in package
Table of Contents
- $endpoint : string
- $server : Server
- $updateInfo : UpdateInfo|null
- $logger : Logger
- __construct() : mixed
- checkUpdateCallback() : void
- Callback used at the end of the update checking task
- checkUpdateError() : void
- doCheck() : void
- Schedules an AsyncTask to check for an update.
- getChannel() : string
- Returns the channel used for update checking (stable, beta, dev)
- getEndpoint() : string
- Returns the host used for update checks.
- getUpdateInfo() : UpdateInfo|null
- Returns the last retrieved update data.
- hasUpdate() : bool
- Returns whether there is an update available.
- showConsoleUpdate() : void
- Posts a warning to the console to tell the user there is an update available
- checkUpdate() : void
- Checks the update information against the current server version to decide if there's an update
- printConsoleMessage() : void
- showChannelSuggestionBeta() : void
- showChannelSuggestionStable() : void
Properties
$endpoint
protected
string
$endpoint
$server
protected
Server
$server
$updateInfo
protected
UpdateInfo|null
$updateInfo
= null
$logger
private
Logger
$logger
Methods
__construct()
public
__construct(Server $server, string $endpoint) : mixed
Parameters
- $server : Server
- $endpoint : string
Return values
mixed —checkUpdateCallback()
Callback used at the end of the update checking task
public
checkUpdateCallback(UpdateInfo $updateInfo) : void
Parameters
- $updateInfo : UpdateInfo
Return values
void —checkUpdateError()
public
checkUpdateError(string $error) : void
Parameters
- $error : string
Return values
void —doCheck()
Schedules an AsyncTask to check for an update.
public
doCheck() : void
Return values
void —getChannel()
Returns the channel used for update checking (stable, beta, dev)
public
getChannel() : string
Return values
string —getEndpoint()
Returns the host used for update checks.
public
getEndpoint() : string
Return values
string —getUpdateInfo()
Returns the last retrieved update data.
public
getUpdateInfo() : UpdateInfo|null
Return values
UpdateInfo|null —hasUpdate()
Returns whether there is an update available.
public
hasUpdate() : bool
Return values
bool —showConsoleUpdate()
Posts a warning to the console to tell the user there is an update available
public
showConsoleUpdate() : void
Return values
void —checkUpdate()
Checks the update information against the current server version to decide if there's an update
protected
checkUpdate(UpdateInfo $updateInfo) : void
Parameters
- $updateInfo : UpdateInfo
Return values
void —printConsoleMessage()
protected
printConsoleMessage(array<string|int, string> $lines[, string $logLevel = LogLevel::INFO ]) : void
Parameters
- $lines : array<string|int, string>
- $logLevel : string = LogLevel::INFO
Return values
void —showChannelSuggestionBeta()
protected
showChannelSuggestionBeta() : void
Return values
void —showChannelSuggestionStable()
protected
showChannelSuggestionStable() : void