tomas-kulhanek / czech-data-box
Czech republic (捷克共和国) 数据盒集成系统 (ISDS) 连接的 PHP 库
v5.0.0
2024-05-24 12:05 UTC
Requires
- php: >=8.2
- ext-curl: *
- ext-dom: *
- ext-mbstring: *
- ext-openssl: *
- ext-xml: *
- symfony/validator: ^7.0
- tomas-kulhanek/serializer: ^2.0.3
Requires (Dev)
- guzzlehttp/guzzle: ^7.8
- nyholm/psr7: ^1.8
- php-http/httplug: ^2.4
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^10.5
- rector/rector: ^1.0
- squizlabs/php_codesniffer: ^3.9
- symfony/http-client: 5.4.*|6.*|7.*
Suggests
- ext-curl: for comunication with czech databox servers
- guzzlehttp/guzzle: for usage with guzzle
- symfony/http-client: for usage with symfony
README
⚠ 注意!! 如果您实施 ISDS 连接,必须遵守 操作规则⚠
安装
Composer
为了安装包,您必须通过 composer 安装。
composer require tomas-kulhanek/czech-data-box
接下来需要使用某些客户端。可以使用 Guzzle 或 Symfony Http client
composer require tomas-kulhanek/czech-data-box guzzlehttp/guzzle:^7.0
composer require tomas-kulhanek/czech-data-box symfony/http-client
如果使用自定义 HTTP 客户端,只需实现接口 TomasKulhanek\CzechDataBox\Provider\ClientProviderInterface
并将其传递给类 TomasKulhanek\CzechDataBox\Connector
的构造函数。当然,还需要确保正确设置头部或客户端 SSL 证书。
描述
这个库用于与信息系统能数据盒 ISDS 或 ISDS 测试 进行基本通信
基本使用
每个操作都需要输入访问凭据
<?php $account = new \TomasKulhanek\CzechDataBox\Account(); $account->setPassword('mojeTajneHeslo') ->setLoginName('mujLogin') ->setLoginType(\TomasKulhanek\CzechDataBox\Enum\LoginTypeEnum::NAME_PASSWORD) ->setProduction(false);
使用 Symfony HTTP client
安装
composer require tomas-kulhanek/czech-data-box symfony/http-client
实例化
$serializer = \TomasKulhanek\Serializer\SerializerFactory::create(); $guzzleProvider = \TomasKulhanek\CzechDataBox\Provider\SymfonyClientProvider::create(); $connector = new \TomasKulhanek\CzechDataBox\Connector($serializer, $guzzleProvider);
使用 Guzzle 7
安装
composer require tomas-kulhanek/czech-data-box guzzlehttp/guzzle:^7.0
实例化
$serializer = \TomasKulhanek\Serializer\SerializerFactory::create(); $guzzleProvider = \TomasKulhanek\CzechDataBox\Provider\GuzzleClientProvider::create(); $connector = new \TomasKulhanek\CzechDataBox\Connector($serializer, $guzzleProvider);
帮助和错误解决方案
如果您需要帮助或类在实施时显示错误,请创建新的 Issues。基本帮助完全免费通过 Issues 提供。
链接
- 生产 ISDS - https://mojedatoveschranky.cz
- 测试 ISDS - https://czebox.cz
- ISDS 操作规则 - https://info.mojedatovaschranka.cz/info/cs/80.html
- 咨询 - https://poradnaisds.cz/
数据盒设立请求
生产环境
测试环境
通过 czecbox.cz 环境中的表单在 www.mojedatoveschranky.cz 生产门户上建立测试数据盒是可能的,登录后进入设置