我正在尝试使用本教程http://excellencetechnologies.co.in/Telephonia/blog/linked-login-integration-in-cakephp/
在cakephp中放置一个Linkedin插件在我登录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]
我找不到可能导致他们在网上任何地方的原因,所以我想知道这里是否有人知道是什么导致了这一点。
答案 0 :(得分:0)
在代码中,插件从会话中拉出访问令牌,如下所示:
$accessToken = $this->Session->read($this->sessionAccess);
它以__PHP_Incomplete_Class对象的形式提取令牌。要解决此问题,您必须反序列化$ accessToken,如下所示:
$accessToken = $this->Session->read($this->sessionAccess);
$accessToken = unserialize (serialize ($accessToken));
我在代码中的三个位置进行了更正。
希望它也适合你。