PHP 클래스 Habari\Update

Checks for updates to Habari and its libraries
상속: extends Singleton
파일 보기 프로젝트 열기: habari/system

공개 메소드들

메소드 설명
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.