lutsen/updrive
Composer 安装命令:
composer create-project lutsen/updrive
包简介
Allow anyone to upload files to your Google Drive with a simple webform.
README 文档
README
With a simple webform, hosted on your own webserver, anyone you want can upload files to your Google Drive, in folders you specify. UpDrive is a project written in PHP. It uses the Google API client PHP SDK.
Requirements
- PHP 5.5 or newer
- A Google API project
Install UpDrive
Install UpDrive and its dependencies with Composer with this command: $ php composer.phar create-project lutsen/updrive [project-name] 0.5
(Replace [project-name] with the desired directory name for your new project)
Rename config_example.php to config.php and add:
- your server paths
- the names of the folders people can upload to
Create a Google API project web application
Download the json client secret file from you Google API project, rename it to client_secret.json and add it to the UpDrive root directory.
How to create a Google API project
- Go to the Google API Console. Create a new one by selecting Create a new project.
- In the sidebar under "API Manager", select Credentials, then select the OAuth consent screen tab. Choose an Email Address, specify a Product Name, and press Save.
- In the Credentials tab, select the New credentials drop-down list, and choose OAuth client ID.
- Under Application type, select Web application. In the Authorized Redirect URIs field, enter the URL of the oauth2callback.php page.
- Press the Create button.
- Download the client_secret json file (the download button is on the right).
- Rename this file to client_secret.json and add it to the UpDrive root directory.
Use UpDrive
The first time you access UpDrive, you have to connect to the Google account of the Google Drive you want to use. After authorising the UpDrive web application, the OAuth credentials are saved in the credentials.json file. Now people can use the webform to upload files to your Google Drive.
Reconnect UpDrive
To reconnect UpDrive to a Google account, delete the credentials.json file from your webserver and access UpDrive again. Now you can reconnect.
UpDrive project structure
An overview of the directories of a UpDrive and their contents.
public (directory)
Contains the index.php and oauth2callback.php file.
templates (directory)
This directory contains the template files for the setup and form html pages.
vendor (directory)
Created by Composer when installing the project dependencies.
config_example.php (file)
This is an example of the config.php file. The config.php file is needed for UpDrive to work. Rename the config_example.php to config.php and add the necessary details.
init.php (file)
This file includes the config.php and vendor/autoload.php file.
It also sets up the Google_Client object.
The access scope to the Google Drive is defined here to. The UpDrive default is full access. You can find all available access scopes here.
UpDrive is a project of Lútsen Stellingwerff from HoverKraft, and started as a project for Supersolid.
lutsen/updrive 适用场景与选型建议
lutsen/updrive 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 37 次下载、GitHub Stars 达 5, 最近一次更新时间为 2016 年 11 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「file」 「upload」 「webform」 「share」 「google drive」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lutsen/updrive 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lutsen/updrive 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lutsen/updrive 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
MvcCore - Extension - Form - form extension with base classes to create and render web forms with HTML5 controls, to handle and validate submited user data, to manage forms sessions for default values, to manage user input errors and to extend and develop custom fields and field groups.
A recipe to manage default installed webform modules, configurations, and permissions for Varbase webform experience.
Laravel Media Popup to upload/view the files
PMVC Plugin for File information
Mapper for accessing resources in KWCMS
统计信息
- 总下载量: 37
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-23