Download the PHP package eloquent/endec without Composer

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

Endec

Versatile encoding implementations for PHP.

The most recent stable version is 0.2.1 Current build status image Current coverage status image

Installation and documentation

What is Endec?

Endec is a general-purpose encoding library for PHP that supports encoding and decoding of streaming data in addition to regular string-based methods. Endec comes with a selection of common encodings, is easy to use, and is simple to extend with custom encodings if necessary.

Usage

Strings

Endec can work with strings, similar to encoding functions in the PHP standard library. All codec classes have a static instance() method as a convenience only (they are not singletons).

Stream filters

PHP natively supports stream filters. Any number of filters can be added to any stream with stream_filter_append or stream_filter_prepend, and removed with stream_filter_remove. All of Endec's encodings are available as stream filters.

React streams

Streams can be obtained from an encoder, decoder, or codec. Endec's streams implement both WritableStreamInterface and ReadableStreamInterface from the React library, and hence can be used in an asynchronous manner.

Handling errors

Handling errors when dealing with strings is as simple as catching an exception. All exceptions thrown implement TransformExceptionInterface:

When using stream filters, error handling is difficult because PHP seems to simply ignore errors produced by the filter. If 0 bytes are written by fwrite(), it's a fair indication that an error occurred:

When using React streams, simply handle the error event:

Built-in encodings

Endec supports a number of common encodings out of the box. Where there is a relevant specification document, Endec aims to be 100% spec-conformant. Available encodings include:

Built-in stream filters

All Endec encodings are available as stream filters. Filters must be registered globally before use by calling Endec::registerFilters() (it is safe to call this method multiple times). Available stream filters include:

Encoders, decoders, and codecs

Most of the functionality of Endec is provided through encoders, decoders, and codecs (codecs are simply a combination of an encoder and decoder). All of Endec's built-in encodings are implemented as codecs, but it is also possible to implement a standalone encoder or decoder.

All encoders implement EncoderInterface, all decoders implement DecoderInterface, and all codecs implement EncoderInterface, DecoderInterface, and CodecInterface. This allows for type hints to accurately express requirements.

Implementing a custom encoding

Encoders and decoders are built upon Confetti transforms. For details on how to implement a transform, see the Confetti documentation for [implementing a transform].

As an example, given the following transform:

It is extremely simple to create a related encoder, decoder, or codec:

Note that the codec takes the same tranform for encoding and decoding only because rot13 is reciprocal. Most codecs would require a separate encode and decode transform.


All versions of endec with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
eloquent/confetti Version ~0.3.1
evenement/evenement Version >=1,<3
icecave/isolator Version ~2
react/stream Version >=0.3,<0.5
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 eloquent/endec contains the following files

Loading the files please wait ....