Commit graph

2 commits

Author SHA1 Message Date
Ori Livneh
a7a5c414bb MWMessagePack: improvements to test suite, exception handling, array detection
* Throw InvalidArgumentException
* Use data provider in unit tests
* Detect associative arrays without copying

Per Tyler's post-merge review of Id2833c5a9.

Change-Id: Iec6b135238ca5da3002944066843102f0ae8d23d
2014-01-03 03:57:25 -05:00
Ori Livneh
681607e55b Add class implementing MessagePack serialization
MessagePack is a space-efficient binary data interchange format. I am going to
use it to encode profiling data in ProfilerSimpleUDP. The official PHP
implementation is provided as a C extension, so using it would further
encumber migration to HHVM. This patch adds MWMessagePack, a class implementing
a pack() method for encoding native PHP values as MessagePack byte strings. The
implementation is based on <https://github.com/onlinecity/msgpack-php>, but
revised for clarity and conformity with MediaWiki coding conventions.

Change-Id: Id2833c5a9da659cb13ec1330de9dd57138ada9c8
2014-01-02 18:04:24 -08:00