Translated using Weblate (Slovenian)
[phpmyadmin.git] / version_check.php
blobc62d128e8c49a8d774d109340b50deda0c0fa779
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * A caching proxy for retrieving version information from https://www.phpmyadmin.net/
6 * @package PhpMyAdmin
7 */
9 // Sets up the session
10 use PMA\libraries\VersionInformation;
11 use PMA\libraries\Response;
13 $_GET['ajax_request'] = 'true';
15 require_once 'libraries/common.inc.php';
17 // Disabling standard response.
18 Response::getInstance()->disable();
20 // Always send the correct headers
21 PMA_headerJSON();
23 $versionInformation = new VersionInformation();
24 $versionDetails = $versionInformation->getLatestVersion();
26 if (empty($versionDetails)) {
27 echo json_encode(array());
28 } else {
29 $latestCompatible = $versionInformation->getLatestCompatibleVersion(
30 $versionDetails->releases
32 $version = '';
33 $date = '';
34 if ($latestCompatible != null) {
35 $version = $latestCompatible['version'];
36 $date = $latestCompatible['date'];
38 echo json_encode(
39 array(
40 'version' => (! empty($version) ? $version : ''),
41 'date' => (! empty($date) ? $date : ''),