Download the PHP package ayeaye/formatters without Composer

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

Aye Aye Formatters

[Minimum PHP Version] (https://php.net/) [License] (https://raw.githubusercontent.com/AyeAyeApi/Formatters/master/LICENSE.txt) [Version] (https://packagist.org/packages/ayeaye/formatters) [Build Status] (https://travis-ci.org/AyeAyeApi/Formatters/branches)

Aye Aye Formatters are a tool that to streamline the conversion of PHP data (arrays or objects) into serialised data formats, such as JSON or XML. Other formats can be easily added by extending the Formatter abstract.

Installation

The best way to install Aye Aye Formatters is with composer

Formatting Data

To format data into any specific serialised data format, just instantiate the formatter and pass it the data.

The fullFormat method always assumes you want a valid file output. If you want only a partial format, just use the partialFormat() method. For example:

The FormatFactory

The above functionality isn't particularly useful on it's own, that's where the FormatFactory comes in. Using the Factory, we can predefine a set of Formatters and then choose one later.

More importantly you can request a formatter using an array of possible formats. This is useful as there are multiple ways an HTTP request could tell you what data format is desired. The correct way of course is to use the Accepts header. However, you could use a file suffix. What if the request came through without either, or none that are known to you? Then a default would be appropriate.

Creating New Formats

If you wish to return data in a format that isn't the included Json, Jsonp or Xml (or, if you want to improve on those provided), you can do so by extending the FormatFactory abstract class. You should be aware of the serializable interface described below.

Customising Output

A Serializable interface is provided to help customise the output. Any object implementing the interface just needs to return the data it wants to be serialised by the formatters from the method ayeAyeSerialize() in a keyed array much like Php's own JsonSerializable interface works.

Formatters will recurse through objects in order to only collect only the data you wish to give them.


All versions of formatters with dependencies

PHP Build Version
Package Version
Requires php Version ^5.5 || ^7.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 ayeaye/formatters contains the following files

Loading the files please wait ....