Translated using Weblate (French)
[phpmyadmin.git] / version_check.php
blob81169273c06fc95a04ad67e30f5c1b904191777c
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 PMA_headerJSON();
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 : ''),