Translated using Weblate (Malayalam)
[phpmyadmin.git] / version_check.php
blob08613a34a1b98888008506e0c1d407d97622c276
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * A caching proxy for retrieving version information from phpmyadmin.net
6 * @package PhpMyAdmin
7 */
9 // Sets up the session
10 use PMA\libraries\VersionInformation;
12 define('PMA_MINIMUM_COMMON', true);
13 require_once 'libraries/common.inc.php';
14 require_once 'libraries/VersionInformation.php';
16 // Always send the correct headers
17 header('Content-type: application/json; charset=UTF-8');
19 $versionInformation = new VersionInformation();
20 $versionDetails = $versionInformation->getLatestVersion();
22 if (empty($versionDetails)) {
23 echo json_encode(array());
24 } else {
25 $latestCompatible = $versionInformation->getLatestCompatibleVersion(
26 $versionDetails->releases
28 $version = '';
29 $date = '';
30 if ($latestCompatible != null) {
31 $version = $latestCompatible['version'];
32 $date = $latestCompatible['date'];
34 echo json_encode(
35 array(
36 'version' => (! empty($version) ? $version : ''),
37 'date' => (! empty($date) ? $date : ''),