yaroslavche / sylius-exchange-rates-updater-plugin
Sylius 汇率更新控制台命令。
0.1.0
2018-09-01 17:17 UTC
Requires
- php: ^7.1
- guzzlehttp/guzzle: ^6.3
- sylius/sylius: ~1.2.3
- symfony/symfony: ^3.4|^4.1
Requires (Dev)
- behat/behat: ^3.4
- behat/mink: ^1.7@dev
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/context-service-extension: ^1.2
- friends-of-behat/cross-container-extension: ^1.1
- friends-of-behat/service-container-extension: ^1.0
- friends-of-behat/symfony-extension: ^1.2.1
- friends-of-behat/variadic-extension: ^1.1
- lakion/mink-debug-extension: ^1.2.3
- phpspec/phpspec: ^4.0
- phpstan/phpstan-doctrine: ^0.10
- phpstan/phpstan-shim: ^0.10
- phpstan/phpstan-symfony: ^0.10
- phpstan/phpstan-webmozart-assert: ^0.10
- phpunit/phpunit: ^6.5
- sylius-labs/coding-standard: ^2.0
This package is auto-updated.
Last update: 2024-09-06 09:27:51 UTC
README
bin/console sylius:exchange-rates:generate
此命令从Sylius提供的货币中生成所有可用的唯一货币对。
更新汇率
bin/console sylius:exchange-rates:update
此命令尝试更新Sylius中所有现有的汇率。
安装
composer require yaroslavche/sylius-exchange-rates-updater-plugin
注册插件
# app/AppKernel.php # ... public function registerBundles(): array { $bundles = [ # ... new \Acme\SyliusExchangeRatesUpdaterPlugin\AcmeSyliusExchangeRatesUpdaterPlugin(), ]; #... }
导入服务配置
#app/config/config.yml imports: # ... - { resource: '@AcmeSyliusExchangeRatesUpdaterPlugin/Resources/config/services.yml' } # ...
并添加参数
#app/config/parameters.yml parameters: # ... exchange_rates_updater_plugin.openexchangerates: 'your_api_key' exchange_rates_updater_plugin.fixer: 'your_api_key' # not used now
用法
对于每日更新,将以下内容添加到crontab中
0 0 * * * /path_to_sylius/bin/console sylius:exchange-rates:update