synaq/zasa-bundle

此包的最新版本(6.0)没有可用的许可证信息。

Symfony2 对 Zimbra Soap Admin API(ZASA)的包装器

安装次数: 2,159

依赖关系: 1

建议者: 0

安全: 0

星标: 9

关注者: 3

分支: 5

开放问题: 1

类型:symfony-bundle

6.0 2022-04-20 07:54 UTC

README

A Symfony2 wrapper for the Zimbra SOAP Admin API (ZASA). This bundle uses a custom XML builder to post SOAP requests over CURL or using the fopen() wrappers.

This bundle works with Zimbra 7 & 8

This bundle was written to work specifically with our business model, so some functions return non-standard output. However, it should work with many use cases.

需求

  • PHP 5.3 with curl support
  • Symfony 2.7 or greater

安装

步骤 1

使用 composer 管理依赖关系并下载 SynaqZasaBundle

$ php composer.phar update synaq/zasa-bundle

步骤 2

将包添加到您的 AppKernel

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Synaq\ZasaBundle\SynaqZasaBundle(),
        new Synaq\CurlBundle\SynaqCurlBundle(),
        // ...
    );
}

步骤 3

添加包配置

synaq_zasa:
    server: your-zimbra-server.com
    admin_user: your-admin-user
    admin_pass: your-admin-password
    use_fopen: true|false
    auth_token_path: /path/to/optional/existing/auth/token
    rest_base_url: http://your-zimbra-server-rest-url-without-service-endpoint.some-host.com
    
synaq_curl:
    cookie_file: false
    options: { CURLOPT_RETURNTRANSFER: true, CURLOPT_SSL_VERIFYPEER: false, CURLOPT_SSL_VERIFYHOST: false, CURLOPT_SSL_CIPHER_LIST: %curl_cipher_list% }

##使用 您可以通过获取 'synaq_zasa.connector' 服务来使用 Zimbra 连接器

class SomeController extends Controller
{
    public function someAction()
    {
        //...
        $connector = $this->get('synaq_zasa.connector');
        //...
    }
}

然后您可以使用控制器进行请求

$account = $connector->getAccount('user@domain.com');

请参阅 ZimbraConnector 类以获取可用类。

##开发

可以使用包含的 Dockerfile 和现成的构建脚本来构建包含完整开发环境的 Docker 镜像

./scripts/docker/build.sh

这会构建一个 synaq/zimbra-connector-dev 镜像,该镜像已预配置 XDebug 以远程调试到本地 XDebug 客户端。

要在一个基于该镜像的容器内进行交互式终端会话,其中项目工作目录已挂载为 /opt/project,请运行

./scripts/docker/terminal.sh