Download the PHP package ionut/currency without Composer

On this page you can find all versions of the php package ionut/currency. 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 currency

Ionut\Currency

Latest Stable Version Build Status Coverage Status Quality Score Total Downloads License

Currency is a currency exchanger written in PHP that aims for ease of use and complete independence of any frameworks or CMSs.

Besides being fully unit-tested and well written, it is also one of the few libraries(if not the only) that uses the European Central Bank rates. This does not only mean that you get the conversion rates for free but also that you do not tie one of the core responsibilities of your application to a fragile third-party service.

So far, it provides an out of the box service provider for Laravel. But besides that, the library is completely framework agnostic and it'll stay like this for the foreseeable future.

Starting out

Some applications do not need the complexity and verbosity of our OOP endeavours. For those, currency has a clean helper that would love to help you keep your code short.

Let's say you want to convert $20.5 to EUR by using the latest rates provided by the European Central Bank, the code accomplishing that will look like this:

Gain control of the exchanger's building

In case you don't fancy having helpers in your codebase you'll be happy to know that using the helper function is optional. Let's just rewrite the previous example and get rid of the helper:

Of course, there's more code to write by using this approach. But such level of control couldn't be readily accomplished by using the helper function.

Intermediate Usage

As seen in the previous example, there are three distinct parts which form the core of the Currency library:

Exchanger
The guy that converts the numbers by applying first grade math.
ExchangeRates
Whose implementation is the EuropeanCentralBank guy in the example.
It provides the exchanger with the latest exchange rates.
Downloader
The guy that comes and helps ExchangeRates by downloading files and caching them locally. (for example an XML containing the exchange rates)

By remembering those and keeping in mind that the library fully follows the interfaces found in the Contracts namespace, you should be able to master everything there is to know about this library.

Contracts

Because libraries die more often that one would expect, Currency provides the developer with Contracts for every of the Currency's class, allowing his code to remain SOLID while using the best currency conversion library there is.

Tests

The present library is fully unit-tested, contributors are welcome to check the aforementioned tests in the tests folder and run them by calling PHPUnit.

License

The present package is open-sourced software licensed under the MIT license.


All versions of currency with dependencies

PHP Build Version
Package Version
Requires doctrine/cache Version ^1.6
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 ionut/currency contains the following files

Loading the files please wait ....