当前位置: 首页>>代码示例>>PHP>>正文


PHP Update::add方法代码示例

本文整理汇总了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');
 }
开发者ID:habari-extras,项目名称:beacontest,代码行数:7,代码来源:beacontest.plugin.php

示例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;
     }
 }
开发者ID:anupom,项目名称:my-blog,代码行数:54,代码来源:update.php

示例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);
 }
开发者ID:habari-extras,项目名称:amazon,代码行数:10,代码来源:amazon.plugin.php

示例4: action_update_check

 function action_update_check()
 {
     Update::add('Lifestream', '122b28dc-0861-11dc-8314-0800200c9a66', self::VERSION);
 }
开发者ID:habari-extras,项目名称:lifestream,代码行数:4,代码来源:lifestream.plugin.php

示例5: action_update_check

 public function action_update_check()
 {
     Update::add('hpm', '693E59D6-2B5F-11DD-A23A-9E6C56D89593', $this->info->version);
 }
开发者ID:habari-extras,项目名称:hpm,代码行数:4,代码来源:hpm.plugin.php

示例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);
 }
开发者ID:anupom,项目名称:my-blog,代码行数:7,代码来源:incoming_links.plugin.php

示例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);
 }
开发者ID:habari-extras,项目名称:syntaxhighlighter,代码行数:7,代码来源:syntax.plugin.php

示例8: action_update_check

 function action_update_check()
 {
     Update::add('GetClicky Analytics', '5F271634-89B7-11DD-BE47-289255D89593', $this->info->version);
 }
开发者ID:habari-extras,项目名称:getclicky,代码行数:4,代码来源:getclicky.plugin.php

示例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);
 }
开发者ID:habari-extras,项目名称:tagrewriter,代码行数:7,代码来源:tagrewriter.plugin.php

示例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);
 }
开发者ID:habari-extras,项目名称:twitter_avatar,代码行数:10,代码来源:twitter_avatar.plugin.php

示例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');
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:50,代码来源:adminhandler.php

示例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);
 }
开发者ID:habari-extras,项目名称:staticcache,代码行数:7,代码来源:staticcache.plugin.php

示例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);
 }
开发者ID:habari-extras,项目名称:statusnet,代码行数:7,代码来源:statusnet.plugin.php

示例14: action_update_check

 /**
  * Add update beacon support
  **/
 public function action_update_check()
 {
     Update::add('KeyNavigation', '', $this->info->version);
 }
开发者ID:habari-extras,项目名称:key_navigation,代码行数:7,代码来源:key_navigation.plugin.php

示例15: action_update_check

 public function action_update_check()
 {
     Update::add($this->info->name, 'c7d47111-d452-4522-a343-f1d0df1d9095', $this->info->version);
 }
开发者ID:habari-extras,项目名称:freeplace,代码行数:4,代码来源:freeplace.plugin.php


注:本文中的Update::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。