Index: branches/5.0.x/core/kernel/startup.php =================================================================== diff -u -r12199 -r12202 --- branches/5.0.x/core/kernel/startup.php (.../startup.php) (revision 12199) +++ branches/5.0.x/core/kernel/startup.php (.../startup.php) (revision 12202) @@ -1,6 +1,6 @@ Don\'t forget to clean Cache table afterwards'); - } if (!function_exists('getmicrotime')) { function getmicrotime() @@ -93,15 +90,15 @@ define('MODULES_PATH', FULL_PATH); - define('EXPORT_BASE_PATH', (defined('WRITEBALE_BASE') ? WRITEBALE_BASE : ADMIN_DIRECTORY) . '/export'); + define('EXPORT_BASE_PATH', WRITEBALE_BASE . '/export'); define('EXPORT_PATH', FULL_PATH . EXPORT_BASE_PATH); define('GW_CLASS_PATH', MODULES_PATH . '/in-commerce/units/gateways/gw_classes'); // Payment Gateway Classes Path define('SYNC_CLASS_PATH', FULL_PATH . '/sync'); // path for 3rd party user syncronization scripts safeDefine('ENV_VAR_NAME','env'); - define('IMAGES_PATH', (defined('WRITEBALE_BASE') ? WRITEBALE_BASE : '/kernel') . '/images/'); + define('IMAGES_PATH', WRITEBALE_BASE . '/images/'); define('IMAGES_PENDING_PATH', IMAGES_PATH . 'pending/'); safeDefine('MAX_UPLOAD_SIZE', min(ini_get('upload_max_filesize'), ini_get('post_max_size'))*1024*1024); Index: branches/5.0.x/core/kernel/session/session.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/kernel/session/session.php (.../session.php) (revision 12117) +++ branches/5.0.x/core/kernel/session/session.php (.../session.php) (revision 12202) @@ -1,6 +1,6 @@ _filename = (defined('WRITEABLE') ? WRITEABLE.'/cache' : FULL_PATH.'/kernel/cache') . '/' . $filename; + $this->_filename = WRITEABLE . '/cache' . '/' . $filename; if (file_exists($this->_filename)) { $cache_data = unserialize(file_get_contents($this->_filename)); Index: branches/5.0.x/core/units/fck/fck_tp.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/units/fck/fck_tp.php (.../fck_tp.php) (revision 12117) +++ branches/5.0.x/core/units/fck/fck_tp.php (.../fck_tp.php) (revision 12202) @@ -1,6 +1,6 @@ Application->GetVar('folder'); - $files_dir = WRITEABLE."/user_files/".$params['folder']."/"; - $files_url = BASE_PATH.WRITEBALE_BASE."/user_files/".$params['folder']."/"; + $files_dir = WRITEABLE . "/user_files/" . $params['folder'] . "/"; + $files_url = BASE_PATH . WRITEBALE_BASE . "/user_files/" . $params['folder']."/"; $aFiles = $this->ReadFiles($files_dir); $block_params = $this->prepareTagParams($params); $block_params['name'] = $block_params['render_as']; Index: branches/5.0.x/core/units/general/helpers/fck_helper.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/units/general/helpers/fck_helper.php (.../fck_helper.php) (revision 12117) +++ branches/5.0.x/core/units/general/helpers/fck_helper.php (.../fck_helper.php) (revision 12202) @@ -1,6 +1,6 @@ Application->GetVar('sort_by'); $folder = $this->Application->GetVar('folder'); - $files_dir = WRITEABLE."/user_files/".$folder."/"; - $files_url = BASE_PATH.WRITEBALE_BASE."/user_files/".$folder."/"; + $files_dir = WRITEABLE . "/user_files/" . $folder."/"; + $files_url = BASE_PATH . WRITEBALE_BASE . "/user_files/" . $folder . "/"; $aFiles = $this->ReadFiles($files_dir); $ret = ''; $date_format = "m/d/Y h:i A"; Index: branches/5.0.x/core/units/skins/skin_eh.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 12117) +++ branches/5.0.x/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 12202) @@ -1,6 +1,6 @@ GetDBField('Name')).'-'.$compile_ts.'.css'; Index: branches/5.0.x/core/units/admin/admin_events_handler.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 12117) +++ branches/5.0.x/core/units/admin/admin_events_handler.php (.../admin_events_handler.php) (revision 12202) @@ -1,6 +1,6 @@ Application->GetVar('Filedata'); if (!$value) return ; - $tmp_path = WRITEABLE.'/tmp/'; + $tmp_path = WRITEABLE . '/tmp/'; $fname = $value['name']; $id = $this->Application->GetVar('id'); if ($id) $fname = $id.'_'.$fname; Index: branches/5.0.x/core/units/fck/fck_eh.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 12117) +++ branches/5.0.x/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 12202) @@ -1,6 +1,6 @@ Application->GetVar('old_name'); $new_name = $this->Application->GetVar('new_name'); $folder = $this->Application->GetVar('folder'); - $sServerDir = WRITEABLE.'/user_files/'.$folder.'/'; + $sServerDir = WRITEABLE . '/user_files/' . $folder . '/'; if (!file_exists($sServerDir.$old_name) || !is_file($sServerDir.$old_name)) { echo 204; @@ -136,7 +136,7 @@ // echo $files; $a_files = explode('|', $files); $folder = $this->Application->GetVar('folder'); - $sServerDir = WRITEABLE.'/user_files/'.$folder.'/'; + $sServerDir = WRITEABLE . '/user_files/' . $folder . '/'; foreach ($a_files AS $file) { @unlink($sServerDir.$file); @@ -167,7 +167,7 @@ $new_folder = $this->Application->GetVar('new_folder'); $current_folder = $this->Application->GetVar('current_folder'); - $folderPath = WRITEABLE.'/user_files'.'/'.$current_folder."/".$new_folder; + $folderPath = WRITEABLE . '/user_files' . '/' . $current_folder . "/" . $new_folder; if ( file_exists( $folderPath ) && is_dir($folderPath)) { echo "101"; } Index: branches/5.0.x/core/units/stylesheets/stylesheets_item.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/units/stylesheets/stylesheets_item.php (.../stylesheets_item.php) (revision 12117) +++ branches/5.0.x/core/units/stylesheets/stylesheets_item.php (.../stylesheets_item.php) (revision 12202) @@ -1,6 +1,6 @@ GetDBField('AdvancedCSS'); $compile_ts = adodb_mktime(); - $css_path = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH . '/kernel') . '/stylesheets/'; + $css_path = WRITEABLE . '/stylesheets/'; $css_file = $css_path.mb_strtolower($this->GetDBField('Name')).'-'.$compile_ts.'.css'; Index: branches/5.0.x/core/kernel/parser/template.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/kernel/parser/template.php (.../template.php) (revision 12117) +++ branches/5.0.x/core/kernel/parser/template.php (.../template.php) (revision 12202) @@ -1,6 +1,6 @@ GetRealFilename($template); $fname = $real_name.'.php'; - $fname = str_replace(FULL_PATH, defined('WRITEABLE') ? WRITEABLE.'/cache' : FULL_PATH.'/kernel/cache', $fname); + $fname = str_replace(FULL_PATH, WRITEABLE . '/cache', $fname); $tname = $real_name.'.tpl'; if (!file_exists($tname)) { @@ -259,7 +259,7 @@ } if (!file_exists($fname)) { // make sure to create directory if pre-parsed file does not exist - $this->CheckDir(dirname($fname), defined('WRITEABLE') ? WRITEABLE.'/cache' : FULL_PATH.'/kernel/cache'); + $this->CheckDir( dirname($fname), WRITEABLE . '/cache' ); } } return array('active' => 0, 'fname' => $fname, 'tname' => $tname, 'mode'=>'file'); Index: branches/5.0.x/core/kernel/utility/debugger.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/kernel/utility/debugger.php (.../debugger.php) (revision 12117) +++ branches/5.0.x/core/kernel/utility/debugger.php (.../debugger.php) (revision 12202) @@ -1,6 +1,6 @@ baseURL = PROTOCOL.SERVER_NAME.rtrim(BASE_PATH, '/').$kernel_path.'/utility/debugger'; // save debug output in this folder - $this->tempFolder = defined('WRITEABLE') ? WRITEABLE.'/cache' : FULL_PATH.'/kernel/cache'; + $this->tempFolder = WRITEABLE . '/cache'; } function mapLongError($msg) @@ -433,7 +433,7 @@ else { $ret .= 'Runtime: '.$runtime.'s
'; }*/ - + $ret .= ''; $ret .= '
'; Index: branches/5.0.x/core/kernel/utility/formatters/upload_formatter.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 12117) +++ branches/5.0.x/core/kernel/utility/formatters/upload_formatter.php (.../upload_formatter.php) (revision 12202) @@ -1,6 +1,6 @@ ValidateFileName($this->FullPath, $real_name, $files2delete); $file_name = $this->FullPath.$real_name; - $tmp_file = (defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/').$swf_uploaded_ids[$i].'_'.$swf_uploaded_names[$i]; + $tmp_file = WRITEABLE . '/tmp/' . $swf_uploaded_ids[$i].'_'.$swf_uploaded_names[$i]; rename($tmp_file, $file_name); @chmod($file_name, 0666); Index: branches/5.0.x/core/kernel/constants.php =================================================================== diff -u -r12159 -r12202 --- branches/5.0.x/core/kernel/constants.php (.../constants.php) (revision 12159) +++ branches/5.0.x/core/kernel/constants.php (.../constants.php) (revision 12202) @@ -1,6 +1,6 @@ _directorySeparator = preg_quote(DIRECTORY_SEPARATOR); + $this->_directorySeparator = preg_quote( DIRECTORY_SEPARATOR ); $this->_skipFolders[] = trim(WRITEBALE_BASE, '/'); // system folder (where web server can write) $this->_skipFolders[] = array_pop( explode('/', trim(EDITOR_PATH, '/')) ); // last of cmseditor folders } @@ -257,27 +257,22 @@ $conn =& $this->Application->GetADODBConnection(); if (!isset($this->Application->Memcached) || !($data = $this->Application->Memcached->get('master:config_files'))) { - $data = $conn->GetOne('SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files"'); + $data = $conn->GetOne('SELECT Data FROM ' . TABLE_PREFIX . 'Cache WHERE VarName = "config_files"'); } + if ($cache && $data) { $this->configFiles = unserialize($data); shuffle($this->configFiles); } else { - $old_kernel_path = FULL_PATH . DIRECTORY_SEPARATOR . 'kernel' . DIRECTORY_SEPARATOR . 'kernel4'; - if (file_exists($old_kernel_path)) { - // when we got both kernel (one from "kernel/kernel4" and other from "core/kernel") version after upgrade - die('Please remove "' . $old_kernel_path . '" folder.'); - } - $this->findConfigFiles($folderPath); // search from base directory } foreach ($this->configFiles as $filename) { $prefix = $this->PreloadConfigFile($filename); if (!$prefix) { - trigger_error('Prefix not defined in config file '.$filename, E_USER_ERROR); + trigger_error('Prefix not defined in config file ' . $filename, E_USER_ERROR); } } } Index: branches/5.0.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -r12193 -r12202 --- branches/5.0.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12193) +++ branches/5.0.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12202) @@ -1,6 +1,6 @@ Application->GetVar('id'); if ($id) { @@ -2395,7 +2395,7 @@ { if (strpos($this->Application->GetVar('file'), '../') !== false) return ; if ($this->Application->GetVar('tmp')) { - $path = (defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/').$this->Application->GetVar('id').'_'.$this->Application->GetVar('file'); + $path = WRITEABLE . '/tmp/' . $this->Application->GetVar('id') . '_' . $this->Application->GetVar('file'); } else { $object =& $event->getObject(array('skip_autoload'=>true)); Index: branches/5.0.x/core/units/themes/themes_tag_processor.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/units/themes/themes_tag_processor.php (.../themes_tag_processor.php) (revision 12117) +++ branches/5.0.x/core/units/themes/themes_tag_processor.php (.../themes_tag_processor.php) (revision 12202) @@ -1,6 +1,6 @@ Application->BaseURL((defined('WRITEBALE_BASE') ? WRITEBALE_BASE : '/kernel') . '/stylesheets'); - $css_path = rtrim( str_replace( $this->Application->BaseURL(), FULL_PATH.'/', $css_url), '/' ); + $css_url = $this->Application->BaseURL(WRITEBALE_BASE . '/stylesheets'); + $css_path = rtrim( str_replace( $this->Application->BaseURL(), FULL_PATH . '/', $css_url), '/' ); $last_compiled = $object->GetDBField('LastCompiled'); Index: branches/5.0.x/core/units/help/help_tag_processor.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/units/help/help_tag_processor.php (.../help_tag_processor.php) (revision 12117) +++ branches/5.0.x/core/units/help/help_tag_processor.php (.../help_tag_processor.php) (revision 12202) @@ -1,6 +1,6 @@ Value = $help_data; $oFCKeditor->Config = Array( - 'UserFilesPath' => (defined('WRITEABLE') ? WRITEABLE : FULL_PATH.'/kernel') . '/user_files', + 'UserFilesPath' => WRITEABLE . '/user_files', 'ProjectPath' => $this->Application->ConfigValue('Site_Path'), 'CustomConfigurationsPath' => rtrim( $this->Application->BaseURL('/admin/editor/inp_fckconfig.js'), '/'), ); Index: branches/5.0.x/core/units/admin/admin_tag_processor.php =================================================================== diff -u -r12117 -r12202 --- branches/5.0.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12117) +++ branches/5.0.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12202) @@ -1,6 +1,6 @@ Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Skins WHERE IsPrimary = 1'); } - $css_path = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH. DIRECTORY_SEPARATOR . 'kernel') . DIRECTORY_SEPARATOR . 'user_files'; - $css_url = $this->Application->BaseURL(defined('WRITEBALE_BASE') ? str_replace(DIRECTORY_SEPARATOR, '/', WRITEBALE_BASE) : '/kernel') . 'user_files/'; + $css_path = WRITEABLE . DIRECTORY_SEPARATOR . 'user_files'; + $css_url = $this->Application->BaseURL( str_replace(DIRECTORY_SEPARATOR, '/', WRITEBALE_BASE) ) . 'user_files/'; $type = array_key_exists('type', $params) ? $params['type'] : false; if ($type == 'logo') { @@ -826,7 +826,7 @@ $style_name = mb_strtolower( $style['Name'] ); - if( file_exists($css_path.'/'.'admin-'.$style_name.'-'.$last_compiled.'.css') ) + if( file_exists($css_path . '/' . 'admin-' . $style_name . '-' . $last_compiled . '.css') ) { $ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css';