2017 © Pedro Peláez
 

library open-exchange-rates-api

A PHP wrapper for the 'open exchange rates' API.

image

leewillis77/open-exchange-rates-api

A PHP wrapper for the 'open exchange rates' API.

  • Wednesday, September 24, 2014
  • by leewillis77
  • Repository
  • 2 Watchers
  • 3 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP wrapper for Open Exchange Rates API

A PHP wrapper around the Open Exchange Rates API., (*1)

Installation

  • Clone the repository
  • Make sure you have composer set up and working
  • Install dependencies by running composer install
  • Copy the sample config file (config/config.yml.sample) to config/config.yml
  • Update config/config.yml with your API credentials from "open exchange rates"
  • API responses are cached in the cache/ subfolder - disallow access to this in your web server config.

Notes

  • Docblocks are missing in many places - patches welcome
  • PHPUnit is set up, and some test cases are present. More would be welcome.
  • Requires PHP 5.3 or above.

Examples

See the examples folder for a simple example of how to use the API wrapper. This is designed to get you going, and is not a complete reference, or see the code sample below:, (*2)

use OpenExchangeRates\Config;
use OpenExchangeRates\Request\ConversionRequest;

require('vendor/autoload.php');

$config = new Config('config/config.yml');
$request = new ConversionRequest($config);

try {
    $response = $request->convert(100, 'USD', 'GBP');
} catch (\Exception $e) {
    die('Request exception received: '.$e->getMessage());
}
echo "100 USD is " . $response . " GBP\n";

Disclaimer

This API is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the the developer(s) be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software., (*3)

Although every attempt is made to ensure quality, NO guarantees are given whatsoever of accuracy, validity, availability, or fitness for any purpose - please use at your own risk., (*4)

The Versions

24/09 2014

dev-master

9999999-dev https://github.com/leewillis77/open-exchange-rates-api

A PHP wrapper for the 'open exchange rates' API.

  Sources   Download

GPL-2.0

The Requires

 

api currency exchange rate

24/09 2014

v1.0

1.0.0.0 https://github.com/leewillis77/open-exchange-rates-api

A PHP wrapper for the 'open exchange rates' API.

  Sources   Download

GPL-2.0

The Requires

 

api currency exchange rate