Download the PHP package proengeno/edifact without Composer

On this page you can find all versions of the php package proengeno/edifact. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package edifact

PHP - EDIFACT

Unit test Static Analysis Mutation tests

Parse, build, serialize and validate UN/EDIFACT messages in a memory efficient way.

Installation

Version 2.0 requires PHP 8.4+. If you are on PHP 8.1–8.3, use the 1.x releases (composer require apfelfrisch/edifact:^1.3).

See the CHANGELOG for what is new in 2.0, including the breaking changes when upgrading from 1.x.

You will likely have to generate your own Segments, see php-edifact/edifact-mapping for XML mappings. I have done a prototype for autogeneration, it should give you a good starting point.

If you don't need validation or segment getters you can also parse to the GenericSegment.

Usage

Parse EDIFACT Messages

Load Segment Classes

You can add your Segments to the factory like so:

After that you can either mark the factory as default:

or use the factory directly:

If you don't need validation or segment getters you can also parse to the GenericSegment:

Parse from String

Parse from File

Iterate over Segments

Filter Segments

Unwrap Messages

Splits an interchange into one message per UNH...UNT block (the segment names are configurable).

The partial messages above live in memory. If you need every partial as its own Stream (e.g. to keep the raw segment lines, the file handle or to build your own wrapper around it), unwrap the stream instead and hand each partial to the factory. A leading UNA segment is copied into every partial, escaped segment terminators stay escaped.

fromStream() uses the given stream as is; the factory's read filters are only applied to streams it opens itself via fromString() / fromFilepath().

Add Readfilter

Build a Message

Build with default Una

UNA and the trailing Segments (UNT and UNZ) will be added automatically. If no UNA Segment is provided, it uses the default values [UNA:+.? '].

Build with custom Una

If you replace the decimal separator, be sure that the blueprint marks the value as numeric.

Write directly into File

Add Writefilter to the Builder

Validate a complete Interchange (CONTRL-style syntax check)

The InterchangeValidator checks the structure of a whole transmission file (UNB/UNZ and UNH/UNT service segments, matching references, control counts, duplicate message references) plus the blueprints of all registered segments, following the CONTRL check order: an interchange level failure stops the check, a failing message reports only its UNH/UNT failures while other messages are still checked.

Every SyntaxFailure carries the UN/EDIFACT error code (service code list 0085) and the context needed to fill the UCI/UCM/UCS/UCD segments of a CONTRL message: the affected service segment, the message counter and reference, the segment position within the message and the element/component positions.

Checks that need knowledge the file itself cannot provide (own MP-ID, known senders, already received interchange references, message type descriptions) remain the concern of the application; SyntaxErrorCode provides the matching codes (7, 23, 25, 26, 35, 36, …) for reporting them.

Validate Message Segments

Development

The project uses Mago for formatting, linting and static analysis, and PHPUnit for tests:


All versions of edifact with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package proengeno/edifact contains the following files

Loading the files please wait ...