Download the PHP package sabas/edifact without Composer
On this page you can find all versions of the php package sabas/edifact. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sabas/edifact
More information about sabas/edifact
Files in sabas/edifact
Informations about the package edifact
edifact
Tools to process EDI messages in UN/EDIFACT format
Supported syntax is version 3.
It's provided in a Composer package:
composer require sabas/edifact
The mapping XML files are provided in a separate package:
composer require php-edifact/edifact-mapping
EDI\Parser
Given an EDI message checks the syntax, outputs errors and returns the message as a multidimensional array.
INPUT
OUTPUT
Errors
Array
EDI\Encoder
Given a multidimensional array (formatted as the output of the parser), returns an EDI string, optionally one segment per line.
INPUT
$x
is a multidimensional array where first dimension is the EDI segment, second contains elements:
- single value
- array (representing composite elements)
$compact
is a boolean, if you need a segment per line. Set to false to enable wrapped lines.
OR
OUTPUT
EDI\Analyser
Create human-readable, structured text with comments from segments.xml
.
Requires the EDI\Mapping package.
$file
is the path to orginal EDI message file
Example INPUT
Example Output
EDI\Reader
Read specific segment element values from parsed EDI file. Pass the reader a parser with a message already loaded.
INPUT
See section about EDI\Parser above on how to load a file into a parser.
OUTPUT
Errors
Array
EDI\Interpreter
Organizes the data parsed by EDI/Parser using the XML description of the message and the XML segments.
INPUT
OUTPUT
JSON
JSON for interchange service segments (UNB / UNZ)
Errors (per message)
Example
Edifact
DTM+7:201309200717:203'
Array
Testing
The package should be required with composer, alongside edifact-mapping. The tests then can be run simply with phpunit in the root of the package.
Notes
Valid characters are: A-Za-z0-9.,-()/'+:=?!"%&*;<> UNECE
All versions of edifact with dependencies
ext-json Version *
ext-mbstring Version *
ext-simplexml Version *