samuelvi/spreadsheet-translator-provider-googledriveauth
Composer 安装命令:
composer require samuelvi/spreadsheet-translator-provider-googledriveauth
包简介
Spreadsheet Translator - Google Drive With Authentication Provider
README 文档
README
This package retrieves protected spreadsheet documents from Google Drive with authentication support.
Features
- 🔐 OAuth2 authentication with Google Drive API
- 📊 Support for Google Sheets spreadsheets
- 🔄 Automatic token refresh
- 📝 Multiple output formats (XLSX, Matrix)
- 🧪 Comprehensive test coverage
- 🚀 PHP 8.4 ready with modern syntax
Requirements
- PHP >= 8.4
- Composer
- Google Cloud Platform account with Drive API enabled
Installation
composer require samuelvi/spreadsheet-translator-provider-googledriveauth
How to Create Google Drive Credentials
- Create a project at Google Cloud Console. You will need a Google account.
- Enable the Google Sheets API following the official guide
- Download the Client Configuration file (credentials.json) to a private folder
- First-time authentication: When running the application for the first time, a URL will be displayed. Open it in your browser, grant permissions, and paste the authorization code back into the terminal.
Detailed Setup Steps
- Log into your Google account
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Sheets API and Google Drive API
- Create OAuth 2.0 credentials (Desktop app type recommended)
- Download the credentials JSON file
- Set up the configuration with the path to your credentials file
Usage
use Atico\SpreadsheetTranslator\Core\Configuration\Configuration; use Atico\SpreadsheetTranslator\Provider\GoogleDriveAuth\GoogleDriveAuthProvider; $configuration = new Configuration([ 'application_name' => 'My Application', 'credentials_path' => '/path/to/credentials.json', 'client_secret_path' => '/path/to/token.json', 'source_resource' => 'https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit', 'format' => 'xlsx', 'temp_local_source_file' => '/tmp/output.xlsx' ]); $provider = new GoogleDriveAuthProvider($configuration); $resource = $provider->handleSourceResource();
Development
Quick Start
# Install dependencies make install # Run tests make test # Run Rector code quality checks make rector-dry # Run all CI checks make ci
Available Make Commands
make install- Install all dependenciesmake update- Update all dependenciesmake test- Run testsmake test-coverage- Run tests with coverage reportmake rector- Apply Rector refactoringmake rector-dry- Check Rector suggestions without applyingmake clean- Remove vendor and cache directoriesmake ci- Run all CI checks (rector + tests)
Testing
The project includes comprehensive unit tests. Run them using:
make test # Or with coverage make test-coverage
Code Quality
This project uses Rector for automated refactoring and code quality improvements:
# Check what would be changed make rector-dry # Apply changes make rector
Related Projects
- Spreadsheet Translator Core - Core library
- Spreadsheet Translator Symfony Bundle - Symfony integration
Contributing
We welcome contributions! Please feel free to submit pull requests or open issues for bugs and feature requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Run tests and code quality checks (
make ci) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
All contributors must abide by our code of conduct.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Samuel Vicent - samuelvicent@gmail.com
samuelvi/spreadsheet-translator-provider-googledriveauth 适用场景与选型建议
samuelvi/spreadsheet-translator-provider-googledriveauth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.86k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 samuelvi/spreadsheet-translator-provider-googledriveauth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 samuelvi/spreadsheet-translator-provider-googledriveauth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-03