pub trait ScriptHooks {
// Required methods
fn pre_cmd(&self) -> Result<()>;
fn pre_autoload_dump(&self) -> Result<()>;
fn post_autoload_dump(&self) -> Result<()>;
fn post_cmd(&self) -> Result<()>;
}Expand description
Lifecycle hooks fired during an install when root-script execution is opted
in. The installer stays command- and PHP-agnostic: the caller supplies an
implementation that maps each hook to the right Composer event
(pre-install-cmd vs pre-update-cmd, …) and runs it.
Some(hooks) is the scripts-ON gate: when present, the native Laravel
discovery + its drift guard are skipped (the real post-autoload-dump
entries run instead), and the “scripts not run” warning is suppressed.
None keeps the deterministic scripts-OFF behavior.
Required Methods§
Sourcefn pre_autoload_dump(&self) -> Result<()>
fn pre_autoload_dump(&self) -> Result<()>
pre-autoload-dump — before the autoloader is regenerated.
Sourcefn post_autoload_dump(&self) -> Result<()>
fn post_autoload_dump(&self) -> Result<()>
post-autoload-dump — after the autoloader is regenerated. Runs the
project’s real entries (e.g. Laravel’s package:discover).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".