You need version 5.3 or higher Your current version is: '.PHP_VERSION);
}
foreach ($_REQUEST as $key => $value) { if (is_string($value)) $_REQUEST[$key] = htmlspecialchars(strip_tags(trim($value)),ENT_QUOTES,'UTF-8'); }
//set error reporting
error_reporting(E_ALL); //errors and notices
ini_set('display_errors',1);
ini_set('log_errors',1);
//get configuration data
if (file_exists('./lcconfig.php')) {
include './lcconfig.php';
}
if (empty($dbType)) { $dbType = 'SQLite'; } //set database type
$lcV = implode('.',str_split(substr(basename(__FILE__),7,-4))).'L'; //get new LuxCal version
//start PHP session (needed to be able to unset session variables later)
session_start();
setcookie('LCALcid', '', time()-3600); //delete possible calID cookie of previous installation
//get calendar tools
require './common/toolbox.php'; //general toolbox
require './common/toolboxd.php'; //database tools
require './common/toolboxx.php'; //admin tools
?>
LuxCal Event Calendar - UpgradeLuxCal Event CalendarLuxCal: {$lcV}Your PHP version: ".PHP_VERSION."Calendar Upgrade to Version {$lcV}\n";
echo "
\n";
do { //start of processing
if (empty($dbDir) or !isset($dbDef)) { //config data not complete
$error = "No configuration data found in calendar root (file: lcconfig.php)"; break;
}
$report[] = "Configuration file 'lcconfig.php' found. Configuration data loaded:";
$report[] = "- Database folder: {$dbDir}";
$report[] = "- Default calendar: {$dbDef}";
//get settings of default calendar and set time zone
$dbH = dbConnect($dbDef);
$dbSet = getSettings();
$dbH = null; //disconnect from db
if ($dbSet === false) {
$error = "Could not retrieve calendar settings from the database"; break;
}
date_default_timezone_set($dbSet['timeZone']);
$report[] = "Default calendar settings retrieved and timezone set to:";
$report[] = "- ".$dbSet['timeZone'];
//get installed calendars
$allCals = getCals();
if (empty($allCals)) {
$error = "No calendars found in folder '{$dbDir}'."; break;
}
$report[] = "Calendar(s) found in folder '{$dbDir}':";
foreach($allCals as $name=>$title) {
$report[] = '- '.$name.' = '.$title.($name == $dbDef ? " (default)" : '');
}
/*============================= start upgrading ==============================*/
foreach($allCals as $calID=>$title) { //process each installed calendar
$report[] = "Processing calendar: {$calID} - {$title}";
//connect to db
if (!$dbH = dbConnect($calID,0)) {
$report[] = "- Problem connecting to calendar.";
continue;
}
//upgrade db tables to the latest schema, while preserving data
$fromV = upgradeDb();
$report[] = "- V{$fromV} database tables and structures verified/updated.";
//upgrade admin settings
$dbSet = getSettings();
checkSettings($dbSet);
saveSettings($dbSet);
$report[] = "- Administrator settings verified/updated";
$dbH = null; //disconnect from db
}
//Save LuxCal version and config data
if (!saveConfig()) {
$error = "Unable to write the file lcconfig.php to calendar root. Check file permissions (should be 755)."; break;
}
$report[] = "Configuration file 'lcconfig.php' updated and saved to root folder.";
} while (0); //end of processing
echo "