Project

General

Profile

« Previous | Next » 

Revision 1870

Added by Dietmar almost 12 years ago

  1. solved installation issues
    ! upgrade-script sanitize pages_directory before creating access files

View differences:

upgrade-script.php
39 39
if(file_exists($config_file) && !defined('WB_URL'))
40 40
{
41 41
	require($config_file);
42

  
42 43
}
43

  
44
// solved wrong pages_directory value before creating access files
45
$sql  = 'SELECT `value` FROM `'.TABLE_PREFIX.'settings` ';
46
$sql .= 'WHERE `name`=\'pages_directory\' ';
47
$sTmpDir = WbDatabase::getInstance()->get_one($sql);
48
$sTmpDir = ( (strpos($sTmpDir,'/',0)===false) && (strlen($sTmpDir)>1)  ? '/'.$sTmpDir : rtrim($sTmpDir,'/') );
49
$sPagesDir = defined('PAGES_DIRECTORY') ? PAGES_DIRECTORY : '';
50
if(($sTmpDir != $sPagesDir)) {
51
	$sql = 'UPDATE `'.TABLE_PREFIX.'settings` SET '
52
		.  '`value` = \''.$sTmpDir.'\' '
53
		.  'WHERE `name`=\'pages_directory\' ';
54
	if(!WbDatabase::getInstance()->query($sql) ) {}
55
}
44 56
//require_once(WB_PATH.'/framework/class.admin.php');
45 57
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
46 58
require_once(WB_PATH.'/framework/functions.php');
......
59 71
// set addition settings if not exists, otherwise upgrade will be breaks
60 72
if(!defined('WB_SP')) { define('WB_SP',''); }
61 73
if(!defined('WB_REVISION')) { define('WB_REVISION',''); }
62

  
63 74
// database tables including in WB package
64 75
$aPackage = array (
65 76
    'settings','groups','addons','pages','sections','search','users',
......
358 369
<p class="info">This script upgrades an existing WebsiteBaker <strong> <?php echo $oldRevision; ?></strong> installation to the <strong> <?php echo $newRevision ?> </strong>.<br />The upgrade script alters the existing WB database to reflect the changes introduced with WB 2.8.x</p>
359 370

  
360 371
<?php
372

  
361 373
/**
362 374
 * Check if disclaimer was accepted
363 375
 */

Also available in: Unified diff