samuelvi/spreadsheet-translator-provider-googledrive
最新稳定版本:v8.4.0
Composer 安装命令:
composer require samuelvi/spreadsheet-translator-provider-googledrive
包简介
Spreadsheet Translator - Google Drive Provider with no authentication
README 文档
README
A Google Drive provider for Spreadsheet Translator that requires no authentication. This provider allows you to fetch translations directly from publicly accessible Google Spreadsheets.
Requirements
- PHP 8.4 or higher
- Composer
Installation
You can install the package via composer:
composer require samuelvi/spreadsheet-translator-provider-googledrive
Usage
Basic Example
<?php require_once __DIR__ . '/vendor/autoload.php'; use Atico\SpreadsheetTranslator\SpreadsheetTranslator; $spreadsheetTranslator = new SpreadsheetTranslator([ 'provider' => 'google_drive', 'source_resource' => 'https://docs.google.com/spreadsheets/d/YOUR_SPREADSHEET_ID/edit#gid=YOUR_SHEET_ID', ]); $translations = $spreadsheetTranslator->getTranslations('en');
Configuration Options
provider: Must be set to'google_drive'source_resource: The URL of your Google Spreadsheet (must be publicly accessible)format: Optional, defaults to'csv'temp_local_source_file: Optional, temporary file path for downloaded spreadsheet
Making Your Spreadsheet Public
For this provider to work, your Google Spreadsheet must be publicly accessible:
- Open your Google Spreadsheet
- Click on "Share" button
- Change to "Anyone with the link can view"
- Copy the spreadsheet URL
Development
Installation
make install
Running Tests
Run all tests:
make test
Run tests with coverage:
make test-coverage
Code Quality
Run Rector (dry-run to see changes):
make rector-dry
Apply Rector changes:
make rector
Validate composer.json:
make validate
Run all checks (validate, rector-dry, test):
make check
Available Make Commands
Run make help to see all available commands:
make help
Project Structure
.
├── src/
│ ├── GoogleDriveProvider.php # Main provider implementation
│ └── GoogleDriveConfigurationManager.php # Configuration management
├── tests/
│ ├── GoogleDriveProviderTest.php
│ └── GoogleDriveConfigurationManagerTest.php
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI configuration
├── composer.json
├── phpunit.xml # PHPUnit configuration
├── rector.php # Rector configuration for PHP 8.4
├── Makefile # Development commands
└── README.md
Testing
The package includes comprehensive unit tests. Run them with:
vendor/bin/phpunit
Or using make:
make test
Continuous Integration
This package uses GitHub Actions for continuous integration. The CI pipeline:
- Validates composer.json
- Installs dependencies
- Runs Rector checks
- Executes all tests
See .github/workflows/ci.yml for details.
License
The MIT License (MIT). Please see License File for more information.
Credits
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-12