yidas/google-api-sample

PHP的Google API客户端库,包括Google服务示例

0.1.0 2018-06-13 07:44 UTC

This package is auto-updated.

Last update: 2024-09-10 21:10:11 UTC


README

PHP的Google API客户端库,包括Google服务示例

Latest Stable Version Latest Unstable Version License

安装

1. 下载项目

Composer下载

composer create-project --prefer-dist yidas/google-api-sample

您可以通过git clone或zip文件进行下载。

2. Google API凭证

Google API控制台中,您需要设置一个凭证,包括将网站根URL指向“授权重定向URI”,例如 http://{thisPackage}/www/callback.php,然后在库中启用API,如Google+ API、日历API和Drive API。

然后下载凭证JSON文件,将其重命名并放置到 {thisPackage}/files/client_secret.json

库的包含

  • 用户组件

  • Google日历API组件

GOOGLE服务演示

  • Google Plus
    用于获取Google用户信息。

  • 日历

  • 磁盘驱动器

附加功能

Guzzle SSL验证问题

如果您使用Windows作为服务服务器,您可能会遇到 SSL证书问题

您可以通过修改 vendor/google/apiclient/src/Google/Client.php 来解决这个问题。

// For windows PHP cURL
$options['verify'] = false;

此应用未经验证问题

Google – OAuth客户端验证