Add preInstall stage

This commit is contained in:
crazywhalecc
2026-05-22 14:03:26 +08:00
parent 735f12648e
commit a23ad55fe2

View File

@@ -155,6 +155,7 @@ class PackageInstaller
}
$this->reconcilePhpSrcVersion();
$this->emitPreInstallEvents();
if ($this->interactive && !$disable_delay_msg) {
// show install or build options in terminal with beautiful output
@@ -361,6 +362,15 @@ class PackageInstaller
return false;
}
public function emitPreInstallEvents(): void
{
foreach ($this->packages as $package) {
if ($package->hasStage('preInstall')) {
$package->runStage('preInstall');
}
}
}
public function emitPostInstallEvents(): void
{
foreach ($this->packages as $package) {