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


PHP PMA_Util::getLatestVersion方法代码示例

本文整理汇总了PHP中PMA_Util::getLatestVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Util::getLatestVersion方法的具体用法?PHP PMA_Util::getLatestVersion怎么用?PHP PMA_Util::getLatestVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA_Util的用法示例。


在下文中一共展示了PMA_Util::getLatestVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetLatestVersion

 /**
  * Test version checking
  *
  * @return void
  *
  * @group large
  */
 public function testGetLatestVersion()
 {
     $GLOBALS['cfg']['ProxyUrl'] = '';
     $GLOBALS['cfg']['VersionCheckProxyUrl'] = '';
     $version = PMA_Util::getLatestVersion();
     $this->assertNotEmpty($version->version);
     $this->assertNotEmpty($version->date);
 }
开发者ID:kfjihailong,项目名称:phpMyAdmin,代码行数:15,代码来源:PMA_Util_test.php

示例2: testGetLatestVersion

 /**
  * Test version checking
  *
  * @return void
  *
  * @group large
  */
 public function testGetLatestVersion()
 {
     $GLOBALS['cfg']['ProxyUrl'] = PROXY_URL;
     $GLOBALS['cfg']['ProxyUser'] = PROXY_USER;
     $GLOBALS['cfg']['ProxyPass'] = PROXY_PASS;
     $GLOBALS['cfg']['VersionCheck'] = true;
     $version = PMA_Util::getLatestVersion();
     $this->assertNotEmpty($version->version);
     $this->assertNotEmpty($version->date);
 }
开发者ID:nobodypb,项目名称:phpmyadmin,代码行数:17,代码来源:PMA_Util_test.php

示例3: PMA_versionCheck

/**
 * Checks for newest phpMyAdmin version and sets result as a new notice
 *
 * @return void
 */
function PMA_versionCheck()
{
    // version check messages should always be visible so let's make
    // a unique message id each time we run it
    $message_id = uniqid('version_check');
    // Fetch data
    $version_data = PMA_Util::getLatestVersion();
    if (empty($version_data)) {
        PMA_messagesSet('error', $message_id, __('Version check'), __('Reading of version failed. Maybe you\'re offline or the upgrade server does not respond.'));
        return;
    }
    $version = $version_data->version;
    $date = $version_data->date;
    $version_upstream = PMA_Util::versionToInt($version);
    if ($version_upstream === false) {
        PMA_messagesSet('error', $message_id, __('Version check'), __('Got invalid version string from server'));
        return;
    }
    $version_local = PMA_Util::versionToInt($GLOBALS['PMA_Config']->get('PMA_VERSION'));
    if ($version_local === false) {
        PMA_messagesSet('error', $message_id, __('Version check'), __('Unparsable version string'));
        return;
    }
    if ($version_upstream > $version_local) {
        $version = htmlspecialchars($version);
        $date = htmlspecialchars($date);
        PMA_messagesSet('notice', $message_id, __('Version check'), sprintf(__('A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is %s, released on %s.'), $version, $date));
    } else {
        if ($version_local % 100 == 0) {
            PMA_messagesSet('notice', $message_id, __('Version check'), PMA_sanitize(sprintf(__('You are using Git version, run [kbd]git pull[/kbd] :-)[br]The latest stable version is %s, released on %s.'), $version, $date)));
        } else {
            PMA_messagesSet('notice', $message_id, __('Version check'), __('No newer stable version is available'));
        }
    }
}
开发者ID:minggLu,项目名称:openemr,代码行数:40,代码来源:index.lib.php

示例4: define

<?php

/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * A caching proxy for retrieving version information from phpmyadmin.net
 *
 * @package PhpMyAdmin
 */
// Sets up the session
define('PMA_MINIMUM_COMMON', true);
require_once 'libraries/common.inc.php';
require_once 'libraries/Util.class.php';
// Always send the correct headers
header('Content-type: application/json; charset=UTF-8');
$version = PMA_Util::getLatestVersion();
echo json_encode(array('version' => !empty($version->version) ? $version->version : '', 'date' => !empty($version->date) ? $version->date : ''));
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:16,代码来源:version_check.php


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