0

我在服务器端实现了谷歌登录按钮。

我在该行收到语法错误:

$tokenInfo = json_decode($client::getIo()->authenticatedRequest($req)->getResponseBody());

然而,这直接取自https://developers.google.com/+/web/signin/server-side-flow

我是 PHP 新手,因此无法清楚地理解这些 PHP 语法。符号 :: 是什么意思?这是否需要任何特定版本的 php?

请帮忙

4

1 回答 1

0

See my answer to this question which I think may be your problem.

In the line you are having trouble with:

$tokenInfo = json_decode($google::getIo()->authenticatedRequest($req)->getResponseBody());  

:: change to ->. and getIo() should be changed to getAuth() due to (I think) a migration within the api.

After that, I encountered another error in which I changed: if ($token->error) to if(isset($tokenInfo->error))

Good Luck!

于 2015-03-22T21:07:53.133 回答