Index: install.php
===================================================================
--- install.php (revision 14817)
+++ install.php (working copy)
@@ -74,6 +74,7 @@
'upgrade' => Array ('check_paths', 'install_setup', 'upgrade_modules', 'skin_upgrade', 'security', 'finish'),
'update_license' => Array ('check_paths', 'install_setup', 'select_license', /*'download_license',*/ 'select_domain', 'security', 'finish'),
+ 'sys_config' => Array ('check_paths', 'install_setup', 'sys_config', 'security', 'finish'),
'db_reconfig' => Array ('check_paths', 'install_setup', 'db_reconfig', 'security', 'finish'),
'fix_paths' => Array ('check_paths', 'install_setup', 'fix_paths', 'security', 'finish'),
);
@@ -169,18 +170,10 @@
$this->writeableFolders[] = $this->toolkit->defaultWritablePath . '/config.php';
}
- if ( !$this->toolkit->getSystemConfig('Misc', 'WriteablePath') ) {
- $this->toolkit->setSystemConfig('Misc', 'WriteablePath', $this->toolkit->defaultWritablePath);
- }
-
if ( !$this->toolkit->getSystemConfig('Misc', 'RestrictedPath') ) {
$this->toolkit->setSystemConfig('Misc', 'RestrictedPath', $this->toolkit->getSystemConfig('Misc', 'WriteablePath') . DIRECTORY_SEPARATOR . '.restricted');
}
- if ( !$this->toolkit->getSystemConfig('Misc', 'WebsitePath') ) {
- $this->toolkit->setSystemConfig('Misc', 'WebsitePath', $base_path);
- }
-
if ( $this->toolkit->systemConfigChanged ) {
// immediately save, because this paths will be used in kApplication class later
$this->toolkit->SaveConfig(true);
@@ -278,6 +271,11 @@
switch ($this->currentStep) {
case 'check_paths':
$writeable_base = $this->toolkit->getSystemConfig('Misc', 'WriteablePath');
+
+ if (!$writeable_base) {
+ $writeable_base = $this->toolkit->defaultWritablePath;
+ }
+
foreach ($this->writeableFolders as $folder_path) {
$file_path = FULL_PATH . str_replace('$1', $writeable_base, $folder_path);
if (file_exists($file_path) && !is_writable($file_path)) {
@@ -801,6 +799,82 @@
}
break;
+ case 'sys_config':
+ $website_path = $this->GetVar('website_path');
+
+ if (!$website_path || $website_path == $this->toolkit->defaultWebsitePath) {
+ unset($website_path);
+ }
+
+ $this->toolkit->setSystemConfig('Misc', 'WebsitePath', $website_path);
+
+ $writeable_path = $this->GetVar('writeable_path');
+
+ if (!$writeable_path || $writeable_path == $this->toolkit->defaultWritablePath) {
+ unset($writeable_path);
+ }
+
+ $this->toolkit->setSystemConfig('Misc', 'WriteablePath', $writeable_path);
+
+ $admin_directory = $this->GetVar('admin_directory');
+
+ if (!$admin_directory || $admin_directory == '/admin') {
+ unset($admin_directory);
+ }
+
+ $this->toolkit->setSystemConfig('Misc', 'AdminDirectory', $admin_directory);
+
+ $admin_presets_directory = $this->GetVar('admin_directory');
+
+ if (!$admin_presets_directory || $admin_presets_directory == '/admin') {
+ unset($admin_presets_directory);
+ }
+
+ $this->toolkit->setSystemConfig('Misc', 'AdminPresetsDirectory', $admin_presets_directory);
+
+ $application_class = $this->GetVar('application_class');
+
+ if (!$application_class || $application_class == 'kApplication') {
+ unset($application_class);
+ }
+
+ $this->toolkit->setSystemConfig('Misc', 'ApplicationClass', $application_class);
+
+ $application_path = $this->GetVar('application_path');
+
+ if (!$application_path || $application_path == '/core/kernel/application.php') {
+ unset($application_path);
+ }
+
+ $this->toolkit->setSystemConfig('Misc', 'ApplicationPath', $application_path);
+
+ $cache_handler = $this->GetVar('cache_handler');
+
+ if (!$cache_handler) {
+ unset($cache_handler);
+ }
+
+ $this->toolkit->setSystemConfig('Misc', 'CacheHandler', $cache_handler);
+
+ $memcache_servers = $this->GetVar('memcache_servers');
+
+ if (!$memcache_servers || $memcache_servers == 'localhost:11211') {
+ unset($memcache_servers);
+ }
+
+ $this->toolkit->setSystemConfig('Misc', 'MemcacheServers', $memcache_servers);
+
+ $compression_engine = $this->GetVar('compression_engine');
+
+ if (!$compression_engine) {
+ unset($compression_engine);
+ }
+
+ $this->toolkit->setSystemConfig('Misc', 'CompressionEngine', $compression_engine);
+
+ $this->toolkit->SaveConfig();
+ break;
+
case 'root_password':
// update root password in database
$password = md5( md5($this->Application->GetVar('root_password')) . 'b38');
@@ -1008,11 +1082,11 @@
return ;
}
+ $this->InitApplication();
+
$this->currentStep = $this->GetNextStep();
$this->InitStep(); // init next step (that will be shown now)
- $this->InitApplication();
-
if ($this->currentStep == -1) {
// step after last step -> redirect to admin
$this->Application->Redirect('index', Array (), '', 'index.php');
@@ -1225,6 +1299,12 @@
$this->Conn =& $this->Application->GetADODBConnection();
$this->toolkit->Conn =& $this->Application->GetADODBConnection();
}
+
+ if ($this->Application && $this->Application->isDebugMode()) {
+ // add "System Configuration" installation step
+ $this->steps['fresh_install'] = Array ('check_paths', 'db_config', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'sys_config', 'select_theme', 'security', 'finish');
+ $this->steps['clean_reinstall'] = Array ('check_paths', 'clean_db', 'db_config', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'sys_config', 'select_theme', 'security', 'finish');
+ }
}
/**
Index: install/install_toolkit.php
===================================================================
--- install/install_toolkit.php (revision 14817)
+++ install/install_toolkit.php (working copy)
@@ -90,6 +90,12 @@
var $defaultWritablePath = '';
/**
+ *
+ * @var string
+ */
+ var $defaultWebsitePath = '';
+
+ /**
* Installator instance
*
* @var kInstallator
@@ -99,6 +105,7 @@
function kInstallToolkit()
{
$this->defaultWritablePath = DIRECTORY_SEPARATOR . 'system';
+ $this->defaultWebsitePath = rtrim(preg_replace('/'.preg_quote(rtrim(REL_PATH, '/'), '/').'$/', '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))), '/');
if ( class_exists('kApplication') ) {
// auto-setup in case of separate module install
Index: install/step_templates/check_paths.tpl
===================================================================
--- install/step_templates/check_paths.tpl (revision 14817)
+++ install/step_templates/check_paths.tpl (working copy)
@@ -9,6 +9,11 @@
$folder_tpl = ob_get_clean();
$writeable_base = $this->toolkit->getSystemConfig('Misc', 'WriteablePath');
+
+ if (!$writeable_base) {
+ $writeable_base = $this->toolkit->defaultWritablePath;
+ }
+
foreach ($this->writeableFolders as $folder_path) {
$file_path = str_replace('$1', $writeable_base, $folder_path);
if (file_exists(FULL_PATH . $file_path)) {
Index: install/step_templates/install_setup.tpl
===================================================================
--- install/step_templates/install_setup.tpl (revision 14817)
+++ install/step_templates/install_setup.tpl (working copy)
@@ -36,6 +36,7 @@
'clean_reinstall' => 'Reinstall In-Portal',
'fresh_install' => 'Install In-Portal to a New Database',
'update_license' => 'Update License Information',
+ 'sys_config' => 'Update System Configuration',
'db_reconfig' => 'Update Database Configuration',
'fix_paths' => 'Update Installation Paths',
);
Index: install/steps_db.xml
===================================================================
--- install/steps_db.xml (revision 14817)
+++ install/steps_db.xml (working copy)
@@ -100,6 +100,14 @@
]]>
+
It's not recommended to change these settings unless you know what you are doing.
+These settings will be stored in system/config.php file and can be changed manually if needed.
+ ]]> +You can manage your themes in Admin Console under Configuration -> Website -> Themes section.
Index: kernel/startup.php =================================================================== --- kernel/startup.php (revision 14817) +++ kernel/startup.php (working copy) @@ -65,17 +65,31 @@ exit; } - // variable WebsitePath is auto-detected once during installation/upgrade + // variable WebsitePath may be set once during installation/upgrade + if (!isset($vars['WebsitePath'])) { + if (defined('REL_PATH')) { + // location of index.php relatively to site base folder + $relative_path = preg_replace('/^[\/]{0,1}admin(.*)/', $admin_directory . '\\1', REL_PATH); + } + else { + // default index.php relative location is administrative console folder + define('REL_PATH', $admin_directory); + $relative_path = REL_PATH; + } + $vars['WebsitePath'] = rtrim(preg_replace('/' . preg_quote(rtrim($relative_path, '/'), '/') . '$/', '', str_replace('\\', '/', dirname($_SERVER['PHP_SELF']))), '/'); + } define('BASE_PATH', $vars['WebsitePath']); define('APPLICATION_CLASS', isset($vars['ApplicationClass']) ? $vars['ApplicationClass'] : 'kApplication'); define('APPLICATION_PATH', isset($vars['ApplicationPath']) ? $vars['ApplicationPath'] : '/core/kernel/application.php'); - if (isset($vars['WriteablePath'])) { - define('WRITEABLE', FULL_PATH . $vars['WriteablePath']); - define('WRITEBALE_BASE', $vars['WriteablePath']); + if (!isset($vars['WriteablePath'])) { + $vars['WriteablePath'] = DIRECTORY_SEPARATOR . 'system'; } + define('WRITEABLE', FULL_PATH . $vars['WriteablePath']); + define('WRITEBALE_BASE', $vars['WriteablePath']); + if ( isset($vars['RestrictedPath']) ) { define('RESTRICTED', FULL_PATH . $vars['RestrictedPath']); }