當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Fx::version方法代碼示例

本文整理匯總了PHP中Floxim\Floxim\System\Fx::version方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fx::version方法的具體用法?PHP Fx::version怎麽用?PHP Fx::version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Floxim\Floxim\System\Fx的用法示例。


在下文中一共展示了Fx::version方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checkUpdates

 public function checkUpdates()
 {
     $stored = $this->all();
     $url = fx::config('fx.update_url') . '?action=find&from=' . fx::version();
     @($res = file_get_contents($url));
     if (!$res) {
         return false;
     }
     $res = @json_decode($res);
     if ($res) {
         foreach ($res as $patch) {
             if ($stored->findOne('to', $patch->to)) {
                 continue;
             }
             $new_patch = $this->create(array('to' => $patch->to, 'from' => $patch->from, 'url' => $patch->url, 'created' => $patch->created));
             if ($patch->from == fx::version()) {
                 $new_patch['status'] = 'ready';
             } else {
                 $new_patch['status'] = 'pending';
             }
             $new_patch->save();
         }
     }
     return true;
 }
開發者ID:floxim,項目名稱:floxim,代碼行數:25,代碼來源:Finder.php

示例2: all

 public function all($input)
 {
     if (isset($input['params'][0])) {
     }
     $bSkipCheckUpdates = isset($input['params'][0]) ? $input['params'][0] : false;
     if (!$bSkipCheckUpdates) {
         if (!fx::data('patch')->checkUpdates()) {
             $this->response->addField(array('type' => 'label', 'value' => '<p style="color:#F00;">' . fx::alang('Update check failed', 'system') . '</p>'));
         }
     }
     $this->response->addField(array('type' => 'label', 'value' => '<p>' . fx::alang('Current Floxim version:', 'system') . ' ' . fx::version() . '</p>'));
     $patches = fx::data('patch')->all();
     $list = array('type' => 'list', 'filter' => true, 'sortable' => false);
     $list['labels'] = array('name' => fx::alang('Version'), 'description' => fx::alang('Description'), 'buttons' => array('type' => 'buttons'), 'from' => fx::alang('Previous'), 'status' => fx::alang('Status'));
     $list['values'] = array();
     $have_ready = false;
     foreach ($patches as $patch) {
         $r = array('row_id' => 'patch_id_' . $patch['id'], 'name' => $patch['to'], 'description' => $patch['description'], 'from' => $patch['from'], 'status' => $patch['status'], 'buttons' => array());
         if ($patch['status'] == 'ready') {
             $have_ready = true;
             $r['buttons'][] = array('url' => 'patch.install(' . $patch['id'] . ')', 'label' => fx::alang('Install'));
         }
         $list['values'][] = $r;
     }
     $this->response->addField($list);
     if ($have_ready) {
         $this->response->addField(array('type' => 'button', 'func' => 'fx_patch.install_chain', 'label' => fx::alang('Install all')));
     }
     $this->setLayout();
 }
開發者ID:floxim,項目名稱:floxim,代碼行數:30,代碼來源:Patch.php


注:本文中的Floxim\Floxim\System\Fx::version方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。