Download the PHP package nethask/currency without Composer

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

Currency Package

fork of https://github.com/moltin/currency

The Moltin currency composer package makes it easy to implement multi-currency pricing into your application and store the exchange data using one of the numerous data stores provided. You can also inject your own data store if you would like your data to be stored elsewhere.

Installation

Download and install composer from http://www.getcomposer.org/download

Add the following to your project composer.json file

When you're done just run php composer.phar install and the package is ready to be used.

Usage

Below is a basic usage guide for this package.

Instantiating currency

Before you begin, you will need to know which storage, currencies and exchange method you are going to use. The exchange method defines where your exchange rates are retrieved from. The currencies method is used to retrieve your supported currencies for the current application.

In this example we're going to use the currencies file, exchange file and session for storage.

Setting the value

Now that you have Currency instantiated, you will now need to tell it what value you would like to convert. You can do this using the following method.

Getting the value

The most basic action you can perform is retrieve the original value back from the method.

Formatting as a currency

By default the currency is set to GBP so calling currency will format the value to a string with £ and correct decimal and thousand seperators.

Rounding to common values

There are a number of common pricing formats built in to make "nice" prices easy to implement. These formats changes the default value and return the object to allow for chaining.

Currency Exchange

The package makes it as easy as possible to quickly switch between currencies. Before each exchange the value is reset to default to ensure the correct price is assigned.

Resetting the value

After using exchange or any of the rounding functions to retrieve the default value you must call reset.


All versions of currency with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
guzzle/guzzle Version ~3.8
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 nethask/currency contains the following files

Loading the files please wait ....