Download the PHP package lemonade/component_currency without Composer

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

PHP Version Packagist Version Downloads PHPStan Tests

Lemonade Currency Conversion Library

Lemonade Currency Conversion Library provides a general-purpose currency converter using the Czech National Bank (CNB) as the primary data source.

The library exposes a simple developer-friendly API while internally using a layered, hexagonal-style architecture. This keeps the public API stable and easy to use, while infrastructure concerns such as CNB fetching, parsing, caching, and time resolution stay isolated behind explicit ports and adapters.

Features

Supported Data Sources

Supported Currencies

Installation

Use Composer to install the library:

Architecture

The library is organized using a lightweight hexagonal architecture.

Domain

The domain layer contains the core currency model and rules:

It does not depend on CNB, filesystem, HTTP, or runtime environment.

Application

The application layer contains the main use case:

The primary service is:

Ports

Ports define contracts for external concerns:

This allows custom implementations for fetching rates, caching data, or controlling time in tests.

Infrastructure

Infrastructure contains concrete adapters:

Facade API

The public facade classes remain available for simple usage and backward compatibility:

Usage

Basic static API

CurrencyCode enum

Shortcut methods

Market object API

String currency codes are still supported for backward compatibility.

Currency metadata

Advanced Usage

Custom storage directory

By default, the library stores CNB cache files in:

You can create the application service manually with a custom storage directory:

Custom cache, source, parser, or clock

For full control, instantiate the application service directly:

This is useful when integrating the library into applications that already have their own cache layer, HTTP transport, or deterministic clock.

Custom exchange-rate source

Implement the ExchangeRateSource port to fetch data from a different source.

CNB Data Notes

CNB yearly exchange-rate data uses multipliers in the header, for example:

The parser normalizes values to a single currency unit. For example, 100 HUF with value 6,505 is stored as 0.06505 per 1 HUF.

Configuration

The default filesystem cache directory is:

Ensure this directory is writable by the PHP process when using the default service factory.

Testing

Run unit tests:

Run static analysis:

Quality

The library is designed for:

Contributing

Feel free to submit issues or create pull requests to improve this library.

License

This library is licensed under the MIT License. See the LICENSE file for details.


All versions of component_currency with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 lemonade/component_currency contains the following files

Loading the files please wait ...