webfoersterei / domain-bestellsystem-api-client
用于使用 domain-bestellsystem.de 的 XML-SOAP-API 的客户端
0.3.0-alpha1
2018-07-21 15:07 UTC
Requires
- php: >=7.1
- ext-soap: *
- monolog/monolog: ^1.23
- phpdocumentor/reflection-docblock: ^4.1
- symfony/property-access: ^4.1
- symfony/property-info: ^4.1
- symfony/serializer: ^4.1
Requires (Dev)
- phpunit/phpunit: ^7.2
- zendframework/zend-code: ^3.0.4
This package is auto-updated.
Last update: 2024-09-05 03:59:56 UTC
README
domain-bestellsystem API 客户端
用于使用 domain-bestellsystem.de 的 XML-SOAP-API 的客户端
安装
您可以通过将其添加到 composer 依赖项中来将此库包含到项目中
composer require webfoersterei/domain-bestellsystem-api-client
需求
- PHP 版本 >= 8.0
- PHP ext-soap (SOAP-扩展)
- composer - PHP 的依赖管理器(见 https://getcomposer.org.cn/)
使用方法
只需使用工厂创建所需的 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
请注意,这是一个开源项目,您必须同意提供的许可证