Download the PHP package exelearning/elp-parser without Composer

On this page you can find all versions of the php package exelearning/elp-parser. 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 elp-parser

eXeLearning .elp / .elpx Parser for PHP

Parser for eXeLearning project files with support for legacy contentv3.xml projects and modern ODE content.xml packages.

Features | Installation | Usage

Packagist Packagist PHP from Packagist Codecov

Features

ELPParser supports:

For more information, visit the documentation. The published site includes both the curated API guide and a PHPDoc-generated class/reference index. The repository also includes an examples/ directory with executable recipes for inspection, validation, assets, diffs, fingerprints and extraction.

Requirements

Composer declares these extensions and will report a missing requirement during installation.

Installation

Command-line interface

Composer exposes vendor/bin/elp-parser for common inspection and automation workflows:

Use --json with inspect, validate and fingerprint for machine-readable output. See the CLI documentation for exit-code semantics.

Usage

Streams and uploads

Projects can be parsed from PHP streams or in-memory bytes. Stream input is copied in chunks to a bounded temporary file because ZipArchive requires a filesystem path:

Temporary files owned by parser instances are removed automatically. inspectStream() and inspectContents() provide the corresponding lightweight inspection APIs.

Detect and identify packages

Use the lightweight detection helpers before full parsing when the input type is unknown:

Parser options

ArchiveLimits remains accepted as the second argument for backward compatibility. New feature switches use ParserOptions:

Disable work only when the corresponding derived data is not needed.

Lightweight inspection

For cataloging or indexing, inspect() reads archive metadata and the project XML without normalizing pages, iDevices or assets:

Basic parsing

Format and version inspection

getVersion() remains the compatibility API for the detected major version. getVersionInfo() makes it explicit whether that result came from package metadata, the package format, a heuristic, or a default.

Pages and assets

Direct lookup helpers are also available: getPageById(), getBlockById(), getIdeviceById(), getProjectId() and getProjectVersionId().

A parallel typed API is available through $parser->getProject(). It returns Project, Page, Block, Idevice, Asset and VersionInfo model objects while the existing array APIs remain unchanged.

Asset references are normalized against the actual ZIP entries. This prevents external URLs and nonexistent paths from being reported as package assets.

Typed validation and iDevice extensions

The existing validation arrays remain supported. A typed wrapper is available when object APIs are preferable:

Domain-specific iDevice decoding can be plugged in without modifying the parser:

Custom decoder output is exposed as customDecoder and customData on matching normalized iDevices.

Validation

Normal parsing remains tolerant. Validation can be requested explicitly:

The validator reports unresolved assets, broken internal exe-node: links, duplicate identifiers, broken page-parent relationships, hierarchy cycles, relationship/order inconsistencies, missing iDevice runtime directories and missing v4 baseline files/directories.

Schema validation is optional and only uses a caller-supplied trusted local schema:

Package-supplied DTDs are not trusted for this API. Schema loading uses LIBXML_NONET. The optional schema-validation API requires ext-dom.

Archive limits

Default limits are intentionally generous but bounded. They can be overridden for trusted or unusually large packages:

The defaults are 20,000 entries, 1 GiB per entry, approximately 2 GiB total uncompressed data, 64 MiB for the project XML, and a maximum compression ratio of 1000:1.

Fingerprints and project diffs

Exact archive bytes and normalized logical content use separate fingerprints:

The normalized content fingerprint ignores volatile package identity/version fields such as odeId, odeVersionId and the eXeLearning application version. It keeps parsed project structure and includes hashes of project resource bytes. This makes it suitable for change detection without treating ZIP packaging differences as content changes.

The semantic diff reports metadata, page, block, iDevice and resource additions/removals/changes.

Detailed JSON contract

Detailed exports carry an explicit schema version and ship with a bundled JSON Schema:

The detailed schema version is independent from the eXeLearning application version, ODE format version and Composer package version.

Export JSON

The existing JSON export remains compact. The detailed representation adds format/version information, metadata, ODE preferences/resources/properties, pages and page tree, blocks, iDevices, assets and archive entries.

Read or stream individual entries

For large assets, use stream access instead of loading the complete entry into memory:

Per-entry reads and copies honor configured archive limits and reject unsafe ZIP entry paths/symlinks.

Extract project files

Extraction is streamed entry by entry. Unsafe paths, ZIP symlinks and extraction targets that resolve outside the destination root are rejected.

Error handling

Parser errors derive from Exelearning\Exception\ElpParserException. More specific exceptions include:

Version compatibility

The parser distinguishes the internal project format from the detected eXeLearning application/package version:

Use getFormatVersion() for the ODE format version, getApplicationVersion() for the declared eXeLearning version, and getVersionInfo() when the distinction between declared and inferred versions matters.

Performance characteristics

Parsed projects are indexed by page, block and iDevice ID for constant-time lookup. Aggregate collections and diagnostics are cached because parser instances are immutable after construction. Asset-reference resolution also caches normalized archive lookups.

The upstream compatibility corpus records per-project timings, total elapsed time, peak memory and the five slowest projects. These measurements are informational and do not impose brittle timing thresholds in CI.

Test coverage

The test suite enforces a minimum 90% project coverage locally and in CI. The coverage job produces a Clover report and uploads it to Codecov. Codecov also requires at least 90% project and patch coverage for pull requests.

Mutation testing

In addition to the 90% line-coverage gate, source changes are mutation-tested with Pest. Pull requests mutate changed covered code, while a weekly/manual workflow runs the full covered source with a 50% minimum mutation score (initial full-run baseline: 53.66%). See Mutation testing.

Compatibility regression testing

The regular test suite includes a deterministic corpus for malformed XML, encoded and Unicode asset paths, malformed iDevice state and cyclic page hierarchies.

A separate Upstream Compatibility workflow runs weekly against project fixtures from exelearning/exelearning. It discovers ZIP-backed .elp / .elpx fixtures containing content.xml or contentv3.xml, compares lightweight inspection with full parsing, and fails on compatibility regressions.

The corpus runner can also be used locally:

Project documentation

Release integrity

Tagged releases publish a CycloneDX SBOM, SHA-256 checksums and GitHub artifact attestations for build provenance and the SBOM. See Release supply chain.

License

The project is distributed under the MIT License. See LICENSE.md.


All versions of elp-parser with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-simplexml Version *
ext-zip Version *
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 exelearning/elp-parser contains the following files

Loading the files please wait ...