Static Public Member Functions | Public Attributes | Static Protected Member Functions

Update Class Reference

Inheritance diagram for Update:
Collaboration diagram for Update:

List of all members.

Static Public Member Functions

static add ($name, $beaconid, $current_version)
static filter_unchanged ($beacon)
static check ()
static cron ($cronjob=null)
static check_plugins ()
static updates_available ($guid=null)

Public Attributes

const UPDATE_URL = 'https://beacon.habariproject.org/'

Static Protected Member Functions

static instance ()

Detailed Description

Habari Update class

Checks for updates to Habari and its libraries

public

Definition at line 16 of file update.php.


Member Function Documentation

static Update::add ( name,
beaconid,
current_version 
) [static]

Add a beaconid to the list of beaconids to version-check.

Parameters:
string $name the name of the component that will be checked
string $beaconid the id of the beacon to check
string $current_version the current version of the resource represented by this beaconid
Exceptions:
\Exception 
Returns:
bool

Definition at line 42 of file update.php.

static Update::check (  )  [static]

Perform a check of all beaconids. Notifies update_check plugin hooks when checking so that they can add their beaconids to the list.

Returns:
array An array of update beacon information for components that have updates
Exceptions:
\Exception 

Definition at line 82 of file update.php.

Referenced by cron().

static Update::check_plugins (  )  [static]

Compare the current set of plugins with those we last checked for updates. This is run by AdminHandler on every page load to make sure we always have fresh data on the dashboard.

Definition at line 277 of file update.php.

Referenced by AdminHandler::__construct().

static Update::cron ( cronjob = null  )  [static]

Endpoint for the update-check cronjob. Loads beacons, checks for updates from hp.o, and saves any updates to the DB.

Parameters:
null $cronjob Unused. The CronJob object being executed when being run as cron.
Returns:
boolean True on successful check, false on any failure (so cron runs again).

Definition at line 201 of file update.php.

static Update::filter_unchanged ( beacon  )  [static]

Return true if the beacon data contains updates from the server

Parameters:
array $beacon the beacon data from the $beacons array
Returns:
boolean true if there are updates available for this beacon

Definition at line 70 of file update.php.

static Update::instance (  )  [static, protected]

Enables singleton working properly

See also:
singleton.php

Reimplemented from Singleton.

Definition at line 28 of file update.php.

Referenced by add(), and check().

static Update::updates_available ( guid = null  )  [static]

Return all available updates, or the updates available for a single GUID.

Parameters:
string $guid A GUID to return available updates for.
Returns:
array Array of all available updates if no GUID is specified.
array A single GUID's updates, if GUID is specified and they are available.
bool false If a single GUID is specified and there are no updates available for it.

Definition at line 307 of file update.php.


The documentation for this class was generated from the following file: