|
@@ -23,7 +23,7 @@ final class Base
|
|
|
{
|
|
|
if (is_numeric($setting_config['time_zone'])){
|
|
|
@date_default_timezone_set('Asia/Shanghai');
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
@date_default_timezone_set($setting_config['time_zone']);
|
|
|
}
|
|
|
}
|
|
@@ -45,9 +45,84 @@ final class Base
|
|
|
public static function run_test()
|
|
|
{
|
|
|
self::cp();
|
|
|
- self::init();
|
|
|
+ global $setting_config;
|
|
|
+ self::parse_conf($setting_config);
|
|
|
+ define('MD5_KEY',md5($setting_config['md5_key']));
|
|
|
+
|
|
|
+ if(function_exists('date_default_timezone_set'))
|
|
|
+ {
|
|
|
+ if (is_numeric($setting_config['time_zone'])){
|
|
|
+ @date_default_timezone_set('Asia/Shanghai');
|
|
|
+ }else{
|
|
|
+ @date_default_timezone_set($setting_config['time_zone']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Tpl::output('setting_config',$setting_config);
|
|
|
+ Language::read('core_lang_index');
|
|
|
}
|
|
|
|
|
|
+ public static function mobile_init()
|
|
|
+ {
|
|
|
+ self::cp();
|
|
|
+
|
|
|
+ global $setting_config;
|
|
|
+ self::parse_conf($setting_config);
|
|
|
+ define('MD5_KEY',md5($setting_config['md5_key']));
|
|
|
+
|
|
|
+ if(function_exists('date_default_timezone_set'))
|
|
|
+ {
|
|
|
+ if (is_numeric($setting_config['time_zone'])){
|
|
|
+ @date_default_timezone_set('Asia/Shanghai');
|
|
|
+ }else{
|
|
|
+ @date_default_timezone_set($setting_config['time_zone']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Tpl::output('setting_config',$setting_config);
|
|
|
+ Language::read('core_lang_index');
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function mobile_control()
|
|
|
+ {
|
|
|
+ if ($GLOBALS['setting_config']['enabled_subdomain'] == '1' && $_GET['act'] == 'index' && $_GET['op'] == 'index')
|
|
|
+ {
|
|
|
+ $store_id = subdomain();
|
|
|
+ if ($store_id > 0) $_GET['act'] = 'show_store';
|
|
|
+ }
|
|
|
+
|
|
|
+ $act_file = realpath(BASE_PATH.'/control/'.$_GET['act'].'.php');
|
|
|
+ $class_name = $_GET['act'].'Control';
|
|
|
+ if (!@require_once($act_file)) {
|
|
|
+ throw_exception("Base Error: access file isn't exists!");
|
|
|
+ }
|
|
|
+
|
|
|
+ static $objs = array();
|
|
|
+ if(array_key_exists($class_name,$objs)) {
|
|
|
+ $main = $objs[$class_name];
|
|
|
+ } else if(class_exists($class_name)) {
|
|
|
+ $main = new $class_name();
|
|
|
+ $objs[$class_name] = $main;
|
|
|
+ } else {
|
|
|
+ $error = "Base Error: class $class_name isn't exists!";
|
|
|
+ throw_exception($error);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!empty($main))
|
|
|
+ {
|
|
|
+ $function = $_GET['op'].'Op';
|
|
|
+ if (method_exists($main,$function)){
|
|
|
+ $main->$function();
|
|
|
+ } elseif (method_exists($main,'indexOp')){
|
|
|
+ $main->indexOp();
|
|
|
+ } else {
|
|
|
+ $error = "Base Error: function $function not in $class_name!";
|
|
|
+ throw_exception($error);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $error = "Base Error: class $class_name isn't exists!";
|
|
|
+ throw_exception($error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* run
|
|
|
*/
|
|
@@ -187,8 +262,8 @@ final class Base
|
|
|
if (strpos(self::CPURL,'||') !== false)
|
|
|
{
|
|
|
$a = explode('||',self::CPURL);
|
|
|
- foreach ($a as $v)
|
|
|
- {
|
|
|
+ foreach ($a as $v)
|
|
|
+ {
|
|
|
$d = strtolower(stristr($_SERVER['HTTP_HOST'],$v));
|
|
|
if ($d == strtolower($v)){
|
|
|
return;
|