From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- srcs/phpmyadmin/version_check.php | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 srcs/phpmyadmin/version_check.php (limited to 'srcs/phpmyadmin/version_check.php') diff --git a/srcs/phpmyadmin/version_check.php b/srcs/phpmyadmin/version_check.php new file mode 100644 index 0000000..30a2000 --- /dev/null +++ b/srcs/phpmyadmin/version_check.php @@ -0,0 +1,49 @@ +disable(); + +// Always send the correct headers +Core::headerJSON(); + +$versionInformation = new VersionInformation(); +$versionDetails = $versionInformation->getLatestVersion(); + +if (empty($versionDetails)) { + echo json_encode([]); +} else { + $latestCompatible = $versionInformation->getLatestCompatibleVersion( + $versionDetails->releases + ); + $version = ''; + $date = ''; + if ($latestCompatible != null) { + $version = $latestCompatible['version']; + $date = $latestCompatible['date']; + } + echo json_encode( + [ + 'version' => ! empty($version) ? $version : '', + 'date' => ! empty($date) ? $date : '', + ] + ); +} -- cgit