zimbra-api/soap-api

围绕 Zimbra Soap API 的 PHP 封装库

3.0.3 2024-04-23 08:32 UTC

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。

许可

BSD 3-Clause

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.