webit/comarch-edi-order
最新稳定版本:4.0.1
Composer 安装命令:
composer require webit/comarch-edi-order
包简介
Comarch EDI Order Lib
README 文档
README
This library provides the object oriented representation of the Comarch EDI Order document along with its the XML parser.
Installation
The most convenient method is using Composer. Add the following line to the required section of your composer.json
"webit/comarch-edi-order": "^2.0.0"
Usage
XML Parser
<?php use Doctrine\Common\Annotations\AnnotationRegistry; // Configure the AnnotationRegistry $autoload = include 'vendor/autoload.php'; AnnotationRegistry::registerLoader(array($autoload, 'loadClass')); $xmlParserBuilder = new \Webit\Comarch\EDI\Order\Parser\XmlParserBuilder(); $xmlParserBuilder->setCacheDir(sys_get_temp_dir()); // recommended to set the cache dir for the inner Serializer /** @var \Webit\Comarch\EDI\Order\Parser\XmlParser $xmlParser */ $xmlParser = $xmlParserBuilder->build(); $myOrder = file_get_contents('my-edi-order.xml'); /** @var \Webit\Comarch\EDI\Order\DocumentOrder $documentOrder */ $documentOrder = $xmlParser->parse($myOrder);
XML File Parser
Optionally you can wrap the XMLParser with the XMLFileParser
<?php /** @var \Webit\Comarch\EDI\Order\Parser\XmlParser $xmlParser */ $xmlFileParser = new \Webit\Comarch\EDI\Order\Parser\XmlFileParser($xmlParser); $documentOrder = $xmlFileParser->parse(new \SplFileInfo('my-edi-order.xml'));
Supported document versions
The current implementation supports version 2.2 as states in the spec
Running the tests
./vendor/bin/phpunit
统计信息
- 总下载量: 542
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-23