openMemory(); $xml->setIndent(true); $xml->startDocument('1.0','UTF-8'); $xml->startElement("links"); $xml->endElement(); file_put_contents($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."data".DIRECTORY_SEPARATOR."links.xml", $xml->flush(true)); } if ($settings::db_driver == "mysql") { $dbh = $common->pdoOpen(); // Add the links table. $sql = "CREATE TABLE ".$settings::db_prefix."links(id INT(11) AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL, address VARCHAR(250) NOT NULL);"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; $dbh = NULL; } if ($settings::db_driver == "sqlite") { // Create a new settings.class.php file adding the path to the SQLite database as the value for the db_host constant. $content = << EOF; file_put_contents($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."settings.class.php", $content); // Open a connection to the database. $dbh = $common->pdoOpen(); // Add the links table. $sql = "CREATE TABLE ".$dbPrefix."links(id INT(11) AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100) NOT NULL, address VARCHAR(250) NOT NULL);"; $sth = $dbh->prepare($sql); $sth->execute(); $sth = NULL; $dbh = NULL; } // Rename the enableFlightNotifications to enableWebNotifications. $enableWebNotifications = $common->getSetting('enableFlightNotifications'); $common->addSetting('enableWebNotifications', $enableWebNotifications); $common->deleteSetting('enableFlightNotifications'); // Add Google Maps API Key setting. $common->addSetting('googleMapsApiKey', ''); // Add enable custom links setting. $common->addSetting('enableLinks', FALSE); // Update the version and patch settings.. $common->updateSetting("version", "2.5.0"); $common->updateSetting("patch", ""); // The upgrade process completed successfully. $results['success'] = TRUE; $results['message'] = "Upgrade to v2.5.0 successful."; return $results; } catch(Exception $e) { // Something went wrong during this upgrade process. $results['success'] = FALSE; $results['message'] = $e->getMessage(); return $results; } } ?>