igorkgg / flysystem-akamai-netstorage
Akamai Netstorage 文件系统适配器,用于 Flysystem。
v3.0.2
2023-12-15 20:08 UTC
Requires
- php: ^8.1
- ext-fileinfo: *
- guzzlehttp/guzzle: ^7.5.0
- league/flysystem: ^3.0
- monolog/monolog: ^3.0
Requires (Dev)
- phpspec/prophecy-phpunit: ^2.1.0
- phpunit/phpunit: ^10.2
This package is auto-updated.
Last update: 2024-09-15 22:06:57 UTC
README
我创建此包的原因是 官方 Akamai 包 已不再由 Akamai 维护,并且无法更新到 Flysystem >= 2。
要求
- PHP: ^8.1
- Guzzle: ^7.5
- Monolog: ^3.0
- Flysystem: ^3.0
安装
$ composer require "igorkgg/flysystem-akamai-netstorage" -vvv
用法
use League\Flysystem\Filesystem; use League\Flysystem\AkamaiNetStorage\AkamaiNetStorageAdapter; use League\Flysystem\AkamaiNetStorage\AkamaiNetStorageClientFactory; ... $clientConfig = [ 'signer' => [ 'key' => 'key', 'name' => 'keyName', ], 'edgegrid' => [ 'base_uri' => 'testing.akamaihd.net.example.org', 'timeout' => 300, ], ]; $cpCode = '123456'; $pathPrefix = 'working-dir'; $baseUrl = 'company.akamaihd.net.example.org'; $client = (new AkamaiNetStorageClientFactory($clientConfig))->getClient(); $adapter = new AkamaiNetStorageAdapter( $client, $cpCode, $pathPrefix, $baseUrl ); $filesystem = new Filesystem($adapter); $file = 'example.txt'; $filesystem->write($file, 'test content');