Revision 2012
Added by darkviper almost 11 years ago
upgrade-script.php | ||
---|---|---|
34 | 34 |
* @deprecated |
35 | 35 |
* @description xyz |
36 | 36 |
*/ |
37 |
include_once(dirname(__FILE__).'/framework/UpgradeHelper.php'); |
|
38 |
|
|
37 | 39 |
// --- delete fatal disturbing files before upgrade starts ------------------------------- |
38 | 40 |
$aPreDeleteFiles = array( |
39 | 41 |
// list of files |
... | ... | |
58 | 60 |
} |
59 | 61 |
if($sMsg) { |
60 | 62 |
// stop script if there's an error occured |
61 |
$sMsg = 'Fatal error occured during initial startup.<br /><br />'.PHP_EOL.$sMsg |
|
62 |
. '<br />'.PHP_EOL.'Please delete all of the files above manually and ' |
|
63 |
. 'then <a href="http://'.$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"].'" ' |
|
64 |
. 'title="restart">klick here to restart the upgrade-script</a>.<br />'.PHP_EOL; |
|
65 |
die($sMsg); |
|
63 |
$sMsg = $sMsg.'<br />'.PHP_EOL.'Please delete all of the files above manually!'; |
|
64 |
UpgradeHelper::dieWithMessage($sMsg); |
|
66 | 65 |
} |
67 | 66 |
} |
68 | 67 |
unset($aPreDeleteFiles); |
... | ... | |
70 | 69 |
// --------------------------------------------------------------------------------------- |
71 | 70 |
// Include config file |
72 | 71 |
$config_file = dirname(__FILE__).'/config.php'; |
73 |
if(file_exists($config_file) && !defined('WB_URL')) |
|
74 |
{ |
|
75 |
require($config_file); |
|
72 |
if (is_readable($config_file) && !defined('WB_URL')) { |
|
73 |
require_once($config_file); |
|
76 | 74 |
} |
77 |
if(!class_exists('admin', false)) |
|
78 |
{ |
|
75 |
UpgradeHelper::checkSetupFiles($config_file); |
|
76 |
|
|
77 |
if (!class_exists('admin', false)) { |
|
79 | 78 |
include(WB_PATH.'/framework/class.admin.php'); |
80 | 79 |
} |
81 | 80 |
$admin = new admin('Addons', 'modules', false, false); |
... | ... | |
915 | 914 |
*/ |
916 | 915 |
echo '<h4>Upgrade pages directory '.PAGES_DIRECTORY.'/ access files</h4>'; |
917 | 916 |
|
917 |
/********************************************************** |
|
918 |
* Repair inconsistent PageTree |
|
919 |
*/ |
|
920 |
$iCount = UpgradeHelper::sanitizePagesTreeLinkStructure(); |
|
921 |
if (false === $iCount) { |
|
922 |
echo '<span><strong>Repair PageTree links </strong></span> '.$FAIL.'<br />'; |
|
923 |
} else { |
|
924 |
echo '<span><strong>'.$iCount.' PageTree links repaired.</strong></span> '.$OK.'<br />'; |
|
925 |
} |
|
918 | 926 |
/********************************************************** |
919 | 927 |
* - Reformat/rebuild all existing access files |
920 | 928 |
*/ |
... | ... | |
1153 | 1161 |
closedir($handle); |
1154 | 1162 |
} |
1155 | 1163 |
echo '<strong><span>'.$iLoaded.' Templates reloaded,</span> found '.$iFound.' directories in folder /templates/</strong><br />'; |
1156 |
|
|
1157 | 1164 |
$iFound = 0; |
1158 | 1165 |
$iLoaded = 0; |
1159 | 1166 |
////delete languages |
... | ... | |
1169 | 1176 |
closedir($handle); |
1170 | 1177 |
} |
1171 | 1178 |
echo '<strong><span>'.$iLoaded.' Languages reloaded,</span> found '.$iFound.' files in folder /languages/</strong><br />'; |
1179 |
$sTransCachePath = WB_PATH.'/temp/TranslationTable/cache/'; |
|
1180 |
if (is_writeable($sTransCachePath)) { |
|
1181 |
if (rm_full_dir($sTransCachePath, true)) { |
|
1182 |
echo '<strong><span>Translation Cache cleaned</span></strong> '.$OK.'<br />'; |
|
1183 |
} else { |
|
1184 |
echo '<strong><span>Clean Translation Cache</span></strong> '.$FAIL.'<br />'; |
|
1185 |
} |
|
1186 |
} |
|
1172 | 1187 |
echo '</div>'; |
1173 | 1188 |
|
1174 | 1189 |
/********************************************************** |
Also available in: Unified diff
! upgrade-script:: now repairs mismatched pagelinks from older versions
! upgrade-script:: /temp/TranslationTable/cache/ will be deleted now during upgrade
+ UpgradeHelper::checkSetupFiles() the old config.php will be changed into setup.ini.php now.