Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yocto/yoclib-wbxml-php
PHP yocLib for WBXML
https://github.com/yocto/yoclib-wbxml-php
binary composer php wbxml xml yoclib yocto
Last synced: 20 days ago
JSON representation
PHP yocLib for WBXML
- Host: GitHub
- URL: https://github.com/yocto/yoclib-wbxml-php
- Owner: yocto
- License: gpl-3.0
- Created: 2020-11-13T15:11:17.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-11T14:01:32.000Z (almost 4 years ago)
- Last Synced: 2024-11-24T17:02:18.711Z (about 1 month ago)
- Topics: binary, composer, php, wbxml, xml, yoclib, yocto
- Language: PHP
- Homepage: https://github.com/yocto/yoclib-wbxml-php
- Size: 34.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# yocLib - WBXML (PHP)
This yocLibrary enables your project to encode and decode WBXML data in PHP.
## Status
[![Build Status](https://travis-ci.com/yocto/yoclib-wbxml-php.svg?branch=master)](https://travis-ci.com/yocto/yoclib-wbxml-php)
## Installation
`composer require yocto/yoclib-wbxml`
## Use
### Encoding
```php
use YOCLIB\WBXML\CodePages\ExchangeActiveSync;
use YOCLIB\WBXML\WBXMLEncoder;
use YOCLIB\WBXML\WBXMLException;$xml = '';
$codePages = ExchangeActiveSync::getCodePages();
$encoder = new WBXMLEncoder($codePages);
try{
$binary = $encoder->encode($xml);
}catch(WBXMLException $e){
//TODO
}
```## Decoding
```php
use YOCLIB\WBXML\CodePages\ExchangeActiveSync;
use YOCLIB\WBXML\WBXMLDecoder;
use YOCLIB\WBXML\WBXMLException;$binary = "\x03\x01\x6a\x00\x00\xff\xff";
$codePages = ExchangeActiveSync::getCodePages();
$decoder = new WBXMLDecoder($codePages);
try{
$xml = $decoder->decode($binary);
}catch(WBXMLException $e){
//TODO
}
```