jmadsm / gateway-client
用于JMA数据API的PHP客户端。
v2.17.3
2024-03-08 12:12 UTC
Requires (Dev)
- phpunit/phpunit: ^10.4
- dev-master
- 2.17.3.x-dev
- v2.17.3
- 2.17.2.x-dev
- v2.17.2
- 2.17.1.x-dev
- v2.17.1
- 2.17.0.x-dev
- v2.17.0
- 2.16.2.x-dev
- v2.16.2
- 2.16.1.x-dev
- v2.16.1
- v2.15.5
- 2.15.4.x-dev
- v2.15.4
- 2.15.3.x-dev
- v2.15.3
- 2.15.2.x-dev
- v2.15.2
- v2.15.1
- v2.15.0
- v2.14.1
- v2.14.0
- v2.13.0
- v2.12.2
- v2.12.1
- v2.12.0
- v2.11.0
- v2.10.5
- v2.10.4
- v2.10.3
- v2.10.2
- v2.10.1
- v2.10.0
- v2.9.1
- v2.9.0
- v2.8.1
- v2.8.0
- v2.7.3
- v2.7.2
- v2.7.1
- v2.7.0
- v2.6.1
- v2.6.0
- v2.5.2
- v2.5.1
- v2.4.2
- v2.4.1
- v2.3.6
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.2.22
- v2.2.21
- v2.2.20
- v2.2.19
- v2.2.18
- v2.2.17
- v2.2.16
- v2.2.15
- v2.2.14
- v2.2.13
- v2.2.12
- v2.2.11
- v2.2.10
- v2.2.9
- v2.2.8
- v2.2.7
- v2.2.6
- v2.2.5
- v2.2.4
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.2
- 1.1.1
- 1.0.0
- 0.2.5
- 0.2.4
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.0
- dev-feature/github-action-and-testcase
- dev-feature/add-rawurlencode
- dev-fix/order-variable-names-40764
- dev-feature/custom-apipath
- dev-feature/add-product-images-endpoint
- dev-feature/api-path-for-testing
- dev-feature/netpricecalculator
- dev-feature/improved-errorhandling
- dev-refactor-for-shared-usuability
- dev-feature/order
This package is not auto-updated.
Last update: 2024-09-20 14:55:46 UTC
README
安装包
composer require jmadsm/gateway-client
使用方法
<?php use JmaDsm\GatewayClient\Client; use JmaDsm\GatewayClient\ApiObjects\Product; use JmaDsm\GatewayClient\ApiObjects\Category; // Create singleton instance of the client Client::getInstance( // get the config from JMA $config['base_url'], $config['access_token'], $config['tenant_token'] ); $product = Product::get('product_id'); $categories = Category::all(); while ($category = $categories->next()) { // The categories object will recursively fetch all categories in chuncks. echo $category->name; }
示例
有关如何使用不同对象类型的示例,请参阅示例目录。
如何在部署前测试您的更改?
进入示例文件夹,从示例文件创建config.php文件。在您将必要数据添加到config.php文件后,您可以通过在终端中运行例如"php examples/products.php"来测试方法。这需要您的机器已设置并配置了PHP版本8以上。
新PHPUnit功能用于测试
php vendor/bin/phpunit Tests/ClientTest.php