gennadyx / php-shop-logistics.ru-api
php-shop-logistics.ru-api composer 包
0.1.2
2017-10-05 20:03 UTC
Requires
- php: ~5.6|~7.0
- myclabs/php-enum: ^1.5
- php-http/httplug: ^1.1
- php-http/message-factory: ^1.0
Requires (Dev)
- php-http/client-common: ^1.4
- php-http/curl-client: ^1.6
- php-http/mock-client: ^0.3
- phpunit/phpunit: ~5.7
- squizlabs/php_codesniffer: ^2.3
- symfony/serializer: ^3.2
- zendframework/zend-diactoros: ^1.3
Suggests
- symfony/serializer: For using xml encoder/decoder from serializer component
This package is not auto-updated.
Last update: 2024-09-24 23:36:28 UTC
README
##php-shop-logistics.ru-api shop-logistics.ru 远程函数的 PHP oop 包装器
安装
通过 Composer
$ composer require gennadyx/php-shop-logistics.ru-api
用法
use Gennadyx\ShopLogisticsRu\ApiClientBuilder; use Gennadyx\ShopLogisticsRu\Environment; use Gennadyx\ShopLogisticsRu\Api\Dictionary; use Http\Message\MessageFactory\DiactorosMessageFactory; use Http\Message\StreamFactory\DiactorosStreamFactory; $client = ApiClientBuilder::create() ->withRequestFactory(new DiactorosMessageFactory()) ->withStreamFactory(new DiactorosStreamFactory()) ->withEncoder(function ($data) { $xml = ''; //your logic here return $xml; }) ->withEnvironment(Environment::PROD()) ->withKey('your_key') ->build(); //or just build with default parameters $client = ApiClientBuilder::create()->build(); /** @var Dictionary $dictionary */ $dictionary = $client->api('dictionary'); //call remote function $cities = $dictionary->getCities(); //or $states = $client->dictionary->getStates();//array //if any error (http exception or other) $metro = $client->dictionary->getMetro(); //$metro instance of \Gennadyx\ShopLogisticsRu\Response\Error with error code
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG。
测试
$ composer test
贡献
有关详细信息,请参阅 CONTRIBUTING。
安全
如果您发现任何安全相关的问题,请通过电子邮件 dev@gennadyx.tech 而不是使用问题跟踪器。
鸣谢
许可协议
MIT 许可协议 (MIT)。有关更多信息,请参阅 许可文件。