library wox-php
WOX is an XML serializer for PHP
bstoots/wox-php
WOX is an XML serializer for PHP
- Tuesday, October 10, 2017
- by bstoots
- Repository
- 1 Watchers
- 0 Stars
- 468 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 3 Open issues
- 3 Versions
- 5 % Grown
wox-php
, (*1)
WOX is an XML serializer for PHP, (*2)
(based on http://woxserializer.sourceforge.net/), (*3)
Features
Some of the WOX main features are listed below:, (*4)
- Easy to use.
- Simple XML. The XML generated is simple, easy to understand, and language independent.
- Requires no class modifications. Classes do not require to have default constructors, getters or setters.
- Field visibility. Currently only serializes public properties. This may change in the future to match Java and C# implementations.
- Interoperability Java, C#, and now PHP. WOX can (de)serialize Java, C#, or PHP objects to XML, and reconstruct the XML back to any of the supported languages.
- Standard XML object representation. The goal is parity between Java, C#, and PHP. Possibly others in the future.
- WOX data types. The WOX mapping table specifies how primitive data types are mapped to WOX data types.
- Robust to class changes. Defaults will be used for newly added fields.
- Arrays. Handles arrays and multi-dimensional arrays of primitives and Objects.
- Class and Type. Objects of these classes are saved by their String name.
- Small footprint. Strives to use only PHP built-ins where ever possible.
Usage
TODO, (*5)
Example
use Bstoots\WOX\Serial\{SimpleWriter, SimpleReader};
$doubles = [12.45, 878.98, 987.98, 435.87, 537.87, 89.0, 0.0, 667.332];
$writer = new SimpleWriter();
$xml = $writer->write($doubles);
var_dump($xml);
// string(138) "
// <object type="array" elementType="double" length="8" id="0">12.45 878.98 987.98 435.87 537.87 89 0 667.332</object>
// "
$reader = new SimpleReader();
$sameDoubles = $reader->read($xml);
var_dump($sameDoubles);
// array(8) {
// [0]=>
// float(12.45)
// [1]=>
// float(878.98)
// [2]=>
// float(987.98)
// [3]=>
// float(435.87)
// [4]=>
// float(537.87)
// [5]=>
// float(89)
// [6]=>
// float(0)
// [7]=>
// float(667.332)
// }
dev-master
9999999-dev
WOX is an XML serializer for PHP
Sources
Download
MIT
The Development Requires
by
Brian Stoots
1.0.0
1.0.0.0
WOX is an XML serializer for PHP
Sources
Download
MIT
The Development Requires
by
Brian Stoots
0.0.1
0.0.1.0
WOX is an XML serializer for PHP
Sources
Download
MIT
The Development Requires
by
Brian Stoots