Revision 1866
Added by Luisehahne over 12 years ago
| upgrade-script.php | ||
|---|---|---|
| 1 | 1 |
<?php |
| 2 | 2 |
/** |
| 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
|
| 3 | 4 |
* |
| 4 |
* @category backend |
|
| 5 |
* @package installation |
|
| 6 |
* @author WebsiteBaker Project |
|
| 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
| 8 |
* @link http://www.websitebaker2.org/ |
|
| 9 |
* @license http://www.gnu.org/licenses/gpl.html |
|
| 10 |
* @platform WebsiteBaker 2.8.x |
|
| 11 |
* @requirements PHP 5.2.2 and higher |
|
| 12 |
* @version $Id$ |
|
| 13 |
* @filesource $HeadURL$ |
|
| 14 |
* @lastmodified $Date$ |
|
| 5 |
* This program is free software: you can redistribute it and/or modify |
|
| 6 |
* it under the terms of the GNU General Public License as published by |
|
| 7 |
* the Free Software Foundation, either version 3 of the License, or |
|
| 8 |
* (at your option) any later version. |
|
| 15 | 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
|
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 |
* GNU General Public License for more details. |
|
| 14 |
* |
|
| 15 |
* You should have received a copy of the GNU General Public License |
|
| 16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 16 | 17 |
*/ |
| 17 | 18 |
|
| 19 |
/** |
|
| 20 |
* |
|
| 21 |
* |
|
| 22 |
* @category Module |
|
| 23 |
* @package Module_bakery |
|
| 24 |
* @subpackage Name of the subpackage if needed |
|
| 25 |
* @author Dietmar W?llbrink <dietmar.woellbrink@websitebaker.org> |
|
| 26 |
* @author Werner v.d.Decken <wkl@isteam.de> |
|
| 27 |
* @copyright Werner v.d.Decken <wkl@isteam.de> |
|
| 28 |
* @license http://www.gnu.org/licenses/gpl.html GPL License |
|
| 29 |
* @version 0.0.1 |
|
| 30 |
* @revision $Revision$ |
|
| 31 |
* @link $HeadURL$ |
|
| 32 |
* @lastmodified $Date$ |
|
| 33 |
* @since File available since 17.01.2013 |
|
| 34 |
* @deprecated |
|
| 35 |
* @description xyz |
|
| 36 |
*/ |
|
| 18 | 37 |
// Include config file |
| 19 | 38 |
$config_file = realpath('config.php');
|
| 20 | 39 |
if(file_exists($config_file) && !defined('WB_URL'))
|
| ... | ... | |
| 44 | 63 |
// database tables including in WB package |
| 45 | 64 |
$aPackage = array ( |
| 46 | 65 |
'settings','groups','addons','pages','sections','search','users', |
| 47 |
'mod_captcha_control','mod_code','mod_droplets','mod_form_fields',
|
|
| 48 |
'mod_form_settings','mod_form_submissions','mod_jsadmin','mod_menu_link',
|
|
| 49 |
'mod_news_comments','mod_news_groups','mod_news_posts','mod_news_settings',
|
|
| 50 |
'mod_output_filter','mod_wrapper','mod_wysiwyg'
|
|
| 66 |
'mod_captcha_control','mod_code','mod_droplets', |
|
| 67 |
'mod_jsadmin','mod_menu_link','mod_output_filter','mod_wrapper','mod_wysiwyg',
|
|
| 68 |
// 'mod_form_fields','mod_form_settings','mod_form_submissions',
|
|
| 69 |
// 'mod_news_comments','mod_news_groups','mod_news_posts','mod_news_settings',
|
|
| 51 | 70 |
); |
| 52 | 71 |
|
| 53 | 72 |
$OK = ' <span class="ok">OK</span> '; |
| ... | ... | |
| 65 | 84 |
*/ |
| 66 | 85 |
'[ADMIN]/themes/', |
| 67 | 86 |
); |
| 87 |
// |
|
| 88 |
$filesRemove['0'] = array( |
|
| 68 | 89 |
|
| 69 |
if(version_compare(WB_REVISION, VERSION, '<=')) |
|
| 70 |
{
|
|
| 71 |
$filesRemove['0'] = array( |
|
| 72 |
|
|
| 73 | 90 |
'[ADMIN]/preferences/details.php', |
| 74 | 91 |
'[ADMIN]/preferences/email.php', |
| 75 | 92 |
'[ADMIN]/preferences/password.php', |
| 76 | 93 |
'[ADMIN]/pages/settings2.php', |
| 77 | 94 |
'[ADMIN]/users/users.php', |
| 95 |
'[ADMIN]/skel/themes/htt/groups.htt', |
|
| 78 | 96 |
|
| 79 | 97 |
'[FRAMEWORK]/class.msg_queue.php', |
| 80 | 98 |
'[FRAMEWORK]/class.logfile.php', |
| 81 | 99 |
'[MODULES]/droplets/js/mdcr.js', |
| 82 | 100 |
|
| 83 | 101 |
); |
| 102 |
$aFilesToRemove = array_merge($filesRemove['0']); |
|
| 84 | 103 |
|
| 104 |
// deleting files below only from less 2.8.4 stable |
|
| 105 |
if(version_compare(WB_REVISION, REVISION, '<=')) |
|
| 106 |
{
|
|
| 85 | 107 |
$filesRemove['1'] = array( |
| 86 | 108 |
|
| 87 | 109 |
'[TEMPLATE]/argos_theme/templates/access.htt', |
| ... | ... | |
| 92 | 114 |
'[TEMPLATE]/argos_theme/templates/groups_form.htt', |
| 93 | 115 |
'[TEMPLATE]/argos_theme/templates/languages.htt', |
| 94 | 116 |
'[TEMPLATE]/argos_theme/templates/languages_details.htt', |
| 95 |
/* |
|
| 96 | 117 |
'[TEMPLATE]/argos_theme/templates/login.htt', |
| 97 | 118 |
'[TEMPLATE]/argos_theme/templates/login_forgot.htt', |
| 98 |
*/ |
|
| 99 | 119 |
'[TEMPLATE]/argos_theme/templates/media.htt', |
| 100 | 120 |
'[TEMPLATE]/argos_theme/templates/media_browse.htt', |
| 101 | 121 |
'[TEMPLATE]/argos_theme/templates/media_rename.htt', |
| ... | ... | |
| 123 | 143 |
'[TEMPLATE]/wb_theme/templates/groups_form.htt', |
| 124 | 144 |
'[TEMPLATE]/wb_theme/templates/languages.htt', |
| 125 | 145 |
'[TEMPLATE]/wb_theme/templates/languages_details.htt', |
| 126 |
|
|
| 127 |
/* |
|
| 128 | 146 |
'[TEMPLATE]/wb_theme/templates/login.htt', |
| 129 | 147 |
'[TEMPLATE]/wb_theme/templates/login_forgot.htt', |
| 130 |
*/ |
|
| 131 |
|
|
| 132 | 148 |
'[TEMPLATE]/wb_theme/templates/media.htt', |
| 133 | 149 |
'[TEMPLATE]/wb_theme/templates/media_browse.htt', |
| 134 | 150 |
'[TEMPLATE]/wb_theme/templates/media_rename.htt', |
| ... | ... | |
| 146 | 162 |
'[TEMPLATE]/wb_theme/templates/templates.htt', |
| 147 | 163 |
'[TEMPLATE]/wb_theme/templates/templates_details.htt', |
| 148 | 164 |
'[TEMPLATE]/wb_theme/templates/users.htt', |
| 149 |
'[TEMPLATE]/wb_theme/templates/users_form.htt',
|
|
| 165 |
'[TEMPLATE]/wb_theme/templates/users_form.htt' |
|
| 150 | 166 |
); |
| 151 | 167 |
|
| 152 |
$aFilesToRemove = array_merge($filesRemove['0'],$filesRemove['1']);
|
|
| 168 |
$aFilesToRemove = array_merge($aFilesToRemove,$filesRemove['1']);
|
|
| 153 | 169 |
|
| 154 | 170 |
} |
| 155 |
|
|
| 156 | 171 |
/* display a status message on the screen ************************************** |
| 157 | 172 |
* @param string $message: the message to show |
| 158 | 173 |
* @param string $class: kind of message as a css-class |
| ... | ... | |
| 177 | 192 |
* @return |
| 178 | 193 |
*/ |
| 179 | 194 |
function add_modify_field_in_database($sTable,$sField,$sDescription){
|
| 180 |
global $database,$OK,$FAIL,$bDebugModus;
|
|
| 181 |
$aDebugMessage = array();
|
|
| 195 |
global $database,$OK,$FAIL,$bDebugModus;
|
|
| 196 |
$aDebugMessage = array();
|
|
| 182 | 197 |
if(!$database->field_exists($sTable,$sField)) {
|
| 183 | 198 |
$aDebugMessage[] = "<span>Adding field $sField to $sTable table</span>"; |
| 184 | 199 |
$aDebugMessage[] = ($database->field_add($sTable, $sField, $sDescription) ? " $OK<br />" : " $FAIL!<br />"); |
| ... | ... | |
| 186 | 201 |
$aDebugMessage[] = "<span>Modify field $sField to $sTable table</span>"; |
| 187 | 202 |
$aDebugMessage[] = ($database->field_modify($sTable, $sField, $sDescription) ? " $OK<br />" : " $FAIL!<br />"); |
| 188 | 203 |
} |
| 189 |
if($bDebugModus) {
|
|
| 190 |
echo implode(PHP_EOL,$aDebugMessage);
|
|
| 191 |
}
|
|
| 192 |
return;
|
|
| 204 |
if($bDebugModus) {
|
|
| 205 |
echo implode(PHP_EOL,$aDebugMessage);
|
|
| 206 |
}
|
|
| 207 |
return; |
|
| 193 | 208 |
} |
| 194 | 209 |
|
| 195 | 210 |
/** |
| ... | ... | |
| 201 | 216 |
*/ |
| 202 | 217 |
function check_wb_tables() |
| 203 | 218 |
{
|
| 204 |
global $database,$aPackage;
|
|
| 219 |
global $database,$aPackage;
|
|
| 205 | 220 |
|
| 206 | 221 |
// if prefix inludes '_' or '%' |
| 207 |
$search_for = addcslashes ( TABLE_PREFIX, '%_' );
|
|
| 208 |
$get_result = $database->query( 'SHOW TABLES LIKE "'.$search_for.'%"');
|
|
| 222 |
$search_for = addcslashes ( TABLE_PREFIX, '%_' );
|
|
| 223 |
$get_result = $database->query( 'SHOW TABLES LIKE "'.$search_for.'%"');
|
|
| 209 | 224 |
|
| 210 |
// $get_result = $database->query( "SHOW TABLES FROM ".DB_NAME);
|
|
| 225 |
// $get_result = $database->query( "SHOW TABLES FROM ".DB_NAME);
|
|
| 211 | 226 |
$all_tables = array(); |
| 212 | 227 |
$aTable = array(); |
| 213 | 228 |
if($get_result->numRows() > 0) |
| ... | ... | |
| 250 | 265 |
#container {
|
| 251 | 266 |
min-width:48em; |
| 252 | 267 |
width: 70%; |
| 253 |
background: #A8BCCB url(templates/wb_theme/images/background.png) repeat-x; |
|
| 268 |
background: #A8BCCB url(<?php echo WB_URL; ?>/templates/wb_theme/images/background.png) repeat-x;
|
|
| 254 | 269 |
border:1px solid #000; |
| 255 | 270 |
color:#000; |
| 256 | 271 |
margin:2em auto; |
| ... | ... | |
| 290 | 305 |
|
| 291 | 306 |
textarea {
|
| 292 | 307 |
width:100%; |
| 293 |
border: 2px groove #0F1D44;
|
|
| 294 |
padding: 2px;
|
|
| 295 |
color: #000;
|
|
| 296 |
font-weight: normal;
|
|
| 308 |
border: 2px groove #0F1D44;
|
|
| 309 |
padding: 2px;
|
|
| 310 |
color: #000;
|
|
| 311 |
font-weight: normal;
|
|
| 297 | 312 |
} |
| 298 | 313 |
.ok, .error { font-weight:bold; }
|
| 299 | 314 |
.ok { color:green; }
|
| ... | ... | |
| 323 | 338 |
<body> |
| 324 | 339 |
<div id="container"> |
| 325 | 340 |
<div class="page"> |
| 326 |
<img src="templates/wb_theme/images/logo.png" alt="WebsiteBaker Project" /> |
|
| 341 |
<img src="<?php echo WB_URL; ?>/templates/wb_theme/images/logo.png" alt="WebsiteBaker Project" />
|
|
| 327 | 342 |
<div class="content"> |
| 328 | 343 |
<h1>WebsiteBaker Upgrade</h1> |
| 329 | 344 |
<?php |
| ... | ... | |
| 331 | 346 |
status_msg('<strong>Warning:</strong><br />It is not possible to upgrade from WebsiteBaker Versions before 2.7.<br />For upgrading to version '.VERSION.' you must upgrade first to v.2.7 at least!!!', 'warning', 'div');
|
| 332 | 347 |
echo '<br /><br />'; |
| 333 | 348 |
echo "</div> |
| 334 |
</div>
|
|
| 335 |
</div>
|
|
| 349 |
</div>
|
|
| 350 |
</div>
|
|
| 336 | 351 |
</body> |
| 337 | 352 |
</html> |
| 338 | 353 |
"; |
| ... | ... | |
| 353 | 368 |
<h5 class="warning">It is highly recommended to <strong>create a manual backup</strong> of the entire <strong class="error"><?php echo PAGES_DIRECTORY ?>/</strong> folder and the <strong>MySQL database</strong> before proceeding.</h5> |
| 354 | 369 |
<p><strong class="error">Note: </strong>The upgrade script alters some settings of your existing database!!! You need to confirm the disclaimer before proceeding.</p> |
| 355 | 370 |
|
| 356 |
<form name="send" action="<?php echo $_SERVER['SCRIPT_NAME'];?>" method="post">
|
|
| 371 |
<form action="<?php echo $_SERVER['SCRIPT_NAME'];?>" method="post"> |
|
| 357 | 372 |
<textarea cols="92" rows="5">DISCLAIMER: The WebsiteBaker upgrade script is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. One needs to confirm that a manual backup of the <?php echo PAGES_DIRECTORY ?>/ folder (including all files and subfolders contained in it) and backup of the entire WebsiteBaker MySQL database was created before you can proceed.</textarea> |
| 358 | 373 |
<br /><br /><input name="backup_confirmed" type="checkbox" value="confirmed" /> <strong>I confirm that a manual backup of the <?php echo PAGES_DIRECTORY ?>/ folder and the MySQL database was created.</strong> |
| 359 | 374 |
<br /><br /><input name="debug_confirmed" type="checkbox" value="debug" /> <strong>Here you can get more details during running upgrade.</strong> |
| ... | ... | |
| 363 | 378 |
|
| 364 | 379 |
<?php |
| 365 | 380 |
status_msg('<strong> Notice:</strong><br />You need to confirm that you have created a manual backup of the '.PAGES_DIRECTORY.'/ directory and the MySQL database before you can proceed.', 'warning', 'div');
|
| 366 |
echo '<br /><br />'; |
|
| 367 |
echo "</div> |
|
| 368 |
</div> |
|
| 369 |
</div> |
|
| 370 |
</body> |
|
| 371 |
</html> |
|
| 372 |
"; |
|
| 381 |
echo "<br /><br /></div> |
|
| 382 |
</div> |
|
| 383 |
</div> |
|
| 384 |
</body> |
|
| 385 |
</html>"; |
|
| 373 | 386 |
exit(); |
| 374 | 387 |
} |
| 375 | 388 |
|
| ... | ... | |
| 397 | 410 |
status_msg('<strong>:</strong><br />can\'t run Upgrade, missing tables', 'warning', 'div');
|
| 398 | 411 |
echo '<h4>Missing required tables. You can install them in backend->addons->modules.<br />'; |
| 399 | 412 |
echo 'Or if you uploaded per FTP install possible by backend->addons->modules->advanced.<br />'; |
| 400 |
echo 'After installing missing tables again run upgrade-script.php</h4>'; |
|
| 413 |
echo 'First rename or delete the upgrade-script.php, so the script can\'t start automatically by backend<br />'; |
|
| 414 |
echo 'After installing missing tables upload and run again upgrade-script.php</h4>'; |
|
| 401 | 415 |
$result = array_diff ( $aPackage, $aTable ); |
| 402 | 416 |
|
| 403 | 417 |
echo '<h4 class="warning"><br />'; |
| ... | ... | |
| 414 | 428 |
echo '</form>'; |
| 415 | 429 |
} |
| 416 | 430 |
if(defined('ADMIN_URL')) {
|
| 417 |
echo '<form action="'.ADMIN_URL.'/">'; |
|
| 418 |
echo ' <input type="submit" value="kick me to the Backend" />'; |
|
| 431 |
echo '<form action="'.ADMIN_URL.'/index.php" method="post">';
|
|
| 432 |
echo ' <input name="backend_send" type="submit" value="kick me to the Backend" />';
|
|
| 419 | 433 |
echo '</form>'; |
| 420 | 434 |
} |
| 421 |
|
|
| 422 | 435 |
echo "<br /><br /></div> |
| 423 | 436 |
</div> |
| 424 | 437 |
</div> |
| 425 | 438 |
</body> |
| 426 |
</html> |
|
| 427 |
"; |
|
| 439 |
</html>"; |
|
| 428 | 440 |
|
| 429 | 441 |
exit(); |
| 430 | 442 |
} |
| ... | ... | |
| 444 | 456 |
echo implode(PHP_EOL,$aDebugMessage); |
| 445 | 457 |
} |
| 446 | 458 |
$aDebugMessage = array(); |
| 447 |
echo'<h3>Step '.(++$stepID).': Updating core tables</h3>';
|
|
| 459 |
echo'<h3>Step '.(++$stepID).': Updating tables included in package</h3>';
|
|
| 448 | 460 |
/********************************************************** |
| 449 | 461 |
* - Adding field sec_anchor to settings table |
| 450 | 462 |
*/ |
| ... | ... | |
| 580 | 592 |
|
| 581 | 593 |
if($bDebugModus) {
|
| 582 | 594 |
echo implode(PHP_EOL,$aDebugMessage); |
| 583 |
$aDebugMessage = array(); |
|
| 584 | 595 |
} |
| 585 | 596 |
|
| 597 |
$aDebugMessage = array(); |
|
| 586 | 598 |
echo "<h4>Adding/updating field on table pages</h4>"; |
| 587 | 599 |
/********************************************************** |
| 588 | 600 |
* - Add field "page_trail" to table "pages" |
| ... | ... | |
| 684 | 696 |
|
| 685 | 697 |
if($bDebugModus) {
|
| 686 | 698 |
echo implode(PHP_EOL,$aDebugMessage); |
| 687 |
$aDebugMessage = array(); |
|
| 688 | 699 |
} |
| 689 | 700 |
|
| 690 |
/********************************************************** |
|
| 701 |
$aDebugMessage = array(); |
|
| 702 |
/********************************************************** |
|
| 691 | 703 |
* modify wrong strucre on table sections |
| 692 | 704 |
* wrong structure let crash wb |
| 693 | 705 |
*/ |
| ... | ... | |
| 705 | 717 |
|
| 706 | 718 |
if($bDebugModus) {
|
| 707 | 719 |
echo implode(PHP_EOL,$aDebugMessage); |
| 708 |
$aDebugMessage = array(); |
|
| 709 | 720 |
} |
| 710 | 721 |
|
| 722 |
$aDebugMessage = array(); |
|
| 711 | 723 |
/********************************************************** |
| 712 | 724 |
* `confirm_code` VARCHAR(32) NOT NULL DEFAULT '', |
| 713 | 725 |
* `confirm_timeout` INT(11) NOT NULL DEFAULT '0', |
| ... | ... | |
| 725 | 737 |
|
| 726 | 738 |
if($bDebugModus) {
|
| 727 | 739 |
echo implode(PHP_EOL,$aDebugMessage); |
| 728 |
$aDebugMessage = array(); |
|
| 729 | 740 |
} |
| 730 | 741 |
|
| 742 |
$aDebugMessage = array(); |
|
| 731 | 743 |
/********************************************************** |
| 732 | 744 |
* Modify Administrator on groups table |
| 733 | 745 |
*/ |
| 734 | 746 |
echo "<h4>Update group Administrator on table groups</h4>"; |
| 735 | 747 |
$aDebugMessage[] = "<span>Modify Administrator on groups table</span>"; |
| 736 |
$sModulePermissions = '';
|
|
| 737 |
$sTemplatePermissions = '';
|
|
| 748 |
$sModulePermissions = '';
|
|
| 749 |
$sTemplatePermissions = '';
|
|
| 738 | 750 |
$sSystemPermissions = 'access,addons,admintools,admintools_view,groups,groups_add,groups_delete,groups_modify,groups_view,'; |
| 739 | 751 |
$sSystemPermissions .= 'languages,languages_install,languages_uninstall,languages_view,media,media_create,media_delete,media_rename,media_upload,media_view,'; |
| 740 | 752 |
$sSystemPermissions .= 'modules,modules_advanced,modules_install,modules_uninstall,modules_view,pages,pages_add,pages_add_l0,pages_delete,pages_intro,pages_modify,pages_settings,pages_view,'; |
| ... | ... | |
| 753 | 765 |
|
| 754 | 766 |
if($bDebugModus) {
|
| 755 | 767 |
echo implode(PHP_EOL,$aDebugMessage); |
| 756 |
$aDebugMessage = array(); |
|
| 757 | 768 |
} |
| 758 | 769 |
echo '</div>'; |
| 759 | 770 |
|
| ... | ... | |
| 790 | 801 |
} |
| 791 | 802 |
} |
| 792 | 803 |
|
| 793 |
if(version_compare(WB_REVISION, VERSION, '<'))
|
|
| 804 |
if(version_compare(WB_REVISION, REVISION, '<='))
|
|
| 794 | 805 |
{
|
| 795 | 806 |
$aDebugMessage = array(); |
| 796 | 807 |
echo '<h3>Step '.(++$stepID).': Updating group_id in table users</h3>'; |
| ... | ... | |
| 844 | 855 |
} |
| 845 | 856 |
|
| 846 | 857 |
$aDebugMessage = array(); |
| 847 |
echo '<h3>Step '.(++$stepID).': Updating acess and protected files in folders</h3>'; |
|
| 858 |
echo '<h3>Step '.(++$stepID).': Updating access and protected files in folders</h3>';
|
|
| 848 | 859 |
|
| 849 | 860 |
echo '<div style="margin-left:2em;">'; |
| 850 | 861 |
/********************************************************** |
| ... | ... | |
| 852 | 863 |
*/ |
| 853 | 864 |
$dir = (WB_PATH.MEDIA_DIRECTORY); |
| 854 | 865 |
echo '<h4>Upgrade media directory '.MEDIA_DIRECTORY.'/ index.php protect files</h4>'; |
| 855 |
$array = rebuildFolderProtectFile($dir);
|
|
| 856 |
if( sizeof( $array ) ){
|
|
| 857 |
echo '<span><strong>Upgrade '.sizeof( $array ).' directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $OK<br />";
|
|
| 866 |
$aDebugMessage = rebuildFolderProtectFile($dir);
|
|
| 867 |
if( sizeof( $aDebugMessage ) ){
|
|
| 868 |
echo '<span><strong>Upgrade '.sizeof( $aDebugMessage ).' directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $OK<br />";
|
|
| 858 | 869 |
} else {
|
| 859 | 870 |
echo '<span><strong>Upgrade directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $FAIL!<br />"; |
| 860 |
echo implode ('<br />',$array);
|
|
| 871 |
echo implode ('<br />',$aDebugMessage);
|
|
| 861 | 872 |
} |
| 862 | 873 |
|
| 874 |
$aDebugMessage = array(); |
|
| 863 | 875 |
/********************************************************** |
| 864 | 876 |
* upgrade pages directory index access files |
| 865 | 877 |
*/ |
| ... | ... | |
| 871 | 883 |
$sPagePath = (defined('PAGES_DIRECTORY') && (PAGES_DIRECTORY != '') ? PAGES_DIRECTORY : '');
|
| 872 | 884 |
$msg = rebuild_all_accessfiles(); |
| 873 | 885 |
|
| 874 |
echo implode ('<br />',$msg);
|
|
| 886 |
echo '<strong>'.implode ('<br />',$msg).'</strong>';
|
|
| 875 | 887 |
echo '</div>'; |
| 888 |
|
|
| 876 | 889 |
/* ***************************************************************************** |
| 877 | 890 |
* - check for deprecated / never needed files |
| 878 | 891 |
*/ |
| ... | ... | |
| 921 | 934 |
echo '<form action="'.$_SERVER['SCRIPT_NAME'].'">'; |
| 922 | 935 |
echo ' <input name="send" type="submit" value="Restart upgrade script" />'; |
| 923 | 936 |
echo '</form>'; |
| 924 |
echo "<br /><br /></div> |
|
| 925 |
</div> |
|
| 926 |
</div> |
|
| 927 |
</body> |
|
| 928 |
</html> |
|
| 929 |
"; |
|
| 937 |
echo "<br /><br /></div> |
|
| 938 |
</div> |
|
| 939 |
</div> |
|
| 940 |
</body> |
|
| 941 |
</html>"; |
|
| 930 | 942 |
exit; |
| 931 | 943 |
} |
| 932 | 944 |
} |
| ... | ... | |
| 973 | 985 |
echo '<form action="'.$_SERVER['SCRIPT_NAME'].'">'; |
| 974 | 986 |
echo ' <input name="send" type="submit" value="Restart upgrade script" />'; |
| 975 | 987 |
echo '</form>'; |
| 976 |
echo "<br /><br /></div> |
|
| 977 |
</div> |
|
| 978 |
</div> |
|
| 979 |
</body> |
|
| 980 |
</html> |
|
| 981 |
"; |
|
| 988 |
echo "<br /><br /></div> |
|
| 989 |
</div> |
|
| 990 |
</div> |
|
| 991 |
</body> |
|
| 992 |
</html>"; |
|
| 982 | 993 |
exit; |
| 983 | 994 |
} |
| 984 | 995 |
} |
| ... | ... | |
| 988 | 999 |
* $aModuleList list of proofed modules |
| 989 | 1000 |
*/ |
| 990 | 1001 |
$aModuleList = array('news','wysiwyg','form');
|
| 991 |
echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>'; |
|
| 992 |
foreach($aModuleList as $sModul) {
|
|
| 993 |
if(file_exists(WB_PATH.'/modules/'.$sModul.'/upgrade.php')) {
|
|
| 994 |
$currModulVersion = get_modul_version ($sModul, false); |
|
| 995 |
$newModulVersion = get_modul_version ($sModul, true); |
|
| 996 |
if((version_compare($currModulVersion, $newModulVersion) <= 0)) {
|
|
| 997 |
echo '<div style="margin-left:2em;">'; |
|
| 998 |
echo '<h4>'.'Upgrade module \''.$sModul.'\' version '.$newModulVersion.'</h4>'; |
|
| 999 |
require_once(WB_PATH.'/modules/'.$sModul.'/upgrade.php'); |
|
| 1000 |
echo '</div>'; |
|
| 1002 |
if(sizeof($aModuleList)) |
|
| 1003 |
{
|
|
| 1004 |
echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>'; |
|
| 1005 |
foreach($aModuleList as $sModul) {
|
|
| 1006 |
if(file_exists(WB_PATH.'/modules/'.$sModul.'/upgrade.php')) {
|
|
| 1007 |
$currModulVersion = get_modul_version ($sModul, false); |
|
| 1008 |
$newModulVersion = get_modul_version ($sModul, true); |
|
| 1009 |
if((version_compare($currModulVersion, $newModulVersion) <= 0)) {
|
|
| 1010 |
echo '<div style="margin-left:2em;">'; |
|
| 1011 |
echo '<h4>'.'Upgrade module \''.$sModul.'\' version '.$newModulVersion.'</h4>'; |
|
| 1012 |
require(WB_PATH.'/modules/'.$sModul.'/upgrade.php'); |
|
| 1013 |
echo '</div>'; |
|
| 1014 |
} |
|
| 1001 | 1015 |
} |
| 1002 | 1016 |
} |
| 1003 | 1017 |
} |
| 1004 | 1018 |
|
| 1019 |
/********************************************************** |
|
| 1020 |
* Reformat/rebuild all existing moules access files |
|
| 1021 |
* $aModuleList list of modules |
|
| 1022 |
*/ |
|
| 1023 |
$aModuleList = array('bakery','topics','news');
|
|
| 1024 |
if(sizeof($aModuleList)) |
|
| 1025 |
{
|
|
| 1026 |
echo '<h3>Step '.(++$stepID).': Create/Reorg Accessfiles from modules</h3>'; |
|
| 1027 |
foreach($aModuleList as $sModul) {
|
|
| 1028 |
$aReturnMsg = array(); |
|
| 1029 |
$sModulReorg = 'm_'.$sModul.'_Reorg'; |
|
| 1030 |
if(class_exists($sModulReorg)) {
|
|
| 1031 |
$sModulVersion = get_modul_version ($sModul, true); |
|
| 1032 |
echo '<div style="margin-left:2em;">'; |
|
| 1033 |
echo '<h4>'.'Create/Reorg Accesfiles for module \''.$sModul.'\' version '.$sModulVersion.'</h4>'; |
|
| 1034 |
$oReorg = new $sModulReorg(); |
|
| 1035 |
$aReturnMsg = $oReorg->execute(); // show details |
|
| 1036 |
if($bDebugModus && is_array($aReturnMsg)) {
|
|
| 1037 |
foreach($aReturnMsg as $title) {
|
|
| 1038 |
echo '<strong>'.$title.'</strong><br />'; |
|
| 1039 |
} |
|
| 1040 |
} |
|
| 1041 |
echo '</div>'; |
|
| 1042 |
} |
|
| 1043 |
} |
|
| 1044 |
} |
|
| 1005 | 1045 |
/********************************************************** |
| 1006 | 1046 |
* - Reload all addons |
| 1007 | 1047 |
*/ |
| ... | ... | |
| 1023 | 1063 |
} |
| 1024 | 1064 |
closedir($handle); |
| 1025 | 1065 |
} |
| 1026 |
echo '<span><strong>'.$iLoaded.' Modules reloaded,</span> found '.$iFound.' directories in folder /modules/</strong><br />';
|
|
| 1066 |
echo '<strong><span>'.$iLoaded.' Modules reloaded,</span> found '.$iFound.' directories in folder /modules/</strong><br />';
|
|
| 1027 | 1067 |
|
| 1028 | 1068 |
$iFound = 0; |
| 1029 | 1069 |
$iLoaded = 0; |
| ... | ... | |
| 1041 | 1081 |
} |
| 1042 | 1082 |
closedir($handle); |
| 1043 | 1083 |
} |
| 1044 |
echo '<span><strong>'.$iLoaded.' Templates reloaded,</span> found '.$iFound.' directories in folder /templates/</strong><br />';
|
|
| 1084 |
echo '<strong><span>'.$iLoaded.' Templates reloaded,</span> found '.$iFound.' directories in folder /templates/</strong><br />';
|
|
| 1045 | 1085 |
|
| 1046 | 1086 |
$iFound = 0; |
| 1047 | 1087 |
$iLoaded = 0; |
| ... | ... | |
| 1057 | 1097 |
} |
| 1058 | 1098 |
closedir($handle); |
| 1059 | 1099 |
} |
| 1060 |
echo '<span><strong>'.$iLoaded.' Languages reloaded,</span> found '.$iFound.' files in folder /languages/</strong><br />';
|
|
| 1100 |
echo '<strong><span>'.$iLoaded.' Languages reloaded,</span> found '.$iFound.' files in folder /languages/</strong><br />';
|
|
| 1061 | 1101 |
echo '</div>'; |
| 1062 | 1102 |
|
| 1063 | 1103 |
/********************************************************** |
Also available in: Unified diff
! framework/functions.php set function create_access_file to deprecated
! set ModLanguage.php to deprecated
! add methode escapeString to class WbDatabase
! update upgrade-script.php
! add getter property LastInsertId to class WbDatabase