diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-21 16:37:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-21 16:37:03 +0900 |
| commit | 3535037592f149477c915a8b66da974eb59586db (patch) | |
| tree | f476925e9d136d2ddcf206d80355a9a0ca4afda5 /crates/mozart/src/commands/install.rs | |
| parent | c04744719bd16d9414a9f9a358691d03a993670c (diff) | |
| download | php-mozart-3535037592f149477c915a8b66da974eb59586db.tar.gz php-mozart-3535037592f149477c915a8b66da974eb59586db.tar.zst php-mozart-3535037592f149477c915a8b66da974eb59586db.zip | |
feat(autoload): add classmap scanning, optimize, APCu, platform checks, and strict-psr
Add PHP file scanner (php_scanner.rs) with class/interface/trait/enum
detection, comment/string/heredoc stripping, and PSR-4/PSR-0 validation.
Extend autoload generation with: classmap directory scanning, --optimize
mode (PSR-4/PSR-0 to classmap), --classmap-authoritative, --apcu caching
with optional prefix, platform_check.php generation, and --strict-psr
violation reporting. Wire new options through dump-autoload, install,
require, update, and remove commands.
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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/mozart/src/commands/install.rs b/crates/mozart/src/commands/install.rs index 6c023a1..53b827a 100644 --- a/crates/mozart/src/commands/install.rs +++ b/crates/mozart/src/commands/install.rs @@ -110,6 +110,10 @@ pub struct InstallConfig { pub optimize_autoloader: bool, /// Use classmap-only autoloading (implies optimize_autoloader). pub classmap_authoritative: bool, + /// Use APCu to cache found/not-found classes. + pub apcu_autoloader: bool, + /// Custom prefix for APCu autoloader cache. + pub apcu_autoloader_prefix: Option<String>, } impl Default for InstallConfig { @@ -123,6 +127,8 @@ impl Default for InstallConfig { ignore_platform_req: vec![], optimize_autoloader: false, classmap_authoritative: false, + apcu_autoloader: false, + apcu_autoloader_prefix: None, } } } @@ -474,6 +480,12 @@ pub fn install_from_lock( dev_mode, suffix, classmap_authoritative: config.classmap_authoritative, + optimize: config.optimize_autoloader, + apcu: config.apcu_autoloader, + apcu_prefix: config.apcu_autoloader_prefix.clone(), + strict_psr: false, + platform_check: crate::autoload::PlatformCheckMode::Full, + ignore_platform_reqs: config.ignore_platform_reqs, })?; eprintln!("Generated autoload files"); @@ -586,6 +598,8 @@ pub fn execute(args: &InstallArgs, cli: &super::Cli) -> anyhow::Result<()> { ignore_platform_req: args.ignore_platform_req.clone(), optimize_autoloader: args.optimize_autoloader, classmap_authoritative: args.classmap_authoritative, + apcu_autoloader: args.apcu_autoloader, + apcu_autoloader_prefix: args.apcu_autoloader_prefix.clone(), }, ) } |
