tirins/google

该软件包最新版本(1.0.3)没有可用的许可信息。

CakePHP Google 插件

安装: 13

依赖者: 0

建议者: 0

安全性: 0

星标: 0

观察者: 2

分支: 9

类型:cakephp-plugin

1.0.3 2015-05-29 15:23 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:54:34 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 Plugin 示例

    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