lubos/google

此包已被废弃且不再维护。未建议替代包。
此包的最新版本(1.0.2)没有可用的许可证信息。

CakePHP Google 插件

安装: 190

依赖者: 0

建议者: 0

安全: 0

星标: 24

关注者: 5

分支: 10

开放问题: 2

类型:cakephp-plugin

1.0.2 2014-03-21 10:48 UTC

This package is not auto-updated.

Last update: 2020-08-17 10:15:30 UTC


README

要求

CakePHP v2.x
Opauth

安装

  1. 使用 composer。将以下内容添加到 composer.json 文件中

    "require": {
    	"lubos/google": "~1.0"
    }
    

    然后运行 php composer.phar update

  2. 安装所有依赖的插件和配置(通过 composer 完成)

  3. 将 Google 账户与您的应用程序连接 http://example.org/auth/google

  4. 在控制器或您希望使用模型的地方包含所需模型

    $uses = array('Google.GoogleDriveFiles');
    ...
    $data = $this->GoogleDriveFiles->listItems();
    debug ($data);
    $data = ClassRegistry::init('Google.GoogleDriveFiles')->listItems();
    debug ($data);

示例

  1. 安装 CakePHP Google API 插件示例

    git clone --recursive https://github.com/LubosRemplik/CakePHP-Google-API-Plugin-sample.git google-sample-app
  2. 创建数据库并运行 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
  3. 配置 - 设置 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