Download the PHP package xterr/php-ubl-generator without Composer

On this page you can find all versions of the php package xterr/php-ubl-generator. 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 php-ubl-generator

PHP UBL Generator

PHP License: MIT CI Packagist Version PHPStan Level 8

XSD-to-PHP code generator for UBL 2.x documents. Reads OASIS UBL schemas and emits typed PHP 8.2+ classes with XML mapping attributes, optional codelist enums from Genericode files, and configurable property bindings.

Features

Installation

Generated classes depend on the runtime package:

Requirements:

Quick Start

Generate classes from UBL schemas

Generated output structure

Configuration

Copy the default config and customize:

Codelist Support

Point the generator at a directory of OASIS Genericode (.gc) files to generate string-backed PHP enums:

Generated enum:

Property Bindings

Bind codelist enums to specific XSD properties, replacing the default CBC Code type:

Single bindings produce:

Union bindings produce PHP union types:

Namespace Handling

All standard UBL 2.x namespaces are supported with universal resolution:

Namespace Prefix Output Description
CommonBasicComponents cbc Cbc/ Leaf types (value + attributes)
SignatureBasicComponents sbc Cbc/ Signature leaf types (same pattern)
CommonExtensionComponents ext Cbc/ or Cac/ Leaf types → Cbc/, aggregates → Cac/
CommonAggregateComponents cac Cac/ Aggregate types (child elements)
SignatureAggregateComponents sac Cac/ Signature aggregate types
CommonSignatureComponents sig Cac/ Signature components

Types are classified structurally: complex types with simpleContent extensions become leaf classes in Cbc/, complex types with child element sequences become aggregate classes in Cac/.

CLI Options

Option Description
--config, -c Path to YAML configuration file
--schema-dir, -s Path to XSD schema directory
--schema-version UBL schema version (2.1, 2.2, 2.3, 2.4)
--output-dir, -o Output directory for generated classes
--namespace Root PHP namespace
--codelist-dir Path to directory containing .gc codelist files
--force, -f Actually generate files (without this, dry-run only)

Architecture

Two packages work together:

Package Role Install
xterr/php-ubl-generator (this) Dev-time code generator composer require --dev
xterr/php-ubl Runtime XML mapping & serialization composer require

The generator reads XSD schemas and Genericode files, then emits PHP classes that use attributes from xterr/php-ubl. At runtime, only the lightweight xterr/php-ubl package is needed for XML serialization and deserialization.

Development

CI

Tests run on PHP 8.2, 8.3, and 8.4 via GitHub Actions. Tagged releases are automatically notified to Packagist.

License

MIT — Copyright (c) 2026 Ceana Razvan


All versions of php-ubl-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-dom Version *
ext-libxml Version *
ext-mbstring Version *
goetas-webservices/xsd-reader Version ^0.4
nette/php-generator Version ^4.1
symfony/config Version ^7.0 || ^8.0
symfony/console Version ^7.0 || ^8.0
symfony/filesystem Version ^7.0 || ^8.0
symfony/finder Version ^7.0 || ^8.0
symfony/string Version ^7.0 || ^8.0
symfony/yaml Version ^7.0 || ^8.0
xterr/php-ubl Version ^1.2
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 xterr/php-ubl-generator contains the following files

Loading the files please wait ...