0

我正在尝试在 cakephp 中放置一个 Linkedin 插件,使用本教程http://excellencetechnologies.co.in/Telephonia/blog/linked-login-integration-in-cakephp/

在我登录linkedin之前一切正常,但之后我被定向到只有这两个错误的页面:

 Notice (8): OAuthRequest::from_consumer_and_token(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "OAuthToken" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition [APP\Plugin\Linkedin\Vendor\OAuth\OAuth.php, line 316]

 Notice (8): OAuthSignatureMethod_HMAC_SHA1::build_signature() [oauthsignaturemethod-hmac-sha1.build-signature]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "OAuthToken" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition [APP\Plugin\Linkedin\Vendor\OAuth\OAuth.php, line 126]

我在网上的任何地方都找不到可能导致它们的原因,所以我想知道这里是否有人知道是什么原因造成的。

4

1 回答 1

0

无论在代码中的任何位置,插件都会从会话中提取访问令牌,如下所示:

$accessToken = $this->Session->read($this->sessionAccess);

它以 __PHP_Incomplete_Class 对象的形式提取令牌。要纠正这个问题,您必须像这样反序列化 $accessToken:

$accessToken = $this->Session->read($this->sessionAccess);

$accessToken = unserialize (serialize ($accessToken));

我在代码中的三个位置做了它来纠正它。

希望它也对你有用。

于 2013-07-28T22:30:55.957 回答