petrocki/iof-xml-php
Composer 安装命令:
composer require petrocki/iof-xml-php
包简介
PHP parser and serializer for the IOF XML 3.0 data standard
README 文档
README
PHP parser and serializer for the IOF XML 3.0 data standard.
⚠️ Development status: This repository is currently under active development and is not ready for production use.
Requirements
- PHP 8.3+
Installation
composer require petrocki/iof-xml-php
Usage
Parsing (XML → PHP objects)
use Petrocki\IofXmlPhp\Parser\IofXmlParser; $parser = new IofXmlParser(); $entryList = $parser->parseEntryList(file_get_contents('entry-list.xml')); echo $entryList->getEvent()->getName();
Serializing (PHP objects → XML)
use Petrocki\IofXmlPhp\Serializer\IofXmlSerializer; $serializer = new IofXmlSerializer(); $xml = $serializer->serializeEntryList($entryList);
Development
Docker
Build image:
docker build -t iof-xml-php:current .
Use bash in the container:
docker run -it -v "$(pwd):/var/www/iof-xml-php" iof-xml-php:current bash
Regenerating model classes
The classes in src/Model/ and metadata in src/Metadata/ are auto-generated from resources/IOF.xsd. Do not edit them manually. To regenerate after an XSD change:
vendor/bin/xsd2php convert config/xsd2php.yaml resources/IOF.xsd
Running tests
composer phpunit
Code style
composer cs-check composer cs-fix
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-11