本文整理汇总了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;
}
示例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();
}