2017 © Pedro Peláez
 

library serializer

Customized normalizers and a collection of encoders.

image

mihai-stancu/serializer

Customized normalizers and a collection of encoders.

  • Wednesday, August 9, 2017
  • by mihai-stancu
  • Repository
  • 2 Watchers
  • 5 Stars
  • 2,825 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 11 % Grown

The README.md

Serializer

Contents

A recursive normalizer that uses symfony/property-info to deduce data types of elements in an object graph., (*1)

A type hinted normalizer that retains type information about the object graph being normalized., (*2)

A collection of (symfony compliant) encoders for the following formats:, (*3)

Installation

Choose one ore more encoding formats from the suggestions in composer.json. If the chosen format is described below as PHP extension you will have to install said extension. If it is a pure PHP implementation you will be able to require it via composer., (*4)

composer require mihai-stancu/serializer
composer require your-chosen/encoder-package
// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new MS\SerializerBundle\MSSerializerBundle(),
    // ...
);

Usage

After having installed the bundle and at least one of the suggested encoding formats, that encoding format will be registered as a serialization format for the symfony/serializer., (*5)

$encoderName = array_rand(
    array(
        'bencode', 
        'bson', 
        'cbor',
        'export',
        'form',
        'igbinary',
        'ini',
        'msgpack',
        'rison',
        //'sereal',
        'serial',
        //'smile',
        'tnetstring',
        'ubjson',
        'yaml',
    )
);

$serializer = $container->get('serializer');
$string = $serializer->serialize($data, $encoderName);
$data = $serializer->unserialize($data, $class, $encoderName);

The Versions

23/02 2016

v1.0.2

1.0.2.0

Customized normalizers and a collection of encoders.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mihai Stancu

serialize encode marshal normalize

09/02 2016

v1.0.1

1.0.1.0

Customized normalizers and a collection of encoders.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mihai Stancu

serialize encode marshal normalize

02/12 2015

v1.0.0

1.0.0.0

Customized normalizers and a collection of encoders.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mihai Stancu

serialize encode marshal normalize