2017 © Pedro Peláez
 

library cbor4php

CBOR encoder/decoder for PHP

image

lemonblast/cbor4php

CBOR encoder/decoder for PHP

  • Thursday, January 22, 2015
  • by lrezek
  • Repository
  • 2 Watchers
  • 0 Stars
  • 80 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 14 % Grown

The README.md

Cbor4Php

CBOR (Concise Binary Object Representation) is a tiny data format that can be used in place of JSON. Cbor4Php is a simple CBOR encoder/decoder for PHP., (*1)

Installation

To install the library through composer, you simply need to add the following to composer.json and run composer update or composer install:, (*2)

{
    "require": {
       "lemonblast/cbor4php": "dev-master"
    }
}

Once installed, you can use the Cbor class (Lemonblast\Cbor4Php\Cbor) to encode and decode CBOR data., (*3)

Usage

Include the Cbor4Php library in your source:, (*4)

use Lemonblast\Cbor4Php\Cbor;

Encoding

To encode a variable into a CBOR byte string call the encode method and pass the value as a parameter:, (*5)

$foo = Cbor::encode($bar);

Encoding an object will convert it to an associative array, and encode it as such. Only public fields will be encoded., (*6)

Encoding a PHP resource is not supported and will result in a null return value., (*7)

Decoding

To decode a CBOR byte string into a PHP variable:, (*8)

$bar = Cbor::decode($foo);

CBOR data tags are ignored during the decode process. Decoding a null value or empty string will result in a null return value., (*9)

Testing

To run unit tests, simply clone this repository and run composer install followed by php vendor/bin/phpunit in the project directory., (*10)

The Versions

22/01 2015

dev-release

dev-release https://github.com/lemonblast/cbor4php

CBOR encoder/decoder for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Adam Weber

php cbor

22/01 2015

1.0.0

1.0.0.0 https://github.com/lemonblast/cbor4php

CBOR encoder/decoder for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Adam Weber

php cbor

22/01 2015

dev-master

9999999-dev https://github.com/lemonblast/cbor4php

CBOR encoder/decoder for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Adam Weber

php cbor