我正在使用zend三脚php api来获取用户gmail电子邮件。 当我第一次运行three-legged.php
时if (!isset($_SESSION['ACCESS_TOKEN'])) {
if (!isset($_SESSION['REQUEST_TOKEN'])) {
// Get Request Token and redirect to Google
$_SESSION['REQUEST_TOKEN'] = serialize($consumer->getRequestToken(array('scope' => implode(' ', $THREE_LEGGED_SCOPES))));
$consumer->redirect();
} else {
// Have Request Token already, Get Access Token
$_SESSION['ACCESS_TOKEN'] = serialize($consumer->getAccessToken($_GET, unserialize($_SESSION['REQUEST_TOKEN'])));
header('Location: ' . getCurrentUrl(false));
exit;
}
} else {
// Retrieve mail using Access Token
$accessToken = unserialize($_SESSION['ACCESS_TOKEN']);
工作正常。 但是当我将 $ accessToken 存储到txt文件中时。 其中包含以下内容。
oauth_token=1%2FYJGLd0cfd1R9VpDlZtP2yiznfzgBLrKgT7dIwBaJgM0&oauth_token_secret=nmtJx45vUP6u1_5nIGPQbg1v
在其他文件中我得到此access_token并设置为
$accessToken = new Zend_Oauth_Token_Access();
$accessToken->setToken('1%2FYJGLd0cfd1R9dfdsfVpDlZtP2yizngBLrKgT7dIwBaJgM0');
$accessToken->setTokenSecret('nmtJx45vUP6u1_5dfnIGPQ1v');
这给了我例外。
PHP Fatal error: Uncaught exception 'Zend_Mail_Storage_Exception' with message 'cannot change folder, maybe it does not exist'
和其他是
ext exception 'Zend_Mail_Storage_Exception' with message 'cannot select INBOX, is this a valid transport?
请帮我解决这个问题。