diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-21 11:18:26 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-21 11:18:26 +0900 |
| commit | 8ecb8e5ea476886cb3f62a8efa4a8189e2aa4740 (patch) | |
| tree | 3750a7b722f4d0ceb8435a9b3dc898a8a731e59b /crates/mozart/src/commands/install.rs | |
| parent | f030dc63ea84a13f1e494a1541b6120c0969f383 (diff) | |
| download | php-mozart-8ecb8e5ea476886cb3f62a8efa4a8189e2aa4740.tar.gz php-mozart-8ecb8e5ea476886cb3f62a8efa4a8189e2aa4740.tar.zst php-mozart-8ecb8e5ea476886cb3f62a8efa4a8189e2aa4740.zip | |
feat(autoload): generate Composer-compatible PHP autoloader files
Implement autoloader generation that produces all standard Composer
autoloader files (autoload.php, autoload_real.php, autoload_static.php,
autoload_psr4.php, autoload_namespaces.php, autoload_classmap.php,
autoload_files.php, installed.php) plus embeds ClassLoader.php,
InstalledVersions.php, and LICENSE from the Composer submodule. Wire
into the install command (gated by --no-autoloader) and replace the
todo!() in dump-autoload with a working implementation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/install.rs')
| -rw-r--r-- | crates/mozart/src/commands/install.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/mozart/src/commands/install.rs b/crates/mozart/src/commands/install.rs index ddf7be8..97f42e7 100644 --- a/crates/mozart/src/commands/install.rs +++ b/crates/mozart/src/commands/install.rs @@ -395,6 +395,22 @@ pub fn execute(args: &InstallArgs, cli: &super::Cli) -> anyhow::Result<()> { } new_installed.write(&vendor_dir)?; + + // Step 14: Generate autoloader (unless --no-autoloader) + if !args.no_autoloader { + eprintln!("Generating autoload files"); + + let suffix = lock.content_hash.clone(); + + crate::autoload::generate(&crate::autoload::AutoloadConfig { + project_dir: working_dir.clone(), + vendor_dir: vendor_dir.clone(), + dev_mode, + suffix, + })?; + + eprintln!("Generated autoload files"); + } } Ok(()) |
