PHP Classes

Karensi: Fetch currency exchange rates from fixer.io

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 69 All time: 10,304 This week: 455Up
Version License PHP version Categories
karensi 1.0MIT/X Consortium ...5PHP 5, Web services, Finances
Description 

Author

This class can fetch currency exchange rates from fixer.io.

It can takes a base currency and a foreign currency rates identifiers and sends a HTTP request to retrieve the exchange rates between the currencies from fixer.io.

It can retrieve the exchange rates also for a specific date.

Picture of Arnel Labarda
  Performance   Level  
Name: Arnel Labarda <contact>
Classes: 6 packages by
Country: Philippines Philippines
Age: 37
All time rank: 247922 in Philippines Philippines
Week rank: 180 Up3 in Philippines Philippines Up
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

Documentation

Karensi

Build Status

PHP Library for fixer.io foreign exchange rates and currency conversion.

Installation

> composer.phar require aqlx86/karensi
> composer.phar install

Usage

Fetch all

$karensi  = new Karensi\Karensi('USD');
$rates = $karensi->fetch_rate();

Fetch specific currencies

$karensi  = new Karensi\Karensi('USD', ['CAD', 'PHP']);
$rates = $karensi->fetch_rate();

Fetch historical rates

$karensi  = new Karensi\Karensi('USD', ['CAD', 'PHP'], '2015-12-28');
$rates = $karensi->fetch_rate();

Save fetched rates in json format

$karensi->save('./rates/');

Test

./bin/phpspec run

  Files folder image Files (7)  
File Role Description
Files folder imagespec (1 directory)
Files folder imagesrc (1 directory)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file phpspec.yml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (7)  /  spec  
File Role Description
Files folder imageKarensi (1 file)

  Files folder image Files (7)  /  spec  /  Karensi  
File Role Description
  Plain text file KarensiSpec.php Class Class source

  Files folder image Files (7)  /  src  
File Role Description
Files folder imageKarensi (1 file)

  Files folder image Files (7)  /  src  /  Karensi  
File Role Description
  Plain text file Karensi.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:69
This week:0
All time:10,304
This week:455Up