footsteps-marketing / ace-store
检索Ace Hardware商店信息
0.5.2
2016-11-18 20:20 UTC
Requires
- php: >=5.6.0
- guzzlehttp/guzzle: ^6.2
- symfony/yaml: ^3.0
This package is not auto-updated.
Last update: 2024-09-16 17:42:11 UTC
README
#ace-store
从ACE的商店定位API获取商店信息。支持一些有趣的功能。
使用方法
使用composer安装
composer require footsteps-marketing/ace-store
然后在您的项目中使用它
require __DIR__ . '/vendor/autoload.php'; $storeNumber = 1234; $store = new FootstepsMarketing\Ace\Store($storeNumber); echo $store->getLocationName();
要求
- PHP >=5.6
缓存
Ace商店响应的缓存可以通过两种方式实现
define('FSM_ACE_CACHE_FOLDER', '/path/to/cache'); $store = new FootstepsMarketing\Ace\Store(1234); // or $store = new FootstepsMarketing\Ace\Store(1234, '/path/to/cache');
缓存生命周期默认为一周——可以通过设置常量FSM_ACE_CACHE_LIFETIME进行修改
define('FSM_ACE_CACHE_LIFETIME', 1 * 24 * 60 * 60); // Desired lifetime in seconds define('FSM_ACE_CACHE_FOLDER', '/path/to/cache'); $store = new FootstepsMarketing\Ace\Store(1234);
Ace商店响应将被存储在Ace缓存文件夹中,格式为<storenumber>.json
配置
配置可以存储在YAML格式,存储位置由常量FSM_ACE_CONFIG_PATH设置
config.yaml
map: exclusive: true # Return only values with valid mappings? departments: # 'Original Value': 'New Value' 'Automotive': 'Auto' 'Clothing': 'Apparel' 'Gas Stoves': 'Stoves' services: 'Blade Sharpening': 'Knife Sharpening' 'Chain Saw Sharpening': 'Chainsaw Sharpening' 'Gift Card': 'Gift Cards' 'Special Order 65,000+ items': 'Special Order Services' brands: 'Webber Grills': 'Weber Grills'
PHP
define('FSM_ACE_CONFIG_PATH', '/path/to/config.yaml'); $store = new FootstepsMarketing\Ace\Store(1234); $brands = $store->getServices(); // This will return values based on the mapping above