2016-10-22 14:57:10 +00:00
|
|
|
<?php
|
|
|
|
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
|
|
|
/**
|
2017-04-20 10:55:30 +00:00
|
|
|
* A caching proxy for retrieving version information from https://www.phpmyadmin.net/
|
2016-10-22 14:57:10 +00:00
|
|
|
*
|
|
|
|
* @package PhpMyAdmin
|
|
|
|
*/
|
|
|
|
|
2018-04-14 09:18:00 +00:00
|
|
|
use PhpMyAdmin\Core;
|
|
|
|
use PhpMyAdmin\VersionInformation;
|
|
|
|
use PhpMyAdmin\Response;
|
2016-10-22 14:57:10 +00:00
|
|
|
|
|
|
|
$_GET['ajax_request'] = 'true';
|
|
|
|
|
|
|
|
require_once 'libraries/common.inc.php';
|
|
|
|
|
|
|
|
// Disabling standard response.
|
2017-04-20 10:55:30 +00:00
|
|
|
Response::getInstance()->disable();
|
2016-10-22 14:57:10 +00:00
|
|
|
|
|
|
|
// Always send the correct headers
|
2018-04-14 09:18:00 +00:00
|
|
|
Core::headerJSON();
|
2016-10-22 14:57:10 +00:00
|
|
|
|
|
|
|
$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 : ''),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|