Download the PHP package realshadow/serializers without Composer

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

PHP collection of serializers for JSON, JSONP, XML, YAML, INI

Written for PHP 5.3 to solve a specific issue - singularization/pluralization of elements when transforming them from and to arrays. The difference between serializers was obvious when we passed XML files between PHP, Python and .NET. Later, more serializers were added to get a complete package.

The goal was to automatically perform singularization of arrays when serializing to XML. E.g.

Which, when serialized, would become

instead of (this is the default behaviour)

Same rule applies to deserialization which, by using different serializers, would turn into into different arrays. By applying singularization the other way around, it is possible to get back the same array as was used for serialization.

XML Serialization

Support for

Which outputs

XML Deserialization

By default every comment, attribute, namespace will be stripped from the result as well as the root element. Every option can be turned off/on in config

Deserialization is done by SimpleXML coupled with json_encode (in this case provided JSON decoder) with one simple addition - SimpleXML object will be transformed before being encoded with json_encode (backport of JSONSerialize interface)

Comments are parsed separately via DOMXpath (since SimpleXML can not handle them) and are added to a separate array with indexes poiting to their original location, with that, it should be easy to merge comments with the main result and receive the original array.

By default, transforming elements from their singular counterpart back to plural and thus flattening the whole array is turned off and must be turned on. Its possible to both - include new mappings for words and to exclude specific words. This works exactly as in provided XML encoder.

The whole goal of flattening is to get back exactly the same array as the one that was used to create provided XML.

Which outputs exactly the same array as was used in the example before

JSON Deserialization

Support for:

With overriding configuration one can change the default timeformat and timezone settings form MS date conversion, or turn it off completely.

It's possible to register an event callback to be called during escaping of BIGINT, in case said escaping is not good enough, or to turning it off completely.

Callback method must accept one parameter and thats registered JSON string. Callback can be a closure or anything else that will pass as callable.

JSON Serialization

It is possible to register JSON_SERIALIZE event that works exactly like PHP 5.4 JsonSerializable interface and thus allows modifying the object before it is converted to JSON.

JSON Serializer also includes a method for creating dates in Microsoft JSON date format, e.g /Date(1425556377427+0100)/

JSONP Serialization

Class for easy JSONP serialization, behaves like JSON serializer with additional checks for callback function name validation, which can be changed with custom event

JSONP Deserialization

Class for easy JSONP deserialization, behaves like JSON deserializer

YAML Serializer

Uses Symfony's YAML component under the hood

YAML Deserializer

Uses Symfony's YAML component under the hood.

Transformation to XML, JSON, etc. is possible, but is subjected to the possibilities of the YAML converter.

INI Deserializer

Uses INI parser by @austinhyde

INI Serializer

The functionality is limited to basic INI formats, e.g. no support for inheritance. As I can't see a good use case at the moment, this class is here only for keeping a complete stack of encoders/decoders together


All versions of serializers with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
symfony/yaml Version 2.8.*
austinhyde/iniparser Version v1.0.0-beta
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 realshadow/serializers contains the following files

Loading the files please wait ....