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'); }
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'); }
protected function _dispatch($method, $params = null, $source = null) { $data = $this->_verifySignature($source . '.' . $method, $params[0]); $params = array((array) $data); try { $return = parent::_dispatch($method, $params, $source); } catch (Zend_Exception $e) { throw $e; } catch (Exception $e) { $return = array('success' => false, 'error' => $e->getMessage()); } if (is_array($return)) { $obj = new StdClass(); foreach ($return as $key => $value) { $obj->{$key} = $value; } $return = $obj; } return $this->_return($return); }
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'); }
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'); */ }