yavuz/exchange-rates
最新稳定版本:1.0.0
Composer 安装命令:
composer require yavuz/exchange-rates
包简介
Exchange rates API library
README 文档
README
Exchange rates API built using Dependency Injection.
This library requires PHP >= 8.1
Installation
The recommended way to install the Exchange Rates library is through Composer:
$ composer require yavuz/exchange-rates
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Usage
Usage Example TCMB Driver
use Yavuz\ExchangeRates\ExchangeRate\ExchangeRate; use Yavuz\ExchangeRates\ExchangeRate\Services\Tcmb; require_once 'vendor/autoload.php'; require_once 'src/Config/Config.php'; require_once 'src/Helper/Helper.php'; try { $exchangeRatesTCMB = (new ExchangeRate(new Tcmb())) ->setBaseCurrency('TRY') ->setCurrencies(['USD', 'EUR']) ->setCacheTime(1800) ->getResult(); dump($exchangeRatesTCMB); } catch (Exception $e) { echo $e->getMessage(); }
Usage Example CurrencyAPI Driver
use Yavuz\ExchangeRates\ExchangeRate\ExchangeRate; use Yavuz\ExchangeRates\ExchangeRate\Services\CurrencyAPI; require_once 'vendor/autoload.php'; require_once 'src/Config/Config.php'; require_once 'src/Helper/Helper.php'; try { $exchangeRatesCurrencyAPI = (new ExchangeRate(new CurrencyAPI())) ->setAPIKey('api-key') ->setBaseCurrency('TRY') ->setCurrencies('GBP') ->getResult(); dump($exchangeRatesCurrencyAPI); } catch (Exception $e) { echo $e->getMessage(); }
License
Exchange Rates library is released under the MIT License. See LICENSE for details.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-18