aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/reinstall.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 01:18:58 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 01:18:58 +0900
commit7372dc668476cde4bcb789e586cb9a65af1afca0 (patch)
treeaeeec34820b3714698407c32fc16942002129561 /crates/mozart/src/commands/reinstall.rs
parent40bd784824dc5f40e22908ff35d4ae693696ba89 (diff)
downloadphp-mozart-7372dc668476cde4bcb789e586cb9a65af1afca0.tar.gz
php-mozart-7372dc668476cde4bcb789e586cb9a65af1afca0.tar.zst
php-mozart-7372dc668476cde4bcb789e586cb9a65af1afca0.zip
fix(dump-autoload): add config defaults, CLI validation, and class count output
Read optimize-autoloader, classmap-authoritative, apcu-autoloader from composer.json config section. Reject --dev with --no-dev and --strict-psr/ --strict-ambiguous without --optimize. Emit pre/post generation messages with class count in optimized mode. Track ambiguous class mappings and exit with code 2 when --strict-ambiguous detects conflicts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/reinstall.rs')
-rw-r--r--crates/mozart/src/commands/reinstall.rs28
1 files changed, 15 insertions, 13 deletions
diff --git a/crates/mozart/src/commands/reinstall.rs b/crates/mozart/src/commands/reinstall.rs
index 313c70c..c6df20d 100644
--- a/crates/mozart/src/commands/reinstall.rs
+++ b/crates/mozart/src/commands/reinstall.rs
@@ -234,19 +234,21 @@ pub async fn execute(
let dev_mode = !args.no_dev && installed.dev;
let suffix = lock.content_hash.clone();
- mozart_autoload::autoload::generate(&mozart_autoload::autoload::AutoloadConfig {
- project_dir: working_dir.to_path_buf(),
- vendor_dir: vendor_dir.to_path_buf(),
- dev_mode,
- suffix,
- classmap_authoritative: args.classmap_authoritative,
- optimize: args.optimize_autoloader,
- apcu: args.apcu_autoloader,
- apcu_prefix: args.apcu_autoloader_prefix.clone(),
- strict_psr: false,
- platform_check: mozart_autoload::autoload::PlatformCheckMode::Full,
- ignore_platform_reqs: args.ignore_platform_reqs,
- })?;
+ let _result =
+ mozart_autoload::autoload::generate(&mozart_autoload::autoload::AutoloadConfig {
+ project_dir: working_dir.to_path_buf(),
+ vendor_dir: vendor_dir.to_path_buf(),
+ dev_mode,
+ suffix,
+ classmap_authoritative: args.classmap_authoritative,
+ optimize: args.optimize_autoloader,
+ apcu: args.apcu_autoloader,
+ apcu_prefix: args.apcu_autoloader_prefix.clone(),
+ strict_psr: false,
+ strict_ambiguous: false,
+ platform_check: mozart_autoload::autoload::PlatformCheckMode::Full,
+ ignore_platform_reqs: args.ignore_platform_reqs,
+ })?;
console.info("Generated autoload files");
}