samsonasik/package-versions
PHP 5.6 backport of ocramius/package-versions offering fast, no-IO access to Composer dependency versions from composer.lock. Call Versions::getVersion(), getShortVersion(), or getMajorVersion() to retrieve installed package versions at runtime.
Architecture fit
PackageVersions\Versions class at composer install/update time containing the resolved versions from composer.lock, then serves them at runtime with no IO.Integration feasibility
composer require samsonasik/package-versions, and the API is trivially small (getVersion, getShortVersion, getMajorVersion).allow-plugins — Composer now blocks plugins by default. The team must explicitly allow this plugin in composer.json, which is a governance/security decision, not a technical one.PackageVersions\Versions FQCN as ocramius/package-versions. Any transitive dependency that pulls the upstream package will conflict. This is the single largest integration hazard and must be confirmed via composer why ocramius/package-versions before adoption.Technical risk
Composer\InstalledVersions, which is shipped with Composer itself and requires no plugin, no allowlist, and no third-party dependency. On any modern stack, this package is strictly redundant.composer.lock at install time, so stale caches or partial deploys can surface incorrect version data.Key questions
ocramius/package-versions present anywhere in the dependency graph (direct or transitive)?Stack fit
Composer\InstalledVersions::getPrettyVersion() / getVersion() / getReference(), which are part of Composer's runtime API and need no plugin approval.Migration path
allow-plugins, pin the exact version, and wrap calls behind a thin internal interface (e.g., App\Support\PackageVersionResolver) so call sites are insulated.Composer\InstalledVersions, remove the dependency, and delete the allowlist entry. Because the API surface is three static methods, exit cost is measured in hours, not sprints — provided the wrapper is introduced at adoption time.Compatibility
composer show samsonasik/package-versions resolves without conflicting with ocramius/package-versions.Sequencing
ocramius/package-versions.allow-plugins entry with a code comment explaining the rationale and the exit trigger.Maintenance
Support
Scaling
composer install, adding negligible time. There is no per-deploy or per-request overhead to model.Failure modes
ocramius/package-versions, producing duplicate definitions and fatals.Composer\InstalledVersions.Ramp-up
TPM recommendation
Composer\InstalledVersions on Composer 2.How can I help you explore Laravel packages today?