src/Service/Baidu/AccessToken.php
public function getAccessToken($forceRefresh = false)
    {
        $cacheKey = $this->getCacheKey();
        $cached = $this->getCache()->fetch($cacheKey);

        if (empty($cached) || $forceRefresh) {
            $token = $this->getTokenFormApi();

            $this->getCache()->save($cacheKey, $token[$this->tokenSucessKey], $token['expires_in']);

            return $token[$this->tokenSucessKey];
        }

        return $cached;
    }
public function getAccessToken($forceRefresh = false)
    {
        $cacheKey = $this->getCacheKey();
        $cached = $this->getCache()->fetch($cacheKey);

        if (empty($cached) || $forceRefresh) {
            $token = $this->getTokenFormApi();

            $this->getCache()->save($cacheKey, $token[$this->tokenSucessKey], $token['expires_in']);

            return $token[$this->tokenSucessKey];
        }

        return $cached;
    }
public function getAccessToken ( $ forceRefresh = false ) { $ cacheKey = $ this -> getCacheKey ( ) ; $ cached = $ this -> getCache ( ) -> fetch ( $ cacheKey ) ; if ( empty ( $ cached ) || $ forceRefresh ) { $ token = $ this -> getTokenFormApi ( ) ; $ this -> getCache ( ) -> save ( $ cacheKey , $ token [ $ this -> tokenSucessKey ] , $ token [ 'expires_in' ] ) ; return $ token [ $ this -> tokenSucessKey ] ; } return $ cached ; }
Get access token from baidu API.

@param  boolean $forceRefresh

@return string
Get access token from baidu API .