webfoersterei/domain-bestellsystem-api-client

用于使用 domain-bestellsystem.de 的 XML-SOAP-API 的客户端

0.3.0-alpha1 2018-07-21 15:07 UTC

This package is auto-updated.

Last update: 2024-09-05 03:59:56 UTC


README

Build Status

domain-bestellsystem API 客户端

用于使用 domain-bestellsystem.de 的 XML-SOAP-API 的客户端

安装

您可以通过将其添加到 composer 依赖项中来将此库包含到项目中

composer require webfoersterei/domain-bestellsystem-api-client

需求

使用方法

只需使用工厂创建所需的 API 客户端并使用它即可

require_once 'vendor/autoload.php';

$domainClient = ClientFactory::createDomainClient(API_URL, API_USER, API_PASSWORD);
$domainClient->check('webfoersterei.de')->isAvailable(); # false

日志记录

您可以通过在调用工厂之前通知工厂来将您的 Monolog 日志记录器注入到所有客户端中

$myLogger = new \Monolog\Logger('testlogger');
$myLogger->pushHandler(new \Monolog\Handler\StreamHandler('domain-bestellsystem_info.log', \Psr\Log\LogLevel::INFO)); # will log INFO-messages to a file
ClientFactory::setLogger($myLogger);

// ... create clients

调试

有一个 DebugClientFactory,它设置 SOAP 跟踪标志并提供默认日志到 STDOUT。您可以使用它作为 ClientFactory 的替代品来查看低级别请求和响应体

$domainClient = DebugClientFactory::createDomainClient(API_URL, API_USER, API_PASSWORD);
$domainClient->check('webfoersterei.de')->isAvailable(); # will produce debug output on stdout

贡献

请随意通过报告错误和问题或创建拉取请求来为此项目做出贡献:https://github.com/webfoersterei/domain-bestellsystem-api-client

请注意,这是一个开源项目,您必须同意提供的许可证