Download the PHP package fadion/fixerio without Composer

On this page you can find all versions of the php package fadion/fixerio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fixerio

Thin wrapper for Fixer.io

A thin wrapper for Fixer.io, a service for foreign exchange rates and currency conversion. It provides a few methods to easily construct the url, makes the api call and gives back the response.

Installation

Laravel users can use the Facade for even easier access.

Usage

Let's get the rates of EUR and GBP with USD as the base currency:

By default, the base currency is EUR, so if that's your base, there's no need to set it. The symbols can be omitted too, as Fixer will return all the supported currencies.

A simplified example without the base and currency:

The historical option will return currency rates for every day since the date you've specified. The base currency and symbols can be omitted here to, but let's see a full example:

Finally, you may have noticed the use of the Currency class with currencies as constants. It's just a convenience to prevent errors from typos, but they're completely optional.

This:

is equivalent to:

Use whatever method fills your needs.

Response

The response is a simple array with currencies as keys and ratios as values. For a request like the following:

the response will be an array:

which you can access with the keys as strings or using the currency constants:

There is an option to handle the response as an object:

The last option is to return the response as a Result class. This allows access to the full set of properties returned from the feed.

Error Handling

To handle errors, the package provides 2 exceptions. ConnectionException when http requests go wrong and ResponseException when the returned response from the api is not as expected. An example with exception handling:

Laravel Usage

Nothing changes for Laravel apart from the Facade. It's just a convenience for a tad shorter way of using the package:

To use this Facade, you should set your access key in your config/services.php file:


All versions of fixerio with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
guzzlehttp/guzzle Version ~6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fadion/fixerio contains the following files

Loading the files please wait ....