Skip to main content

Module loader

Module loader 

Source
Expand description

Port of Composer\Package\Loader\ArrayLoader (docs/reference/resolver/ ArrayLoader.php) restricted to the model’s fields, and of MetadataMinifier::expand. A JSON entry (p2 version or lock entry) becomes a Package, plus its branch alias if any.

Structs§

LoadError

Functions§

branch_alias
ArrayLoader::getBranchAlias($config) -> normalized alias.
expand_minified
MetadataMinifier::expand.
expand_minified_owned
expand consuming the input (one copy fewer per version).
load
ArrayLoader::load($config) (batch = false) or one iteration of ArrayLoader::loadPackages (batch = true): the package, and its alias if any (to be added right before it, like ArrayRepository::addPackage).
load_package_refs
load_packages over borrowed configs: a caller reading them out of a larger document (a lock’s packages) hands the entries over without copying the document first.
load_packages
ArrayLoader::loadPackages (batch) or repeated load(), followed by the addition to a repository: load() returns the AliasPackage when there is one, and the repository adds the alias THEN the aliased package (ArrayRepository::addPackage, loadAsyncPackages). The returned order is therefore [alias, base]; the arena keeps base before alias.
parse_links
ArrayLoader::parseLinks (load, one package) or configureCachedLinks (loadPackages, a repository batch) for one link type. In batch mode, a link to the package itself is ignored and a non-string constraint is an error; in single mode, it is ignored.
pretty_alias
preg_replace('{(\.9{7})+}', '.x', $alias).