zimbra-api / soap-api
围绕 Zimbra Soap API 的 PHP 封装库
3.0.3
2024-04-23 08:32 UTC
Requires
- php: ^8.1
- jms/serializer: ^3.30
- psr-discovery/http-client-implementations: ^1.0
- psr-discovery/http-factory-implementations: ^1.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- psr/log: ^3.0
Requires (Dev)
- fakerphp/faker: ^1.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^7.0 | ^8.0 | ^9.0
Suggests
- guzzlehttp/guzzle: Required if you like to use Guzzle PSR-18 HTTP Client & PSR-7 HTTP message factories
- symfony/cache: Required if you like to use Serializer Annotations & Metadata caching
README
这个库是 Zimbra SOAP API 的简单面向对象封装。
要求
- PHP 8.1.x 或更高版本
- PSR Discovery 库,用于搜索已安装的 http 客户端和 http 消息工厂
- Serializer 库,用于 (反) 序列化 XML
- (可选) PHPUnit 运行测试
安装
通过 Composer
$ composer require zimbra-api/soap-api
或直接将其添加到您的 composer.json
文件中。
{ "require": { "zimbra-api/soap-api": "*" } }
管理 API 的基本用法
<?php declare(strict_types=1); require_once 'vendor/autoload.php'; use Zimbra\Admin\AdminApi; use Zimbra\Common\Enum\AccountBy; use Zimbra\Common\Struct\AccountSelector; $api = new AdminApi('https://zimbra.server:7071/service/admin/soap'); $api->auth($username, $password); $account = $api->getAccountInfo(new AccountSelector(AccountBy::NAME, $accountName));
从 $api
对象,您可以访问所有 Zimbra 管理API。
许可
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.