Download the PHP package biig/optimus without Composer

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

Optimus

The goal of the library is to map two arrays (in and out) with an YAML file config.

Install

You can install this library using composer with the following command:

Usage

To use this library, you have to create a transformer which needs to extends the AbstractMappingTransformer class.

This Transformer will read mapping and apply it to input data.

Basic example

Transformer

You first have to create your Transformer and implement transform method.
Here we use symfony/yaml ^3.4 to parse a YAML file.

The $result variable now contains the new array.

Configuration

Assuming you got the PHP array $inputArray (input data)

And considering you want to transform it to the following array (expected output)

You will have to implements the following YAML:

Available mapping options

You can declare your node

Examples

Transform a key a to key b

Get a key b by using a function

Note: Function getB($arg1) must be declared in your related transformer You can use functions to transform the input value to the expected value. For example person civility (Mr, Mrs) to numbers (1, 2)

Make a field required

Actually, if from value don't exist in your input array, the to field don't appear in the output array.
If you want this field required, you can add required key.

Use a default value

Actually, if from value doesn't exist in your input array, the to field doesn't appear in the output array.
If you want this field to get a default value, you can add default key.

Add a condition

If you want to transform a field A only if a field B exists.

You can put multiple fields in your condition :

Get all errors mapping at a time

If you want to return all errors at a time you can set the next parameters in config


All versions of optimus with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6|>=7.0.8
symfony/property-access Version ^3.4| ^4.0
ext-json Version *
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 biig/optimus contains the following files

Loading the files please wait ....