use json method to find phpmyadmin version (courtesy WvR)

This commit is contained in:
florian
2013-10-15 20:03:19 +00:00
parent 5ecd250bac
commit 3ec0db5ffd

View File

@@ -2,9 +2,9 @@
<?php
require_once("toolkit.php");
$pma_api = file_get_contents("http://www.phpmyadmin.net/home_page/downloads.php");
if( preg_match("/>phpMyAdmin\-([0-9\.]+)\-all\-languages\.tar\.gz</", $pma_api, $matches) ) {
$pma_current = $matches[1];
$pma_api = json_decode(file_get_contents("http://www.phpmyadmin.net/home_page/version.json"));
if(is_object($pma_api) && strlen($pma_api->version)>0) {
$pma_current = $pma_api->version;
verbose("Current PHPMyAdmin version: $pma_current", 1);
} else {
die("Unable to determine current PHPMyAdmin version, exiting\n");