Example #1
0
 protected function _input_convert($method, $param, $extra)
 {
     $pathinfo = $this->_get_pathinfo($method, $param, $extra);
     if ($pathinfo === null) {
         $this->_add_error("set pathinfo failed");
         return null;
     }
     ral_set_pathinfo($pathinfo);
     $queryarr = $this->_get_queryarr($method, $param, $extra);
     if (!empty($queryarr)) {
         ral_set_querystring(self::_array2querystr($queryarr));
     } else {
         ral_set_querystring('');
     }
     return $this->_input_converter($method, $param, $extra);
 }
Example #2
0
 protected function _ralExecute($arrInput)
 {
     //ral_set_logid(LOG_ID);
     ral_set_log(4, Bd_AppEnv::getCurrApp());
     ral_set_pathinfo($arrInput['pathinfo']);
     ral_set_querystring($arrInput['querystring']);
     ral_set_useragent('ral spider');
     /* 
     //ral_set_header("Cookie:".$strCookie);这个接口不会reset出出现head过大而报错问题,有需要再升级
     $arrCookie = array();
     if (is_array($_COOKIE) && count($_COOKIE) > 0) {
         foreach($_COOKIE as $key => $value) {
             if ($key != "LITE_DEBUG") {    
                 $arrCookie[] = "$key=".$value; 
             }
         }
     }
     $strCookie = implode(";", $arrCookie);
     ral_set_header("Cookie:".$strCookie);
     */
     if (count($arrInput['post']) <= 0) {
         $arrInput['post']['time'] = time();
     }
     $content = ral($this->service, __FUNCTION__, http_build_query($arrInput['post']), rand());
     if ($content == false) {
         Bd_Log::warning("ral execute [" . $this->service . "] failed param[" . var_export($arrInput, true) . "]");
     }
     return $content;
 }
Example #3
0
 public function getBDUSSBySSIDWithRAL($ssid)
 {
     ral_set_logid(LOG_ID);
     ral_set_pathinfo('passport/get_sid');
     ral_set_querystring("ssid={$ssid}&plain=&version=2");
     $res = ral('wappass', 'get', array(), 1);
     if ($res != null) {
         $res = json_decode($res, true);
         self::$_errno = !$res ? -1 : 0;
         self::$_errmsg = !$res ? "[Wappass][get_sid]Result json_decode failed." : "";
         if (!$res) {
             Bd_Passport_Log::warning(self::$_errmsg, -1);
         }
         return is_array($res) ? $res : false;
     } else {
         self::$_errno = ral_get_errno();
         self::$_errmsg = "[Wappass][get_sid]Talk with server failed. errmsg:" . ral_get_error();
         Bd_Passport_Log::warning(self::$_errmsg, -1);
         return false;
     }
 }