vymakdevel / currencyrate
Currency download
1.1
2014-09-15 12:10 UTC
Requires
- php: >= 5.3.0
- nette/caching: >= 2.2.0
- nette/utils: >= 2.2.0
- vymakdevel/curldownload: >= 1.2.3
Requires (Dev)
- nette/tester: >= 1.0
This package is auto-updated.
Last update: 2024-10-09 13:40:26 UTC
README
Get actual currency
Usage:
#!php
use Nette\Caching\Cache;
use Nette\Caching\Storages\FileStorage;
use Nette\Caching\Storages\FileJournal;
use Vymakdevel\Currency;
require 'vendor/autoload.php';
// with cache
$journal = new FileJournal(__DIR . '/tmp');
$storage = new FileStorage(__DIR . '/tmp', $journal);
$currency = new Currency(new Cache($storage));
// without cache
$currency = new Currency();
var_dump($currency->getCurrencyRate(Currency::EUR, Currency::UCB_PURCHASE_DEVIZA));
var_dump($currency->getCurrencyRate(Currency::EUR, Currency::UCB_SALE_DEVIZA));
var_dump($currency->eur);