Expand description
Generate Composer-compatible vendor/composer/autoload_*.php.
Goal per AUTOLOADER_PLAN.md: byte-equivalent output to Composer’s
own dump-autoload, pinned to a specific upstream version (2.8.12
as of the initial fixture set). Performance-first design: parallel
file scan, SIMD byte search in the classmap pipeline, lazy I/O.
Status: every file composer dump-autoload writes under
vendor/ is now emitted byte-equivalent across the fixtures in
tests/fixtures/: vendor/autoload.php,
vendor/composer/autoload_{namespaces,psr4,classmap,files,real,static}.php,
the vendored ClassLoader.php / InstalledVersions.php / LICENSE,
and installed.{json,php}. Conditional features wired in:
--optimize, --classmap-authoritative, --no-dev,
--apcu-autoloader (with explicit apcu_prefix override for
tests), config.autoloader-suffix (composer.json override of the
content-hash), and config.platform-check → platform_check.php
(the PHP-version + extension guard, byte-equivalent to Composer; see
emit::platform_check, built on composer_semver’s constraint
lower-bound extraction).
Structs§
- Autoload
Header - Snapshot of the inputs that produced this autoloader’s state.
Compared against a fresh
DumpRequestto detect drift: a header match means a live patch is sufficient; a mismatch means the project needs a full re-bootstrap. - Autoloader
- One project’s classmap model.
- Dump
Report - Summary returned by
dump_autoload.class_countmatches Composer’scontaining N classesfigure: total entries in the emitted classmap (always includes the syntheticComposer\InstalledVersionsrow, mirroring Composer). - Dump
Request - Inputs for an autoload dump. Names mirror Composer terminology.
- Header
Flags - PsrWarning
- PSR-noncompliance report for a single class. Composer prints one
of these per rejected class when a file’s classes all failed the
psr-4/psr-0namespace+path rule: it drops every class in the file and warns. The caller collects them so it can render the sameClass X located in Y does not comply with psr-N autoloading standard. Skipping.line.
Enums§
Constants§
- REFERENCE_
COMPOSER_ VERSION - Pinned upstream Composer version that fixtures + byte-equivalence
tests are generated against. Bump in lockstep with regenerating
tests/fixtures/.
Functions§
- dump_
autoload - Generate
vendor/composer/autoload_*.phpfor the given project. - user_
code_ roots - Directories the server’s filesystem watcher needs to arm for live
patches: every root autoload
scan_rootplus thescan_rootsof anydist.type: "path"package incomposer.lock. Vendor proper (zip/tardists) is intentionally excluded — those only change viacomposer install, which rewritescomposer.lockand triggers a full re-bootstrap.