diff options
author | Hugues Peccatte <hugues.peccatte@gmail.com> | 2015-09-26 14:50:49 +0300 |
---|---|---|
committer | Hugues Peccatte <hugues.peccatte@gmail.com> | 2015-09-26 14:50:49 +0300 |
commit | 71b62bcef9861e452becb02e63b382aeec8645ba (patch) | |
tree | 015ad14fc966ee5d8681695a67ed8e6fc628d829 /version_check.php | |
parent | 5f17b32689ebc8850d83bae299bcdb8957531495 (diff) | |
parent | 62859dffbc6430d4b4d647c2f9cabd66bc4bb7f5 (diff) |
Merge remote-tracking branch 'origin/master' into useNamespaces_master
Diffstat (limited to 'version_check.php')
-rw-r--r-- | version_check.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/version_check.php b/version_check.php index 9058994ab4..f90ddec523 100644 --- a/version_check.php +++ b/version_check.php @@ -9,19 +9,30 @@ // Sets up the session define('PMA_MINIMUM_COMMON', true); require_once 'libraries/common.inc.php'; +require_once 'libraries/VersionInformation.php'; // Always send the correct headers header('Content-type: application/json; charset=UTF-8'); -$version = PMA\libraries\Util::getLatestVersion(); +$versionInformation = new VersionInformation(); +$versionDetails = $versionInformation->getLatestVersion(); -if (empty($version)) { +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) ? $version->version : ''), - 'date' => (! empty($version->date) ? $version->date : ''), + 'version' => (! empty($version) ? $version : ''), + 'date' => (! empty($date) ? $date : ''), ) ); } |