2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * A caching proxy for retrieving version information from https://www.phpmyadmin.net/
8 declare(strict_types
=1);
11 use PhpMyAdmin\Response
;
12 use PhpMyAdmin\VersionInformation
;
14 if (! defined('ROOT_PATH')) {
15 define('ROOT_PATH', __DIR__
. DIRECTORY_SEPARATOR
);
18 $_GET['ajax_request'] = 'true';
20 require_once ROOT_PATH
. 'libraries/common.inc.php';
22 // Disabling standard response.
23 Response
::getInstance()->disable();
25 // Always send the correct headers
28 $versionInformation = new VersionInformation();
29 $versionDetails = $versionInformation->getLatestVersion();
31 if (empty($versionDetails)) {
34 $latestCompatible = $versionInformation->getLatestCompatibleVersion(
35 $versionDetails->releases
39 if ($latestCompatible != null) {
40 $version = $latestCompatible['version'];
41 $date = $latestCompatible['date'];
45 'version' => ! empty($version) ?
$version : '',
46 'date' => ! empty($date) ?
$date : '',