Ejemplo n.º 1
0
 protected function _dispatch($method, $params = null, $source = null)
 {
     $st = microtime(true);
     $content = $params[0];
     $mypre = "{$source}-{$method}";
     if ($content->lang == 4) {
         ServerConfig::setLang('en');
     }
     if ($content->lang == 3) {
         ServerConfig::setLang('zh');
     }
     CrabTools::mydump($params[0], REQ_DATA_ROOT . $mypre . '.param');
     Logger::info("{$source}::{$method}");
     try {
         $ret = parent::_dispatch($method, $params, $source);
         $parastr = print_r($params, true);
         $et = microtime(true);
         $cost = $et - $st;
         $cost = ceil(1000000 * $cost);
         Logger::info("{$source}::{$method}  {$cost} ,  [{$ret['status']}]  [{$ret['msg']}] {$parastr}");
         CrabTools::myprint($ret, REQ_DATA_ROOT . $mypre . '.resp');
         return $ret;
     } catch (Exception $e) {
         CrabTools::myprint($e, REQ_DATA_ROOT . $mypre . '.exp');
         return array('status' => 'error', 'msg' => 'exe exception');
     }
     Logger::error('Method "' . $method . '" auth failed' . " sk={$session_key} platform_id={$platform_id} ");
     return array('status' => 'error', 'msg' => 'auth failed');
 }
Ejemplo n.º 2
0
 protected function _dispatch($method, $params = null, $source = null)
 {
     $content = $params[0];
     ServerConfig::setLang($content->lang);
     return parent::_dispatch($method, $params, $source);
     $auth = $content->auth;
     if ($platform_id != null || $this->authOrkut($platform_id, $auth)) {
         return parent::_dispatch($method, $params, $source);
     }
     Logger::error('Method "' . $method . '" auth failed' . " auth={$auth} platform_id={$platform_id} ");
     return array('status' => 'error', 'msg' => 'auth failed');
 }
Ejemplo n.º 3
0
 protected function _dispatch($method, $params = null, $source = null)
 {
     $content = $params[0];
     return parent::_dispatch($method, $params, $source);
     $auth = $content->auth;
     ServerConfig::setLang($content->lang);
     if ($content->platform_id != null) {
         $platform_id = $content->platform_id;
     } else {
         if ($content->user_id != null) {
             $user_id = $content->user_id;
             $platform_id = AutoIncIdGenerator::getPlatformId($user_id);
         }
     }
     $vk = new Vk($platform_id);
     if ($vk->auth($auth)) {
         return parent::_dispatch($method, $params, $source);
     }
     Logger::error('Method "' . $method . '" auth failed' . " sk={$session_key} platform_id={$platform_id} ");
     return array('status' => 'error', 'msg' => 'auth failed');
 }
Ejemplo n.º 4
0
 protected function _dispatch($method, $params = null, $source = null)
 {
     $content = $params[0];
     ServerConfig::setLang($content->lang);
     return parent::_dispatch($method, $params, $source);
     /*
     
     $session_key = $content->auth;
     if($content->platform_id !=null)
     {
     $platform_id = $content->platform_id;
     }
     else if($content->user_id !=null)
     {
     $user_id = $content->user_id;
     $platform_id = AutoIncIdGenerator::getPlatformId($user_id);
     }
     if($platform_id != null && $this->authRenren($platform_id,$session_key) ){
     return parent::_dispatch($method, $params, $source );
     }
     Logger::error('Method "' . $method . '" auth failed'." sk=$session_key platform_id=$platform_id ");
     return array('status'=>'error','msg'=>'auth failed');
     */
 }