Expand description
Root package version: port of RootPackageLoader::load +
VersionGuesser::guessGitVersion (docs/reference/RootPackageLoader.php,
VersionGuesser.php, Composer 2.10.3). Order: version from composer.json,
else COMPOSER_ROOT_VERSION, else git (current branch; detached HEAD ->
dev-<sha> then exact tag; feature branch -> closest parent branch by
git rev-list), else 1.0.0+no-version-set.
hg/fossil/svn are not ported (fallback to the default, as without a VCS).
Structs§
Constants§
- DEFAULT_
BRANCH_ ALIAS VersionParser::DEFAULT_BRANCH_ALIAS.- DEFAULT_
PRETTY_ VERSION
Functions§
- branch_
alias - Branch alias of the root: getBranchAlias on the composer.json, the version being the pretty version retained by RootPackageLoader.
- branch_
alias_ of ArrayLoader::getBranchAlias(Composer 2.10.3): the alias Composer attaches to a package (root or locked) whose version is a branch (dev-*or*-dev).extra.branch-aliastakes priority (-devtarget, normalised by normalizeBranch, source equal to the version ignoring case, compatible numeric prefix), else9999999-devifdefault-branchis true and the version has no numeric prefix. Returns (normalised alias, pretty alias); the pretty one is installed.php’s.- detect
- Determines the root version like RootPackageLoader.
- normalize_
branch VersionParser::normalizeBranch(composer/semver):1.2-> numeric1.2.x.x-dev(x -> 9999999), elsedev-<name>.- parse_
numeric_ alias_ prefix VersionParser::parseNumericAliasPrefix(composer/semver):1.2.x-devand1.2-dev->1.2., else None. Case-insensitive like the PCRE pattern.