tirins / google
该软件包最新版本(1.0.3)没有可用的许可信息。
CakePHP Google 插件
1.0.3
2015-05-29 15:23 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: 2024-09-28 17:54:34 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);
示例
-
安装 CakePHP Google API Plugin 示例
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