通过微信api或缓存机制获取可用的微信jsapi_ticket
@return mixed|null
546808
public function get_js_api_ticket(){
        /*使用业务接口获取缓存中的js_api_ticket避免频繁调用接口刷新js_api_ticket*/
        if ($this->business_interface){
            $js_api_ticket = $this -> business_interface -> get_cache_js_api_ticket();
            if (!empty($js_api_ticket)){
                return $js_api_ticket;
            }
        }
        return $this->refresh_js_api_ticket();
    }
1045295
public function getServerMessage()
    {
        if (isset($this->_details[self::ENTRY_MESSAGE])) {
            return $this->_details[self::ENTRY_MESSAGE];
        }

        return null;
    }
599502
public function getStatus()
    {
        $entries = $this->_query('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode');
        if ($entries->length != 1) {
            return null;
        }
        $status = $entries->item(0)->getAttribute('Value');
        return $status;
    }
521323
public function new_jsapi_ticket()
    {
        $url = self::API_DOMAIN . 'cgi-bin/ticket/getticket?access_token=' . $this->get_access_token() . '&type=jsapi';
        $res = HttpCurl::get($url, 'json');
        // 异常处理: 获取时网络错误
        if ($res === false) {
            return Error::code('ERR_GET');
        }
        // 判断是否调用成功
        if ($res->errcode == 0) {
            return (object)array(
                'ticket' => $res->ticket,
                'expires_in' => $res->expires_in + time()
            );
        } else {
            return false;
        }
    }
1189773
public function isLogin()
	{
		$ticket = $this->getTicket();
		logger('用户凭证：'.var_export($ticket,true)); // debug
		if(isset($ticket['id'])){
			logger('存在用户凭证....');
			if(($ticket['expire_time']+$ticket['create_at']) > time()){
				logger('用户凭证在有效期内....');
				$leftTimes = (time()-$ticket['check_at'])/$this->_reCheckTime;
				if($leftTimes < 1){
					logger('检查时间间隔：'.$this->_reCheckTime);
					logger('不需要向服务器核验用户凭证...'."\n");
					return true;
				}else{
					logger('需要向服务器核验用户凭证...'."\n");
					$this->toServerIsLogin();
					return;
				}
			}
			logger('用户凭证bu在有效期内....'."\n");
			$this->toServerIsLogin();
			return;
		}
		logger('bu存在用户凭证....'."\n");
		$this->toServerIsLogin();
		return;
	}
43505
public function getAccessToken() 
    {
        $result = null;
        $options = $this->config->getAccessTokenConfiguration();
        $token = $this->getResponse('/oauth/token', $options);
        if (isset($token['access_token'])) {
            $this->config->setBearer($token['access_token']);
        }else {
            echo 'ERROR: no access token in API response';
        }
    }
1160969
public function getTicket()
    {
        $cacheKey = sprintf($this->cacheKey, $this->appId);

        return Cache::get($cacheKey, function () use ($cacheKey) {
            $response = $this->http->get(self::API_TICKET);

            // 设置token
            $ticket = $response['ticket'];

            // 把token缓存起来
            $expiresAt = Carbon::now()->addSeconds($response['expires_in']);
            Cache::put($cacheKey, $ticket, $expiresAt);

            return $ticket;
        });
    }
995635
public function getJsApiTicket($force = false)
    {
        $time = time(); // 为了更精确控制.取当前时间计算
        $cache_name = 'wechat_jsapi_ticket_' . $this->corpId . '_' . $this->app;
        if ($this->_jsApiTicket === null || $this->_jsApiTicket['expire'] < $time || $force) {
            $result = $this->_jsApiTicket === null && !$force ? $this->getCache($cache_name, false) : false;
            if ($result === false) {
                if (!($result = $this->requestJsApiTicket())) {
                    throw new HttpException(500, 'Fail to get jsapi_ticket from wechat server.');
                }
                $result['expire'] = $time + $result['expires_in'];
                $this->trigger(self::EVENT_AFTER_JS_API_TICKET_UPDATE, new Event(['data' => $result]));
                $this->setCache($cache_name, $result, $result['expires_in']);
            }
            $this->setJsApiTicket($result);
        }
        return $this->_jsApiTicket['ticket'];
    }
737414
public function getQuestsApi()
    {
        if (!$this->apis->has('quests')) {
            $this->apis->set('quests', new Quests($this));
        }

        return $this->apis->get('quests');
    }
853429
public function getNotification()
    {
        $data = pg_get_notify($this->handler, \PGSQL_ASSOC);

        return $data === false ? null : $data;
    }
1040086
public function getAccountInformation() {
    $url = $this->url . self::$API_ROUTES['ACCOUNT_INFO'];
    $url .= '?apiVersion=' . $this->apiVersion;

    $result = $this->doGet($url, array(), false);

    if ($result !== null && is_object($result)) {
      $accountInfo = AccountInformation::getFromJson($result);

      if ($accountInfo != null) {
        return $accountInfo;
      }
    }

    return null;
  }
596674
public function getMerchantInfo()
    {
        $url = "https://api.weixin.qq.com/scan/merchantinfo/get?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpGetForJson($url);
    }
1122525
static function get_jsapi_signature($jsapi_ticket, $nonceStr, $timestamp, $url)
    {
        //排序
        try {
            $str = "jsapi_ticket=$jsapi_ticket&noncestr=$nonceStr&timestamp=$timestamp&url=$url";
            return sha1($str);
        } catch (\Exception $e) {
            @error_log('get_jsapi_signature Error: ' . $e->getMessage(), 0);
            return FALSE;
        }
    }
672915
public function getTicket()
    {
        $key = 'stoneworld.wechat.jsapi_ticket.' . $this->appId;

        // for php 5.3
        $appId = $this->appId;
        $appSecret = $this->appSecret;
        $cache = $this->cache;
        $apiTicket = self::API_TICKET;

        return $this->cache->get(
            $key,
            function ($key) use ($appId, $appSecret, $cache, $apiTicket) {
                $http = new Http(new AccessToken($appId, $appSecret));

                $result = $http->get($apiTicket);

                $cache->set($key, $result['ticket'], $result['expires_in']);

                return $result['ticket'];
            }
        );
    }
1001669
function getTtl(): ?int
    {
        if (is_int($this->expiration)) {
            return $this->expiration;
        }

        if ($this->expiration instanceof \DateTimeInterface) {
            return $this->expiration->getTimestamp() - Clock::time();
        }

        if ($this->expiration instanceof \DateInterval) {
            return PsrCacheHelper::convertDateIntervalToTtl($this->expiration);
        }

        return null;
    }
467056
public function getTicket()
    {
        if ($this->ticket) {
            return $this->ticket;
        }

        $key = 'gibson.wechat.card.api_ticket';

        // for php 5.3
        $http = $this->http;
        $apiTicket = self::API_TICKET;

        return $this->ticket = Cache::get($key, function () use ($key, $http, $apiTicket) {
            $result = $http->get($apiTicket);

            Cache::put($key, $result['ticket'], $result['expires_in']);

            return $result['ticket'];
        });
    }
836854
public function getStatus($ticket)
    {
        try {
            return $this->getStatusInternal($ticket);
        } catch (\SoapFault $e) {
            $result = new StatusResult();
            $result->setError($this->getErrorFromFault($e));

            return $result;
        }
    }