本文整理汇总了PHP中Update::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Update::add方法的具体用法?PHP Update::add怎么用?PHP Update::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Update
的用法示例。
在下文中一共展示了Update::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_update_check
public function action_update_check()
{
// add an extra GUID, in addition to the one in our .xml file to pretend a theme was registered
Update::add('Test', '10cbaf18-bdd2-48e1-b0d3-e1853a4c649d', '3.0.2');
// add an extra GUID, in addition to the one in our .xml file to pretend a plugin was registered
Update::add('Test', '7a0313be-d8e3-11d1-8314-0800200c9a66', '0.9');
}
示例2: check
/**
* Perform a check of all beaconids.
* Notifies update_check plugin hooks when checking so that they can add their beaconids to the list.
* @return array An array of update beacon information for components that have updates
*/
public static function check()
{
try {
$instance = self::instance();
if (count($instance->beacons) == 0) {
Update::add('Habari', '7a0313be-d8e3-11db-8314-0800200c9a66', Version::get_habariversion());
Plugins::act('update_check');
}
$request = new RemoteRequest(UPDATE_URL, 'POST');
$request->set_params(array_map(create_function('$a', 'return $a["version"];'), $instance->beacons));
$request->set_timeout(10);
$result = $request->execute();
if (Error::is_error($result)) {
throw $result;
}
$updatedata = $request->get_response_body();
if (Error::is_error($updatedata)) {
throw $updatedata;
}
$instance->update = new SimpleXMLElement($updatedata);
foreach ($instance->update as $beacon) {
$beaconid = (string) $beacon['id'];
foreach ($beacon->update as $update) {
// Do we have this beacon? If not, don't process it.
if (empty($instance->beacons[$beaconid])) {
continue;
}
// If the remote update info version is newer...
if (version_compare($update['version'], $instance->beacons[$beaconid]['version']) > 0) {
// If this version is more recent than all other newer versions...
if (empty($instance->beacons[$beaconid]['latest_version']) || version_compare((string) $update['version'], $instance->beacons[$beaconid]['latest_version']) > 0) {
$instance->beacons[$beaconid]['latest_version'] = (string) $update['version'];
}
if (isset($instance->beacons[$beaconid]['severity'])) {
$instance->beacons[$beaconid]['severity'][] = (string) $update['severity'];
array_unique($instance->beacons[$beaconid]['severity']);
} else {
$instance->beacons[$beaconid]['severity'] = array((string) $update['severity']);
}
$instance->beacons[$beaconid]['url'] = (string) $beacon['url'];
$instance->beacons[$beaconid]['changes'][(string) $update['version']] = (string) $update;
}
}
}
return array_filter($instance->beacons, array('Update', 'filter_unchanged'));
} catch (Exception $e) {
return $e;
}
}
示例3: action_update_check
/**
* action: update_check
*
* @access public
* @return void
*/
public function action_update_check()
{
Update::add($this->info->name, $this->info->guid, $this->info->version);
}
示例4: action_update_check
function action_update_check()
{
Update::add('Lifestream', '122b28dc-0861-11dc-8314-0800200c9a66', self::VERSION);
}
示例5: action_update_check
public function action_update_check()
{
Update::add('hpm', '693E59D6-2B5F-11DD-A23A-9E6C56D89593', $this->info->version);
}
示例6: action_update_check
/**
* Enable update notices to be sent using the Habari beacon
*/
public function action_update_check()
{
Update::add('IncomingLinks', 'f33b2428-facb-43b7-bb44-a8d78cb3ff9d', $this->info->version);
}
示例7: action_update_check
/**
* Add update beacon support
**/
public function action_update_check()
{
Update::add('Syntax Highlighter', 'CD64FF02-B078-11DD-9AA2-3F8056D89593', $this->info->version);
}
示例8: action_update_check
function action_update_check()
{
Update::add('GetClicky Analytics', '5F271634-89B7-11DD-BE47-289255D89593', $this->info->version);
}
示例9: action_update_check
/**
* Add update beacon support
**/
public function action_update_check()
{
Update::add($this->info->name, '7cc973f3-dd6e-4081-98a3-535c7bf6e799', $this->info->version);
}
示例10: action_update_check
/**
* action: update_check
*
* @access public
* @return void
*/
public function action_update_check()
{
Update::add('Twitter Avatar', '3d327504-f01b-11dd-bd4c-001b210f913f', $this->info->version);
}
示例11: get_themes
/**
* Handles GET requests for the theme listing
*/
public function get_themes()
{
$all_themes = Themes::get_all_data();
foreach ($all_themes as $name => $theme) {
if (isset($all_themes[$name]['info']->update) && $all_themes[$name]['info']->update != '' && isset($all_themes[$name]['info']->version) && $all_themes[$name]['info']->version != '') {
Update::add($name, $all_themes[$name]['info']->update, $all_themes[$name]['info']->version);
}
}
$updates = Update::check();
foreach ($all_themes as $name => $theme) {
if (isset($all_themes[$name]['info']->update) && isset($updates[$all_themes[$name]['info']->update])) {
$all_themes[$name]['info']->update = $updates[$all_themes[$name]['info']->update]['latest_version'];
} else {
$all_themes[$name]['info']->update = '';
}
}
$this->theme->all_themes = $all_themes;
$this->theme->active_theme = Themes::get_active_data(true);
$this->theme->active_theme_dir = $this->theme->active_theme['path'];
// If the active theme is configurable, allow it to configure
$this->theme->active_theme_name = $this->theme->active_theme['info']->name;
$this->theme->configurable = Plugins::filter('theme_config', false, $this->active_theme);
$this->theme->assign('configure', Controller::get_var('configure'));
$activedata = Themes::get_active_data(true);
$areas = array();
if (isset($activedata['info']->areas->area)) {
foreach ($activedata['info']->areas->area as $area) {
$areas[] = (string) $area;
}
}
$this->theme->areas = $areas;
$this->theme->previewed = Themes::get_theme_dir(false);
$this->theme->blocks = Plugins::filter('block_list', array());
$this->theme->block_instances = DB::get_results('SELECT b.* FROM {blocks} b ORDER BY b.title ASC', array(), 'Block');
$blocks_areas_t = DB::get_results('SELECT b.*, ba.scope_id, ba.area, ba.display_order FROM {blocks} b INNER JOIN {blocks_areas} ba ON ba.block_id = b.id ORDER BY ba.scope_id ASC, ba.area ASC, ba.display_order ASC', array());
$blocks_areas = array();
foreach ($blocks_areas_t as $block) {
if (!isset($blocks_areas[$block->scope_id])) {
$blocks_areas[$block->scope_id] = array();
}
$blocks_areas[$block->scope_id][$block->area][$block->display_order] = $block;
}
$this->theme->blocks_areas = $blocks_areas;
$this->theme->scopes = DB::get_results('SELECT * FROM {scopes} ORDER BY id ASC;');
$this->theme->theme_loader = Plugins::filter('theme_loader', '', $this->theme);
$this->theme->display('themes');
}
示例12: action_update_check
/**
* Adds the plugin to the update check routine.
*/
public function action_update_check()
{
Update::add('StaticCache', '340fb135-e1a1-4351-a81c-dac2f1795169', self::VERSION);
}
示例13: action_update_check
/**
* Pro-forma update beacon support
**/
public function action_update_check()
{
Update::add('StatusNet', '8676A858-E4B1-11DD-9968-131C56D89593', $this->info->version);
}
示例14: action_update_check
/**
* Add update beacon support
**/
public function action_update_check()
{
Update::add('KeyNavigation', '', $this->info->version);
}
示例15: action_update_check
public function action_update_check()
{
Update::add($this->info->name, 'c7d47111-d452-4522-a343-f1d0df1d9095', $this->info->version);
}