Index: branches/5.2.x/core/install/step_templates/fix_paths.tpl =================================================================== diff -u -N --- branches/5.2.x/core/install/step_templates/fix_paths.tpl (revision 14692) +++ branches/5.2.x/core/install/step_templates/fix_paths.tpl (revision 0) @@ -1,21 +0,0 @@ -Conn->GetCol($sql, 'VariableName'); - - $odd_even = true; - foreach ($config_vars as $config_var) { - ?> - - Application->Phrase( $config_labels[$config_var] ); ?>: - - - - - \ No newline at end of file Index: branches/5.2.x/core/install/install_toolkit.php =================================================================== diff -u -N -r14771 -r14842 --- branches/5.2.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 14771) +++ branches/5.2.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 14842) @@ -1,6 +1,6 @@ systemConfig) ) { - return false; + return $default; } if ( !array_key_exists($key, $this->systemConfig[$section]) ) { - return false; + return $default; } - return $this->systemConfig[$section][$key] ? $this->systemConfig[$section][$key] : false; + return $this->systemConfig[$section][$key] ? $this->systemConfig[$section][$key] : $default; } /** @@ -1070,4 +1071,71 @@ // return output in case of errors return $output; } + + /** + * Returns cache handlers, that are working + * + * @param string $current + * @return Array + */ + public function getWorkingCacheHandlers($current = null) + { + if ( !isset($current) ) { + $current = $this->getSystemConfig('Misc', 'CacheHandler'); + } + + $cache_handlers = Array ( + 'Fake' => 'None', 'Memcache' => 'Memcached', 'XCache' => 'XCache', 'Apc' => 'Alternative PHP Cache' + ); + + foreach ($cache_handlers AS $class_prefix => $title) { + $handler_class = $class_prefix . 'CacheHandler'; + + if ( !class_exists($handler_class) ) { + unset($cache_handlers[$class_prefix]); + } + else { + $handler = new $handler_class('localhost:11211'); + /* @var $handler FakeCacheHandler */ + + if ( !$handler->isWorking() ) { + if ( $current == $class_prefix ) { + $cache_handlers[$class_prefix] .= ' (offline)'; + } + else { + unset($cache_handlers[$class_prefix]); + } + } + } + } + + return $cache_handlers; + } + + /** + * Returns compression engines, that are working + * + * @param string $current + * @return Array + */ + public function getWorkingCompressionEngines($current = null) + { + if ( !isset($current) ) { + $current = $this->getSystemConfig('Misc', 'CompressionEngine'); + } + + $output = shell_exec('java -version'); + $compression_engines = Array ('' => 'None', 'yui' => 'YUICompressor (Java)', 'php' => 'PHP-based'); + + if ( strpos($output, 'Java Version') === false ) { + if ( $current == 'yui' ) { + $compression_engines['yui'] .= ' (offline)'; + } + else { + unset($compression_engines['yui']); + } + } + + return $compression_engines; + } } \ No newline at end of file Index: branches/5.2.x/core/install/steps_db.xml =================================================================== diff -u -N -r14244 -r14842 --- branches/5.2.x/core/install/steps_db.xml (.../steps_db.xml) (revision 14244) +++ branches/5.2.x/core/install/steps_db.xml (.../steps_db.xml) (revision 14842) @@ -100,6 +100,53 @@ ]]> + + These are system advanced settings and must be changed with caution. It's not recommended to + change these settings unless you exactly know what you are doing. These settings will be stored in system/config.php + file and can be changed manually if needed.

+
+ +

Web Path to Installation - web path to the root of your In-Portal installation. For example, + if your In-Portal will be running at http://www.your-website.com, then Web Path to Installation should be set to / + since In-Portal is setup in the root of the domain. In case if your In-Portal will be running under + http://www.your-website.com/in-portal/, then it should be set to /in-portal (no trailing slash). This setting is auto-detected during the + initial installation step, but can be adjusted at Installation Maintenance step.

+ +

Path to Writable folder - path to a folder inside your In-Portal installation which can be accessed from the Web + and has writable permissions for the web server. This folder will be used to store dynamic content such as + uploaded and resized images, cached templates and other types of user files. The default value is /system.

+ +

Path to Restricted folder - path to a folder inside or outside your In-Portal installation which will + used to store debug files, system logs and other non-public information. This folder must be writable by the web-server + and can be located outside of your In-Portal installation if needed. The default value is /system/.restricted .

+ +

Path to Admin folder - web path to your In-Portal Admin Console folder. The default value is set to + /admin and your Admin Console will be accessible at http://www.your-website.com/admin. + In case if you want your Admin Console to be under http://www.your-website.com/secure-admin (or anything else) + you'll need to rename original admin folder to secure-admin on your filesystem and then set this path to /secure-admin .

+ +

Path to Admin Interface Presets folder - path to a folder inside your In-Portal installation + contains Admin Interface Presets. The default value is /admin .

+ +

Name of Base Application Class - default value is kApplication and can change very rarely.

+ +

Path to Base Application Class file - default value is /core/kernel/application.php and can change very rarely.

+ +

Output Caching Engine - provides ability to cache HTML output or other data using various caching engines to + lower the database load. The default value is set to None if no available engines detected. Available options are: + None (Fake), Memcached (Memcache), XCache (XCache) and Alternative PHP Cache (Apc). + Note that only auto-detected caching engines will be available for selection.

+ +

Location of Memcache Servers - host or IP address with port where Memcached Server is running. + Multiple locations of can be listed separated by semi-colon (;). For example, 192.168.1.1:1121;192.168.1.2:1121;192.168.1.3:1121 .

+ +

CSS/JS Compression Engine - provides minification + functionality for CSS / Javascript files. The default value is set to PHP-based if no Java is auto-detected on server-side. + Available options are: None (empty), YUICompressor (Java) (yui) and PHP-based (php) .

+ +
+ ]]> +
Selected theme will be used as a default in your In-Portal website.

You can manage your themes in Admin Console under Configuration -> Website -> Themes section.

@@ -160,9 +207,4 @@ The characters entered in this field are placed before the names of the tables used by In-Portal. For example, if you enter "inp_" into the prefix field, the table named Category will be named inp_Category.

]]>
- - Fix Paths option should be used when the location of the In-Portal files has changed. - For example, if you moved them from one folder to another. It will update all settings and ensure the program - is operational at the new location.]]> - \ No newline at end of file Index: branches/5.2.x/core/install/step_templates/install_setup.tpl =================================================================== diff -u -N -r14572 -r14842 --- branches/5.2.x/core/install/step_templates/install_setup.tpl (.../install_setup.tpl) (revision 14572) +++ branches/5.2.x/core/install/step_templates/install_setup.tpl (.../install_setup.tpl) (revision 14842) @@ -32,14 +32,18 @@ $option_tpl = ob_get_clean(); $options = Array ( - 'upgrade' => 'Upgrade In-Portal', - 'clean_reinstall' => 'Reinstall In-Portal', - 'fresh_install' => 'Install In-Portal to a New Database', - 'update_license' => 'Update License Information', - 'db_reconfig' => 'Update Database Configuration', - 'fix_paths' => 'Update Installation Paths', - ); + 'upgrade' => 'Upgrade In-Portal', + 'clean_reinstall' => 'Reinstall In-Portal', + 'fresh_install' => 'Install In-Portal to a New Database', + 'update_license' => 'Update License Information', + 'update_config' => 'Update System Configuration', + 'db_reconfig' => 'Update Database Configuration', + ); + if ( !$this->Application->isDebugMode() ) { + unset($options['update_config']); + } + $upgradable_modules = $this->GetUpgradableModules(); if (!$upgradable_modules) { unset($options['upgrade']); Index: branches/5.2.x/core/install.php =================================================================== diff -u -N -r14699 -r14842 --- branches/5.2.x/core/install.php (.../install.php) (revision 14699) +++ branches/5.2.x/core/install.php (.../install.php) (revision 14842) @@ -1,6 +1,6 @@ Array ('check_paths', 'db_config', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'security', 'finish'), - 'clean_reinstall' => Array ('check_paths', 'clean_db', 'db_config', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'security', 'finish'), + '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'), + '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'), 'already_installed' => Array ('check_paths', 'install_setup'), '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'), + 'update_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'), ); /** @@ -236,12 +236,13 @@ * Returns variable from request * * @param string $name + * @param mixed $default * @return string|bool * @access private */ - private function GetVar($name) + private function GetVar($name, $default = false) { - return array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : false; + return array_key_exists($name, $_REQUEST) ? $_REQUEST[$name] : $default; } /** @@ -801,6 +802,18 @@ } break; + case 'sys_config': + $config_data = $this->GetVar('system_config'); + + foreach ($config_data as $section => $section_vars) { + foreach ($section_vars as $var_name => $var_value) { + $this->toolkit->setSystemConfig($section, $var_name, $var_value); + } + } + + $this->toolkit->SaveConfig(); + break; + case 'root_password': // update root password in database $password = md5( md5($this->Application->GetVar('root_password')) . 'b38'); @@ -973,10 +986,6 @@ } break; - case 'fix_paths': - $this->toolkit->saveConfigValues( $this->Application->GetVar('config') ); - break; - case 'finish': // delete cache $this->toolkit->deleteCache(); Index: branches/5.2.x/core/install/step_templates/sys_config.tpl =================================================================== diff -u -N --- branches/5.2.x/core/install/step_templates/sys_config.tpl (revision 0) +++ branches/5.2.x/core/install/step_templates/sys_config.tpl (revision 14842) @@ -0,0 +1,57 @@ + Array ('type' => 'text', 'title' => 'Web Path to Installation', 'section' => 'Misc', 'required' => 1, 'default' => '/'), + 'WriteablePath' => Array ('type' => 'text', 'title' => 'Path to Writable folder', 'section' => 'Misc', 'required' => 1, 'default' => '/system'), + 'RestrictedPath' => Array ('type' => 'text', 'title' => 'Path to Restricted folder', 'section' => 'Misc', 'required' => 1, 'default' => '/system/.restricted'), + 'AdminDirectory' => Array ('type' => 'text', 'title' => 'Path to Admin folder', 'section' => 'Misc', 'default' => '/admin'), + 'AdminPresetsDirectory' => Array ('type' => 'text', 'title' => 'Path to Admin Interface Presets folder', 'section' => 'Misc', 'default' => '/admin'), + 'ApplicationClass' => Array ('type' => 'text', 'title' => 'Name of Base Application Class', 'section' => 'Misc', 'default' => 'kApplication'), + 'ApplicationPath' => Array ('type' => 'text', 'title' => 'Path to Base Application Class file', 'section' => 'Misc', 'default' => '/core/kernel/application.php'), + 'CacheHandler' => Array ('type' => 'select', 'title' => 'Output Caching Engine', 'section' => 'Misc', 'default' => 'Fake'), + 'MemcacheServers' => Array ('type' => 'text', 'title' => 'Location of Memcache Servers', 'section' => 'Misc', 'default' => 'localhost:11211'), + 'CompressionEngine' => Array ('type' => 'select', 'title' => 'CSS/JS Compression Engine', 'section' => 'Misc', 'default' => ''), + ); + + $settings['CacheHandler']['options'] = $this->toolkit->getWorkingCacheHandlers(); + $settings['CompressionEngine']['options'] = $this->toolkit->getWorkingCompressionEngines(); + + $row_class = 'table-color2'; + + foreach ($settings as $config_var => $output_params) { + $row_class = $row_class == 'table-color1' ? 'table-color2' : 'table-color1'; + ?> + + + *' : ''); ?>: + + + toolkit->getSystemConfig($output_params['section'], $config_var, $output_params['default']); + + if ( $output_params['type'] == 'text' ) { + echo ''; + } + else { + echo ''; + } + ?> + + +