. */ class update_checker extends pts_module_interface { const module_name = "Update Checker"; const module_version = "0.1.0"; const module_description = "This module checks to see if the Phoronix Test Suite -- and its tests and suites -- are up to date."; const module_author = "Phoronix Media"; public static function __startup() { // Once a day check for new version if(IS_FIRST_RUN_TODAY) { // Check For pts-core updates $latest_reported_version = trim(@file_get_contents("http://www.phoronix-test-suite.com/LATEST")); $current_e = explode(".", PTS_VERSION); $latest_e = explode(".", $latest_reported_version); if($latest_reported_version != PTS_VERSION && $latest_e[0] >= $current_e[0] && ($latest_e[1] > $current_e[1] || ($latest_e[1] == $current_e[1] && $latest_e[2] >= $current_e[2]))) { // New version of PTS is available echo pts_string_header("Currently you're using an outdated version of the Phoronix Test Suite.\nThe version in use is v" . PTS_VERSION . ", but the latest is v" . $latest_reported_version . ".\nPlease visit http://www.phoronix-test-suite.com/ to update this software."); } } return PTS_MODULE_UNLOAD; // This module doesn't have anything else to do } } ?>