Translated using Weblate (Slovenian)
[phpmyadmin.git] / version_check.php
blob96effc97d042b04a2ab63afe105ea7a9ba742264
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;
12 $_GET['ajax_request'] = 'true';
14 require_once 'libraries/common.inc.php';
16 // Disabling standard response.
17 PMA\libraries\Response::getInstance()->disable();
19 // Always send the correct headers
20 PMA_headerJSON();
22 $versionInformation = new VersionInformation();
23 $versionDetails = $versionInformation->getLatestVersion();
25 if (empty($versionDetails)) {
26 echo json_encode(array());
27 } else {
28 $latestCompatible = $versionInformation->getLatestCompatibleVersion(
29 $versionDetails->releases
31 $version = '';
32 $date = '';
33 if ($latestCompatible != null) {
34 $version = $latestCompatible['version'];
35 $date = $latestCompatible['date'];
37 echo json_encode(
38 array(
39 'version' => (! empty($version) ? $version : ''),
40 'date' => (! empty($date) ? $date : ''),