siestacat / upload-api-client
php-upload-api symfony项目的API客户端
1.0.3
2024-01-04 23:37 UTC
Requires
- php: >=8.0
- ext-curl: *
Requires (Dev)
- donatj/mock-webserver: ^2.7
- fakerphp/faker: ^1.23
- phpunit/phpunit: ^10.2.2
- siestacat/random-file-generator: ^1.0
- symfony/string: ^7.0
README
https://github.com/SiestaCat/php-upload-api 应用的客户端
安装
composer require siestacat/upload-api-client
用法
use Siestacat\PhpUploadApiClient\Client;
$client = new Client('https:///api', 'changeme');
$upload_token = $client->request();
//<<Here the client upload the files from browser>>
//Get the uploaded files:
// Siestacat\PhpUploadApiClient\File[]
$files = $client->getFiles($upload_token);
//Download single file. Get the tmp path of downloaded file:
$downloaded_file = $client->download($upload_token, $file[0]->hash);
测试
git clone https://github.com/SiestaCat/php-upload-api-client.git
cd php-upload-api-client
composer install
composer run-script test