Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Cakephp中使用Linkedin插件的错误通知_Php_Api_Cakephp_Plugins_Linkedin - Fatal编程技术网

在Cakephp中使用Linkedin插件的错误通知

在Cakephp中使用Linkedin插件的错误通知,php,api,cakephp,plugins,linkedin,Php,Api,Cakephp,Plugins,Linkedin,我正试图使用本教程将Linkedin插件放到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 c

我正试图使用本教程将Linkedin插件放到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]

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

在代码中,插件从会话中提取访问令牌的任何地方,如下所示:

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

它以_PHP_complete_Class对象的形式提取令牌。要纠正此问题,您必须如下所示取消序列化$accessToken:


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

$accessToken=unserialize(序列化($accessToken));

我在代码中的三个点进行了修改

希望它也能对你起作用