我正在使用oauthclient将 twitter 登录添加到我的 codeigniter 项目,但它在“Oauthclient”库的“connect”函数中停止工作,我不知道确切原因!这是解释器停止的行:
$oauth = new OAuth($this->consumerKey, $this->consumerSecret);
这是“连接”功能:
function connect() {
if ($this->_oAuthVersion == 1) {
try {
$oauth = new OAuth($this->consumerKey, $this->consumerSecret);
$request_token_info = $oauth->getRequestToken($this->_oAuthRequestTokenUrl, $this->responseUrl);
if(!empty($request_token_info)) {
$this->ci->session->set_userdata("oauth_token_secret", $request_token_info['oauth_token_secret']);
header("Location: ".$this->_oAuthRedirectUrl.$request_token_info['oauth_token']);
} else {
print "Failed fetching request token, response was: " . $oauth->getLastResponse();
}
} catch(OAuthException $E) {
// TODO: Handle exceptions in a better way
// print_r($E);
// echo "Response (RequestToken): ". $E->lastResponse . "\n";
}
} else {
// If oAuth v2, we must be sure the url's are correctly poppulated
// therefor, set the service type again
$this->setService($this->serviceType);
header("Location: ".$this->_oAuthRedirectUrl);
}
}
我需要你的帮助,拜托。