PHP Класс Habari\Update

Checks for updates to Habari and its libraries
Наследование: extends Singleton
Показать файл Открыть проект

Открытые методы

Метод Описание
add ( string $name, string $beaconid, string $current_version ) : boolean Add a beaconid to the list of beaconids to version-check.
check ( ) : array Perform a check of all beaconids.
check_plugins ( ) Compare the current set of plugins with those we last checked for updates.
cron ( null $cronjob = null ) : boolean Endpoint for the update-check cronjob.
filter_unchanged ( array $beacon ) : boolean Return true if the beacon data contains updates from the server
updates_available ( string $guid = null ) : boolean Return all available updates, or the updates available for a single GUID.

Защищенные методы

Метод Описание
instance ( ) Enables singleton working properly

Приватные методы

Метод Описание
add_plugins ( ) Loop through all the active plugins and add their information to the list of plugins to check for updates.
add_theme ( ) Add the currently active theme's information to the list of beacons to check for updates.
register_beacons ( ) Register beacons to check for updates.

Описание методов

add() публичный статический Метод

Add a beaconid to the list of beaconids to version-check.
public static add ( string $name, string $beaconid, string $current_version ) : boolean
$name string the name of the component that will be checked
$beaconid string the id of the beacon to check
$current_version string the current version of the resource represented by this beaconid
Результат boolean

check() публичный статический Метод

Notifies update_check plugin hooks when checking so that they can add their beaconids to the list.
public static check ( ) : array
Результат array An array of update beacon information for components that have updates

check_plugins() публичный статический Метод

This is run by AdminHandler on every page load to make sure we always have fresh data on the dashboard.
public static check_plugins ( )

cron() публичный статический Метод

Loads beacons, checks for updates from hp.o, and saves any updates to the DB.
public static cron ( null $cronjob = null ) : boolean
$cronjob null Unused. The CronJob object being executed when being run as cron.
Результат boolean True on successful check, false on any failure (so cron runs again).

filter_unchanged() публичный статический Метод

Return true if the beacon data contains updates from the server
public static filter_unchanged ( array $beacon ) : boolean
$beacon array the beacon data from the $beacons array
Результат boolean true if there are updates available for this beacon

instance() защищенный статический Метод

Enables singleton working properly
protected static instance ( )

updates_available() публичный статический Метод

Return all available updates, or the updates available for a single GUID.
public static updates_available ( string $guid = null ) : boolean
$guid string A GUID to return available updates for.
Результат boolean Array of all available updates if no GUID is specified.