浏览代码

change throwmessage to throw

stanley-king 9 年之前
父节点
当前提交
fc3796ef12

+ 4 - 4
core/framework/core/base.php

@@ -94,14 +94,14 @@ final class Base
 		$class_name = $_GET['act'].'Control';
 
 		if (!file_exists($act_file) || !@require_once($act_file)) {
-			throw_exception("Base Error: access file isn't exists!");
+			throw new Exception("Base Error: access file isn't exists!");
 		}
 
 		if(class_exists($class_name)) {
 			$main = new $class_name();
 		} else {
 			$error = "Base Error: class $class_name isn't exists!";
-			throw_exception($error);
+			throw new Exception($error);
 		}
 
 		if(!empty($main))
@@ -113,11 +113,11 @@ final class Base
 				$main->indexOp();
 			} else {
 				$error = "Base Error: function $function not in $class_name!";
-				throw_exception($error);
+				throw new Exception($error);
 			}
 		} else {
 			$error = "Base Error: class $class_name isn't exists!";
-			throw_exception($error);
+			throw new Exception($error);
 		}
 	}
 

+ 0 - 2
core/framework/function/core.php

@@ -225,7 +225,6 @@ function showMessage($msg,$url='',$show_type='html',$msg_type='succ',$is_show=1,
 			Tpl::output('is_show',$is_show);
 			Tpl::showpage('msg','msg_layout',$time);
 	}
-	exit;
 }
 
 /**
@@ -1735,7 +1734,6 @@ function wcache($key = null, $data = array(), $prefix, $period = 0)
     }
     $ins = Cache::getInstance('cacheredis');
     $ins->hset($key, $prefix, $data);
-    $cache_info = $ins->hget($key,$prefix);
     return true;
 }
 

+ 6 - 3
core/framework/libraries/model.php

@@ -668,14 +668,17 @@ class ModelDb
     {
      	static $_cache = array();
 		$sql = $this->buildSelectSql($options);
-        if ($options['cache'] !== false){
-            $key =  is_string($cache['cache_key']) ? $cache['cache_key'] : md5($sql);
+
+        //if ($options['cache'] !== false)
+        if ($options['cache'] === true)
+        {
+            $key =  is_string($_cache['cache_key']) ? $_cache['cache_key'] : md5($sql);
             if (isset($_cache[$key])){
             	return $_cache[$key];
             }
         }
         $result = DB::getAll($sql,($options['lock'] === true || $options['master'] === true || defined('TRANS_MASTER')) ? 'master' : 'slave');
-        if ($options['cache'] !== false && !isset($_cache[$key])){
+        if ($options['cache'] === true && !isset($_cache[$key])){
          	$_cache[$key] = $result;
         }
         return $result;

+ 3 - 13
crontab/crawl/fetch_goods.php

@@ -8,11 +8,6 @@ require_once (BASE_DATA_PATH . '/api/taobao/top/TopLogger.php');
 require_once (BASE_DATA_PATH . '/api/taobao/top/SpiUtils.php');
 require_once (BASE_DATA_PATH . '/api/taobao/top/ApplicationVar.php');
 require_once (BASE_DATA_PATH . '/api/taobao/top/HttpdnsGetRequest.php');
-
-
-
-
-
 require_once (BASE_DATA_PATH . '/api/taobao/top/request/ItemSellerGetRequest.php');
 require_once (BASE_DATA_PATH . '/api/taobao/top/request/ItemsOnsaleGetRequest.php');
 require_once (BASE_CRONTAB_PATH . '/crawl/product_importer.php');
@@ -33,17 +28,12 @@ date_default_timezone_set('Asia/Shanghai');
 //$cat = new category(array(1801,50010788,50023282));
 //$cat->proc();
 
-//$modoper->import_goods();
-
-//get_tmdata();
-//handle_db();
-
 $tmreq = new tmrequest();
 $tmreq->proc();
 
-//get_tmdata();
-//$treater = new pretreat_tmdata();
-//$treater->proc();
+get_tmdata();
+$treater = new pretreat_tmdata();
+$treater->proc();
 
 //$spec = new spec_attr();
 //$spec->proc();

+ 5 - 2
fcgi_run.php

@@ -19,9 +19,12 @@ function run_fcgi()
         try
         {
             init_request();
-            Base::mobile_control();
+            $file = request_helper::script_file();
+            if(file_exists($file)) {
+                Base::mobile_control();
+            }
         } catch (Exception $ex) {
-            fcgi_echo($ex->getTraceAsString());
+            joutput_error($ex->getCode(),$ex->getMessage().'@@@@@'.$ex->getTraceAsString());
         }
         fcgi_finish();
     }

+ 3 - 2
mobile/control/login.php

@@ -9,11 +9,12 @@ defined('InShopNC') or exit('Access Invalid!');
 
 require_once (BASE_DATA_PATH . '/model/member.model.php');
 require_once (BASE_CORE_PATH . '/framework/libraries/sms.php');
+require_once (BASE_CORE_PATH . '/framework/function/core.php');
 
 class loginControl extends mobileHomeControl 
 {
-    static private $token_expire = 600;
-    static private $code_expire = 5;
+    const token_expire = 600;
+    const code_expire = 5;
 
 	public function __construct() {
 		parent::__construct();

+ 0 - 1
mobile/util/errcode.php

@@ -20,7 +20,6 @@ class errcode extends SplEnum
 
     const ErrDB      = 11000;
     const ErrSms 	 = 12000;
-
     static function msg($code) 
     {
         switch ($code) {