2017 © Pedro Peláez
 

library bert

A BERT (Binary ERlang Term) serialization library.

image

bert/bert

A BERT (Binary ERlang Term) serialization library.

  • Sunday, December 8, 2013
  • by kasparp
  • Repository
  • 1 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Build StatusScrutinizer Quality Score, (*1)

Note - Work in progress

This is a fork of https://github.com/dhotson/bert-php
I made it composer compatible and eleminated the fdopen dependency., (*2)

BERT

A BERT (Binary ERlang Term) serialization library for PHP based on Tom Preston-Werner's Ruby implementation., (*3)

It can encode PHP objects into BERT format and decode BERT binaries into PHP objects., (*4)

See the BERT specification at bert-rpc.org., (*5)

To designate an atom, use the Bert::a() helper or the Bert_Atom class. To designate tuples, use the Bert::t() helper or the Bert_Tuple class:, (*6)

Bert::t(Bert::a('foo'), array(1, 2, 3))
new Bert_Tuple(array(new Bert_Atom('foo'), array(1, 2, 3)))

These will both be converted to (in Erlang syntax):, (*7)

{foo, [1, 2, 3]}

Usage

require_once 'classes/Bert.php'

$bert = Bert::encode(
  Bert::t(
    Bert::a('user'),
    array('name' => 'TPW', 'nick' => 'mojombo')
  )
);
# => string(82) "#hduserhdbertddictllmnamemTPWjlmnickmmojombojj"

Bert::decode($bert);
# => Bert_Tuple (
       Bert_Atom ( 'user' ),
       Array (
         'name' => 'TPW',
         'nick' => 'mojombo'
       )
     )

The Versions

08/12 2013

dev-master

9999999-dev

A BERT (Binary ERlang Term) serialization library.

  Sources   Download

MIT

The Requires

  • php >=5.3.1

 

The Development Requires

serialization bert ernie