vymakdevel/currencyrate

Currency download

1.1 2014-09-15 12:10 UTC

This package is auto-updated.

Last update: 2024-11-09 13:54:32 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);