PHP code example of andreygordin / tanuki-currency

1. Go to this page and download the library: Download andreygordin/tanuki-currency library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

andreygordin / tanuki-currency example snippets


use TanukiCurrency\Entity\Currency;
use TanukiCurrency\Repository\CacheRepository;
use TanukiCurrency\Repository\ChainRepository;
use TanukiCurrency\Repository\DbRepository;
use TanukiCurrency\Repository\HttpRepository;

$chainRepository = new ChainRepository(
	new CacheRepository(),
	new DbRepository(),
	new HttpRepository()
);

$currencyState = $chainRepository->find(new Currency('RUB'));

echo $currencyState->rate()->value();