} } $parser = new UpdateXMLParser(); //check for errors switch ($parser->getXML()) { //not validated case 3: $page_error[] = "The updates descriptor file was downloaded, but it has failed to validate correctly."; break; //file not found //file not found case 4: $page_error[] = "Could not download the update descriptor file. It may be that the host is down or that remote connections are disallowed."; break; } $parser->retrieveData(); if (isset($_GET['reset_db'])) { Config::set('upd_dbVersion', $parser->getLatestDBVersion()); } if (count($page_error) == 0) { $dbversion = Config::get('upd_dbVersion'); $codeversion = KB_VERSION; if ($dbversion == '') { Config::set('upd_dbVersion', '0.0.0'); $dbversion = '0.0.0'; } if ($codeversion == '') { Config::set('upd_codeVersion', KB_VERSION); $codeversion = KB_VERSION; } //cache a database update to the cache directory
/** * Updates status xml if necessary. */ public static function checkStatus() { require_once 'update/CCPDB/xml.parser.php'; $xml = new UpdateXMLParser(); if ($xml->getXML() < 3) { $xml->retrieveData(); update::$codeVersion = $xml->getLatestCodeVersion(); update::$dbVersion = $xml->getLatestDBVersion(); } return; }