Kaynağa Gözat

fix exit bug.

stanley-king 9 yıl önce
ebeveyn
işleme
9e915ea869

+ 5 - 1
core/33hao.php

@@ -79,7 +79,11 @@ if(function_exists('spl_autoload_register')) {
 	spl_autoload_register(array('Base', 'autoload'));
 } else {
 	function __autoload($class) {
-		return Base::autoload($class);
+		if(defined('MOBILE_SERVER') && MOBILE_SERVER == true) {
+			return Base::mobile_autoload($class);
+		} else {
+			return Base::autoload($class);
+		}
 	}
 }
 ?>

+ 22 - 0
core/framework/core/base.php

@@ -248,6 +248,28 @@ final class Base
 		}
 	}
 
+	public static function mobile_autoload($class)
+	{
+		$class = strtolower($class);
+		if (ucwords(substr($class,-5)) == 'Class' ){
+			if (!@include_once(BASE_PATH.'/framework/libraries/'.substr($class,0,-5).'.class.php')){
+				throw new Exception("Class Error: {$class}.isn't exists!");
+			}
+		}elseif (ucwords(substr($class,0,5)) == 'Cache' && $class != 'cache'){
+			if (!@include_once(BASE_CORE_PATH.'/framework/cache/'.substr($class,0,5).'.'.substr($class,5).'.php')){
+				throw new Exception("Class Error: {$class}.isn't exists!");
+			}
+		}elseif ($class == 'db'){
+			if (!@include_once(BASE_CORE_PATH.'/framework/db/'.strtolower(DBDRIVER).'.php')){
+				throw new Exception("Class Error: {$class}.isn't exists!");
+			}
+		}else{
+			if (!@include_once(BASE_CORE_PATH.'/framework/libraries/'.$class.'.php')){
+				throw new Exception("Class Error: {$class}.isn't exists!");
+			}
+		}
+	}
+
 	/**
 	 * 合法性验证
 	 *

+ 5 - 6
data/config/config.ini.php

@@ -4,15 +4,14 @@
 $config = array();
 
 const test_srv_host = 'http://121.43.114.153';
-const stanley_host = 'http://192.168.1.131';
 const stanley_home = 'http://192.168.1.12';
-const stanley_host = 'http://192.168.1.105';
-const stanley_home = 'http://192.168.1.4';
-const boss_host = 'http://172.40.2.14';
+const stanley_host = 'http://192.168.1.121';
 
+const boss_host    = 'http://172.40.2.14';
 const jeff_office = 'http://192.168.1.128';
 const liax_office = 'http://192.168.1.136';
-$SRV_HOST = test_srv_host;
+
+$SRV_HOST = stanley_host;
 
 $config['base_site_url']        = $SRV_HOST;
 $config['shop_site_url'] 		= $SRV_HOST.'/shop';
@@ -35,7 +34,7 @@ $config['tablepre']		= 'lrlz_';
 $config['db']['1']['dbhost']       = '127.0.0.1';
 $config['db']['1']['dbport']       = '3306';
 $config['db']['1']['dbuser']       = 'root';
-$config['db']['1']['dbpwd']        = 'jeff1104';
+$config['db']['1']['dbpwd']        = '55668899';
 $config['db']['1']['dbname']       = '33hao';
 $config['db']['1']['dbcharset']    = 'UTF-8';
 $config['db']['slave']                  = $config['db']['master'];

+ 1 - 0
fcgi_run.php

@@ -1,6 +1,7 @@
 <?php
 
 define('BASE_ROOT_PATH',str_replace('\\','/',dirname(__FILE__)));
+define('MOBILE_SERVER',true);
 
 require_once (BASE_ROOT_PATH . '/fooder.php');
 

+ 1 - 1
fooder.php

@@ -30,5 +30,5 @@ require_once(BASE_CORE_PATH.'/framework/db/mysql.php');
 require_once(BASE_CORE_PATH.'/framework/function/goods.php');
 require_once(BASE_CORE_PATH . '/framework/libraries/validate.php');
 require_once(BASE_CORE_PATH.'/framework/libraries/resizeimage.php');
-
+require_once (BASE_MOBILE_PATH . '/control/log.php');
 ?>

+ 8 - 12
mobile/control/brand.php

@@ -19,24 +19,20 @@ class brandControl extends mobileHomeControl
     {
         //获得品牌列表
         $model = Model();
-
-        $brand_area_list = $model->table('brand_area')->order('area_sort asc')->select();
-
-        $brand_c_list = $model->table('brand')->where(array('brand_apply' => '1'))->order('brand_sort asc')->select();
+        $brand_area_list = $model->table('brand_area')->order('area_sort asc')->limit(false)->select();
+        $brand_c_list = $model->table('brand')->where(array('brand_apply' => '1'))->order('brand_sort asc')->limit(false)->select();
 
         $brands = array();
-        foreach ($brand_area_list as $brand_area) {
-
-            foreach ($brand_c_list as $brand) {
-
+        foreach ($brand_area_list as $brand_area)
+        {
+            foreach ($brand_c_list as $brand)
+            {
                 $brand['brand_pic'] = $this->_formatBrandPic($brand['brand_pic']);
-
-                if ($brand['brand_area_id'] == $brand_area['area_id']) {
-
+                if ($brand['brand_area_id'] == $brand_area['area_id'])
+                {
                     if (empty($brand_area['data'])) {
                         $brand_area['data'] = array();
                     }
-
                     array_push($brand_area['data'], $brand);
                 }
             }

+ 1 - 2
mobile/help.html

@@ -1,10 +1,9 @@
-<!DOCTYPE html>
 <html>
     <head>
         <meta http-equiv="content-type" content="text/html; charset=utf-8" />
         <title>帮助</title>
     </head>
     <body>
-帮助
+
     </body>
 </html>

+ 1 - 1
mobile/wxnotify.php

@@ -15,7 +15,7 @@ require_once (WXPAY_PATH . '/lib/WxPay.Config.php');
 require_once (WXPAY_PATH . '/lib/WxPay.Data.php');
 require_once (WXPAY_PATH . '/lib/WxPay.Exception.php');
 require_once (WXPAY_PATH . '/lib/WxPay.Notify.php');
-require_once (BASE_MOBILE_PATH . '/control/log.php');
+
 
 //初始化日志
 $log_path = BASE_ROOT_PATH . "/logs/wx-".date('Y-m-d').'.log';