开发者

Gmail Zend_Framework access_token Problem

I am using zend framework to grab user's email inbox. I got token from the gmail.

$_SESSION['ACCESS_TOKEN'] = serialize($consumer->getAccessToken($_GET, unserialize($_SESSION['REQUEST_TOKEN'])));

and later i got access_token in the $accessToken variable

 $accessToken = unserialize($_SESSION['ACCESS_TOKEN']);

When i make request to gmail using this $accessToken, every thing is ok.

but when i store this $accessToken in the file or Data base

file_put_contents("token.txt",$accessToken);

When i make API call to gmail using this access token which i have stored in database or file.

$token= file_get_contents("token.txt");

$http  = $token->getHttpClient($oauthOptions); ///Line XXX
$gdata = new Zend_Gdata($http);

$gdata->setMajorProtocolVersion(3);

The following Fatal error comes

Fatal error: Call to a member function getHttpClient() on a non-object in ...myFile.php on line XXX
开发者_开发知识库


$token is a String here not an Object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜