Expand description
The Composer v2 “minified” repository-metadata algorithm.
Packagist serves each /p2/<vendor>/<name>.json document in minified
form ("minified": "composer/2.0"): the first version entry is fully
expanded and every later entry is a sparse diff against the running
accumulation of the entries before it. A value of the literal string
"__unset" removes an inherited key (NOT JSON null, which would set
the key to null). expand_versions materializes a minified list;
minify_versions is its exact inverse.
Mirrors Composer’s Composer\MetadataMinifier\MetadataMinifier.
Constants§
- MINIFIED_
MARKER - The
minifiedmarker value Packagist sets for the diff format. - UNSET
- Deletion sentinel inside a minified diff entry. A key whose value is exactly this string is removed from the accumulator on expansion.
Functions§
- expand_
versions - Expand a minified
composer/2.0version list (newest-first) into a list of fully-materialized version objects. - minify_
versions - Minify a fully-materialized version list (newest-first) into the
composer/2.0sparse-diff form. Inverse ofexpand_versions:expand_versions(minify_versions(v)) == vfor any well-formedv(compared as key/value sets — key order is not preserved).