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

45 lines
1.1 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 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.
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 : ''),
)
);
}