User settings carry version no & clear on upgrade

versionNo also added to user settings array
Check this against system and on mismatch, rename .old and reload to
create new settings file
This commit is contained in:
Matt Pass
2013-06-15 13:40:56 +01:00
parent 7bef57ca76
commit d3737f5a62
2 changed files with 7 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
<?php
$ICEcoderUserSettings = array(
"versionNo" => "3.0 beta",
"root" => "",
"checkUpdates" => true,
"openLastFiles" => true,

View File

@@ -101,6 +101,12 @@ if (!file_exists(dirname(__FILE__)."/".$settingsFile)) {
}
include(dirname(__FILE__)."/".$settingsFile);
// On mismatch of settings file to system, rename to .old and reload
If ($ICEcoderUserSettings["versionNo"] != $ICEcoderSettings["versionNo"]) {
rename(dirname(__FILE__)."/".$settingsFile,dirname(__FILE__)."/".str_replace(".php",".old",$settingsFile));
header("Location: settings.php");
}
// Join ICEcoder settings and user settings together to make our final ICEcoder array
$ICEcoder = $ICEcoderSettings + $ICEcoderUserSettings;