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