lubos / google
此包已被废弃且不再维护。未建议替代包。
此包的最新版本(1.0.2)没有可用的许可证信息。
CakePHP Google 插件
1.0.2
2014-03-21 10:48 UTC
Requires
- php: >=5.2.8
- cakephp/cakephp: ~2.0
- composer/installers: ~1.0
- lubos/opauth: ~1.0
This package is not auto-updated.
Last update: 2020-08-17 10:15:30 UTC
README
要求
安装
-
使用 composer。将以下内容添加到
composer.json
文件中"require": { "lubos/google": "~1.0" }
然后运行
php composer.phar update
-
安装所有依赖的插件和配置(通过 composer 完成)
-
将 Google 账户与您的应用程序连接 http://example.org/auth/google
-
在控制器或您希望使用模型的地方包含所需模型
$uses = array('Google.GoogleDriveFiles'); ... $data = $this->GoogleDriveFiles->listItems(); debug ($data);
$data = ClassRegistry::init('Google.GoogleDriveFiles')->listItems(); debug ($data);
示例
-
git clone --recursive https://github.com/LubosRemplik/CakePHP-Google-API-Plugin-sample.git google-sample-app
-
创建数据库并运行 bake 和 schema 脚本
# basic cakephp installation cd google-sample-app/app chmod -R 777 tmp Console/cake bake db_config # schema Console/cake schema create -p Opauth
-
配置 - 设置 Google 凭据
将 bootstrap.php.default 复制到 bootstrap.php 并添加您的 client_id、client_secret。您可以在 https://code.google.com/apis/console/ 获取这些详细信息cp Config/bootstrap.php.default Config/bootstrap.php vim Config/bootstrap.php
注意 您必须正确配置 Opauth