zimbra-api/upload-api
最新稳定版本:3.0.0
Composer 安装命令:
composer require zimbra-api/upload-api
包简介
PHP wrapper library around the Zimbra upload service
README 文档
README
PHP wrapper library around the Zimbra upload service.
Requirement
- PHP 8.1.x or later,
- PSR Discovery library for searching installed http clients and http message factories,
- (optional) PHPUnit to run tests,
Installation
Via Composer
$ composer require zimbra-api/upload-api
or just add it to your composer.json file directly.
{ "require": { "zimbra-api/upload-api": "*" } }
This package using PSR-17: HTTP Factories, PSR-18: HTTP Client for creating multipart stream & sending HTTP requests to Zimbra upload service. Make sure to install package(s) providing "http client implementation" & "http factory implementation". The recommended package is Guzzle which provide both PSR-17 & PSR-18.
$ composer require guzzlehttp/guzzle
Basic usage of zimbra upload client
<?php require_once 'vendor/autoload.php'; use Zimbra\Upload\Client; use Zimbra\Upload\Request; $file = new \SplFileInfo($filePath); $request = new Request([$file], $requestId, $authToken); $client = new Client('https://zimbra.server/service/upload'); $attachments = $client->upload($request);
$authToken is user authentication token, it can obtain from zimbra soap api.
<?php require_once 'vendor/autoload.php'; use Zimbra\Account\AccountApi; $api = new AccountApi('https://zimbra.server/service/soap'); $auth = $api->authByName('username', 'password'); $authToken = $auth->getAuthToken();
Licensing
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-08-01