#!/usr/bin/php -q version)>0) { $pma_current = $pma_api->version; verbose("Current PHPMyAdmin version: $pma_current", 1); } else { die("Unable to determine current PHPMyAdmin version, exiting\n"); } checkHost(null, $pma_current); if($hosts != null) { foreach($hosts as $host) { checkHost($host, $pma_current); } } function checkHost($host, $pma_current) { $cmd = "locate libraries/Config.class.php | xargs grep -H \"'PMA_VERSION'\" | grep set"; $hostidentifier = "localhost:"; if( $host != null ) { $cmd = "ssh $host \"" . $cmd . "\""; $hostidentifier = $host . ":"; } exec($cmd, $results); foreach($results as $instance) { $parts = explode(':', $instance); $location = substr($parts[0], 0, strlen($parts[0])-26); if(preg_match("/->set\('PMA_VERSION', '([0-9\.a-z]+)'\);/", $parts[1], $matches)) { $version = $matches[1]; if($version < $pma_current) { verbose("WARNING: Outdated PHPMyAdmin $version at $hostidentifier$location", 0); } else { verbose("Recent PHPMyAdmin $version at $hostidentifier$location", 2); } } } unset($results); } ?>