Project

General

Profile

« Previous | Next » 

Revision 2097

Added by darkviper almost 11 years ago

  1. droplet >> [[SiteModified]] typo corrected
    ! upgrade-script.php >> new classes activated and little corrections
    ! WbAdaptor::getWbConstants() >> PageIconDir added

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
===============================================================================
13 13

  
14
11 Feb-2014 Build 2097 Manuela v.d.Decken(DarkViper)
15
# droplet >> [[SiteModified]]  typo corrected
16
! upgrade-script.php >> new classes activated and little corrections
17
! WbAdaptor::getWbConstants() >> PageIconDir added
14 18
03 Feb-2014 Build 2096 Manuela v.d.Decken(DarkViper)
15 19
+ Translate::enablePrivateTable() allows to add more private language definitions
16 20
+ Translate::disablePrivateTable()
branches/2.8.x/wb/upgrade-script.php
34 34
 * @deprecated   
35 35
 * @description  xyz
36 36
 */
37
include_once(dirname(__FILE__).'/framework/UpgradeHelper.php');
38 37
// PHP less then 5.3.2 is prohibited ---
39 38
if (version_compare(PHP_VERSION, '5.3.2', '<')) {
40 39
    $sMsg = '<p style="color: #ff0000;">WebsiteBaker 2.8.4 and above is not able to run with PHP-Version less then 5.3.2!!<br />'
......
43 42
          . 'The very best solution is the use of PHP-5.4 and up</p>';
44 43
    die($sMsg);
45 44
}
45
// --- load UpgradeHelper ---
46
if (!class_exists('UpgradeHelper', false)) {
47
    require(__DIR__.'/framework/UpgradeHelper.php');
48
}
46 49
// --- delete fatal disturbing files before upgrade starts -------------------------------
47 50
$aPreDeleteFiles = array(
48 51
// list of files
49 52
	dirname(__FILE__).'/framework/PasswordHash.php'
50 53
);
51
if(sizeof($aPreDeleteFiles > 0))
52
{
54
$sMsg = '';
55
if (sizeof($aPreDeleteFiles > 0)) {
53 56
// if there are files defined
54
	$sMsg = '';
55
	foreach($aPreDeleteFiles as $sFileToDelete)
56
	{
57
	foreach ($aPreDeleteFiles as $sFileToDelete) {
57 58
	// iterate the list
58
		if(file_exists($sFileToDelete))
59
		{
60
			if(!is_writeable($sFileToDelete) || !@unlink($sFileToDelete))
61
			{
59
		if (file_exists($sFileToDelete)) {
60
			if (!is_writeable($sFileToDelete) || !@unlink($sFileToDelete)) {
62 61
			// notice if deleting fails
63 62
				$sMsg .= '<span style="color:red;">FAILED</span> deleting: '
64 63
				       . $sFileToDelete.'<br />'.PHP_EOL;
65 64
			}
66 65
		}
67 66
	}
68
	if($sMsg) {
67
	if ($sMsg) {
69 68
	// stop script if there's an error occured
70
		$sMsg = $sMsg.'<br />'.PHP_EOL.'Please delete all of the files above manually!';
71
		UpgradeHelper::dieWithMessage($sMsg);
69
		$sMsg .= '<br />'.PHP_EOL.'Please delete all of the files above manually!';
70
		$sMsg .= '<br />'.PHP_EOL.'----------------------------------------------';
72 71
	}
73 72
}
73
if ($sMsg) {
74
// stop script if there's an error occured
75
    $sMsg = $sMsg.'<br />'.PHP_EOL.'Please delete all of the files above manually!';
76
    UpgradeHelper::dieWithMessage($sMsg);
77
}
74 78
unset($aPreDeleteFiles);
75 79
$sMsg = '';
76 80
// ---------------------------------------------------------------------------------------
77 81
// Include config file
78
$config_file = dirname(__FILE__).'/config.php';
82
$config_file = __DIR__.'/config.php';
79 83
if (is_readable($config_file) && !defined('WB_URL')) {
80 84
	require_once($config_file);
81 85
}
86
$oDb  = WbDatabase::getInstance();
82 87
$oReg = WbAdaptor::getInstance();
83
UpgradeHelper::checkSetupFiles(dirname(__FILE__).'/');
84

  
85
if (!class_exists('admin', false)) {
86
	include(WB_PATH.'/framework/class.admin.php');
88
UpgradeHelper::checkSetupFiles(str_replace('\\', '/', __DIR__).'/');
89
// --- set DEFAULT_THEME and restart if needed -------------------------------------------
90
if (isset($oReg->DefaultTheme) && $oReg->DefaultTheme != 'WbTheme') {
91
    db_update_key_value('settings', 'default_theme', 'WbTheme');
92
    $sLocation = 'Location: '.$oReg->AppUrl.filename(__FILE__);
93
    header($sLocation);
94
    exit;
87 95
}
96
// ---------------------------------------------------------------------------------------
97
//if (!class_exists('admin', false)) {
98
//	include(WB_PATH.'/framework/class.admin.php');
99
//}
88 100
$admin = new admin('Addons', 'modules', false, false);
89 101
// solved wrong pages_directory value before creating access files
90 102
$sql  = 'SELECT `value` FROM `'.TABLE_PREFIX.'settings` '
91 103
      . 'WHERE `name`=\'pages_directory\'';
92
$sPagesDirectory = WbDatabase::getInstance()->get_one($sql);
104
$sPagesDirectory = $oDb->getOne($sql);
93 105
$sTmp = trim($sPagesDirectory, '/');
94 106
$sTmpDir = ($sTmp == '' ? '' : '/'.$sTmp);
95 107
if($sTmp != $sPagesDirectory) {
96
	$sql = 'UPDATE `'.TABLE_PREFIX.'settings` '
97
		 . 'SET `value` = \''.$sTmpDir.'\' '
108
	$sql = 'UPDATE `'.$oDb->TablePrefix.'settings` '
109
		 . 'SET `value`=\''.$sTmpDir.'\' '
98 110
		 . 'WHERE `name`=\'pages_directory\' ';
99
	WbDatabase::getInstance()->query($sql);
111
	$oDb->doQuery($sql);
112
//	WbDatabase::getInstance()->query($sql);
100 113
}
101 114
require_once(WB_PATH.'/framework/functions.php');
102 115
// require_once(WB_PATH.'/framework/Database.php');
......
1113 1126
	$iFound = 0;
1114 1127
	$iLoaded = 0;
1115 1128
	////delete templates
1116
	//$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'template'");
1129
	$oDb->doQuery('DELETE FROM `'.$oDb->TablePrefix.'addons` WHERE `type`=\'template\'');
1117 1130
	// Load all templates
1118 1131
	if( ($handle = opendir(WB_PATH.'/templates/')) ) {
1119 1132
		while(false !== ($file = readdir($handle))) {
1120 1133
			if($file != '' AND substr($file, 0, 1) != '.' AND $file != 'index.php') {
1121

  
1122 1134
				$iFound++;
1123 1135
				$iLoaded = (load_template(WB_PATH.'/templates/'.$file)==true) ? $iLoaded+1 : $iLoaded;
1124

  
1125 1136
			}
1126 1137
		}
1127 1138
		closedir($handle);
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.4');
54
if(!defined('REVISION')) define('REVISION', '2096');
54
if(!defined('REVISION')) define('REVISION', '2097');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/framework/WbAdaptor.php
184 184
					$sKey = 'DefaultTemplate';
185 185
					$this->_aSys['Request'][$sKey] = $sVal; 
186 186
					break;
187
				case 'TEMPLATE':
188
					$sVal = trim(str_replace('\\', '/', $sVal), '/').'/';
189
					$sKey = 'Template';
190
					$this->_aSys['Request'][$sKey] = $sVal;
191
					break;
187 192
				case 'DEFAULT_THEME':
188 193
					$sVal = trim(str_replace('\\', '/', $sVal), '/').'/';
189 194
					$sKey = 'DefaultTheme';
......
211 216
					$sKey = 'AppServicePack';
212 217
					$this->_aSys['System'][$sKey] = $sVal; 
213 218
					break;
219
                case 'PAGE_ICON_DIR':
220
                    $sKey = 'PageIconDir';
221
					$sVal = trim(str_replace('\\', '/', $sVal), '/').'/';
222
                    if (!isset($this->_aSys['Request']['Template'])) {
223
                        $this->_aSys['Request']['Template'] = $this->_aSys['Request']['DefaultTemplate'];
224
                    }
225
                    $sVal = str_replace('/*/', '/'.$this->_aSys['Request']['Template'], $sVal);
226
					$this->_aSys['System'][$sKey] = $sVal;
227
                    break;
214 228
				default:
215 229
					$sVal = ($sVal == 'true' ? true : ($sVal == 'false' ? false : $sVal));
216 230
					$sKey = str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($sKey))));
branches/2.8.x/wb/modules/droplets/example/SiteModified.php
1
<?php
2 1
//:Create information on when your site was last updated.
3 2
//:Create information on when your site was last updated. Any page update counts.
4 3
$sRetval = '';

Also available in: Unified diff