diff --git a/config/func.inc.php b/config/func.inc.php index 9486177ac..53948ba67 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -14,12 +14,18 @@ if(!defined('__XE__')) // define an empty function to avoid errors when iconv function doesn't exist if(!function_exists('iconv')) { - eval(' - function iconv($in_charset, $out_charset, $str) + function iconv($in_charset, $out_charset, $str) + { + if(function_exists('mb_convert_encoding')) + { + $out_charset = preg_replace('#//.+$#', '', $out_charset); + return mb_convert_encoding($str, $out_charset, $in_charset); + } + else { return $str; } - '); + } } /** diff --git a/modules/install/install.controller.php b/modules/install/install.controller.php index 6274ae340..283cffeb5 100644 --- a/modules/install/install.controller.php +++ b/modules/install/install.controller.php @@ -340,7 +340,7 @@ class installController extends install // Check each item $checklist = array(); - // 0. Check PHP version + // Check PHP version $checklist['php_version'] = true; if(version_compare(PHP_VERSION, __XE_MIN_PHP_VERSION__, '<')) { @@ -351,7 +351,17 @@ class installController extends install Context::set('phpversion_warning', true); } - // 1. Check permission + // Check DB + if(DB::getEnableList()) + { + $checklist['db_support'] = true; + } + else + { + $checklist['db_support'] = false; + } + + // Check permission if(is_writable('./')||is_writable('./files')) { $checklist['permission'] = true; @@ -361,7 +371,7 @@ class installController extends install $checklist['permission'] = false; } - // 2. Check if ini_get (session.auto_start) == 1 + // Check session.auto_start if(ini_get('session.auto_start') != 1) { $checklist['session'] = true; @@ -371,27 +381,17 @@ class installController extends install $checklist['session'] = false; } - // 3. Check if xml_parser_create exists - if(function_exists('xml_parser_create')) + // Check curl + if(function_exists('curl_init')) { - $checklist['xml'] = true; + $checklist['curl'] = true; } else { - $checklist['xml'] = false; + $checklist['curl'] = false; } - // 4. Check if iconv exists - if(function_exists('iconv')) - { - $checklist['iconv'] = true; - } - else - { - $checklist['iconv'] = false; - } - - // 5. Check GD + // Check GD if(function_exists('imagecreatefromgif')) { $checklist['gd'] = true; @@ -401,14 +401,44 @@ class installController extends install $checklist['gd'] = false; } - // 6. Check DB - if(DB::getEnableList()) + // Check iconv or mbstring + if(function_exists('iconv') || function_exists('mb_convert_encoding')) { - $checklist['db'] = true; + $checklist['iconv'] = true; } else { - $checklist['db'] = false; + $checklist['iconv'] = false; + } + + // Check json + if(function_exists('json_encode')) + { + $checklist['json'] = true; + } + else + { + $checklist['json'] = false; + } + + // Check openssl + if(function_exists('openssl_encrypt')) + { + $checklist['openssl'] = true; + } + else + { + $checklist['openssl'] = false; + } + + // Check XML + if(function_exists('xml_parser_create')) + { + $checklist['xml'] = true; + } + else + { + $checklist['xml'] = false; } // Enable install if all conditions are met diff --git a/modules/install/lang/lang.xml b/modules/install/lang/lang.xml index 88cad44cf..dd56d048b 100644 --- a/modules/install/lang/lang.xml +++ b/modules/install/lang/lang.xml @@ -113,7 +113,7 @@ - + @@ -125,63 +125,93 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - + + + + @@ -257,7 +287,7 @@ - + @@ -269,7 +299,7 @@ - + @@ -281,7 +311,7 @@ - + diff --git a/modules/install/tpl/check_env.html b/modules/install/tpl/check_env.html index 3ddbd2537..10a87b594 100644 --- a/modules/install/tpl/check_env.html +++ b/modules/install/tpl/check_env.html @@ -16,9 +16,12 @@ : {$lang->enable} ({$phpversion}) {$lang->disable} ({$phpversion}) -

+

{sprintf($lang->install_checklist_desc['php_version_warning'], __XE_RECOMMEND_PHP_VERSION__)} [{$lang->more}]

+

+ {$lang->install_checklist_desc[$key]} +