pub struct ScriptContext<'a> {
pub project_root: &'a Path,
pub php_bin: &'a Path,
pub bin_dir: &'a Path,
pub base_env: Vec<(String, String)>,
pub dev_mode: bool,
pub timeout: Option<Duration>,
pub callbacks: &'a CallbackRegistry,
}Expand description
Everything dispatch needs from the host, injected by
the caller so the crate stays FS/PHP-agnostic and testable.
Fields§
§project_root: &'a PathProject root; scripts run with this as their working directory.
php_bin: &'a PathThe project’s resolved PHP binary, used for @php entries.
bin_dir: &'a Pathvendor/bin (or config.bin-dir). Prepended onto PATH for the
dispatch so scripts find installed CLIs (phpunit, pint, …). The
host may already have folded this into base_env’s PATH; the
prepend is idempotent (skipped if PATH already leads with it).
base_env: Vec<(String, String)>Base environment overrides layered on top of the inherited process
env: PATH, COMPOSER_DEV_MODE, COMPOSER_BINARY, BOUGIE_*, and
any per-tenant BOUGIE_SERVICE_* vars.
dev_mode: boolWhether dev dependencies are in scope (COMPOSER_DEV_MODE).
timeout: Option<Duration>Per-process wall-clock timeout (Composer’s config.process-timeout,
default 300s). Each spawned entry gets its own budget; on expiry the
child is killed and the event aborts. The
Composer\Config::disableProcessTimeout script callback flips it off
for the rest of the dispatch. None = unlimited.
callbacks: &'a CallbackRegistryNative handlers for the callbacks bougie reproduces (keyed by
"Class::method"). A hit runs the handler instead of warn-skipping.