https://github.com/zingimmick/flysystem-tos
TOS filesystem adapter for Flysystem
https://github.com/zingimmick/flysystem-tos
filesystem flysystem tos
Last synced: 5 months ago
JSON representation
TOS filesystem adapter for Flysystem
- Host: GitHub
- URL: https://github.com/zingimmick/flysystem-tos
- Owner: zingimmick
- License: mit
- Created: 2024-03-21T07:05:03.000Z (over 1 year ago)
- Default Branch: 2.x
- Last Pushed: 2024-10-10T02:14:25.000Z (9 months ago)
- Last Synced: 2024-10-30T01:51:25.672Z (9 months ago)
- Topics: filesystem, flysystem, tos
- Language: PHP
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Flysystem TOS
> **Requires**
> - **[PHP 8.0+](https://php.net/releases/)**
> - **[Flysystem 3.10+](https://github.com/thephpleague/flysystem/releases)**## Version Information
| Version | Flysystem | PHP Version | Status |
|:--------|:----------|:------------|:------------------------|
| 2.x | 3.10+ | >= 8.0 | Active support :rocket: |
| 1.x | 1.x | >= 7.2 | Active support |Require Flysystem TOS using [Composer](https://getcomposer.org):
```bash
composer require zing/flysystem-tos
```## Usage
```php
use League\Flysystem\Filesystem;
use Tos\TosClient;
use Zing\Flysystem\Tos\TosAdapter;$prefix = '';
$config = [
'ak' => 'aW52YWxpZC1rZXk=',
'sk' => 'aW52YWxpZC1zZWNyZXQ=',
'region' => 'cn-shanghai',
'bucket' => 'test',
'endpoint' => 'tos-cn-shanghai.volces.com',
];$config['options'] = [
'url' => '',
'endpoint' => $config['endpoint'],
'bucket_endpoint' => '',
'temporary_url' => '',
];$client = new TosClient($config);
$adapter = new TosAdapter($client, $config['bucket'], $prefix, null, null, $config['options']);
$flysystem = new Filesystem($adapter);
```## Integration
- Laravel: [zing/laravel-flysystem-tos](https://github.com/zingimmick/laravel-flysystem-tos)
## Reference
[league/flysystem-aws-s3-v3](https://github.com/thephpleague/flysystem-aws-s3-v3)
## License
Flysystem TOS is an open-sourced software licensed under the [MIT license](LICENSE).