devilbox/.devilbox/www/htdocs/vendor/phpmyadmin/version_check.php

44 lines
1.0 KiB
PHP
Raw Normal View History

2016-10-22 14:57:10 +00:00
<?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
use PMA\libraries\VersionInformation;
$_GET['ajax_request'] = 'true';
require_once 'libraries/common.inc.php';
// Disabling standard response.
PMA\libraries\Response::getInstance()->disable();
// Always send the correct headers
PMA_headerJSON();
$versionInformation = new VersionInformation();
$versionDetails = $versionInformation->getLatestVersion();
if (empty($versionDetails)) {
echo json_encode(array());
} else {
$latestCompatible = $versionInformation->getLatestCompatibleVersion(
$versionDetails->releases
);
$version = '';
$date = '';
if ($latestCompatible != null) {
$version = $latestCompatible['version'];
$date = $latestCompatible['date'];
}
echo json_encode(
array(
'version' => (! empty($version) ? $version : ''),
'date' => (! empty($date) ? $date : ''),
)
);
}