Skip to content

Commit a23ad55

Browse files
committed
Add preInstall stage
1 parent 735f126 commit a23ad55

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/StaticPHP/Package/PackageInstaller.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public function run(bool $disable_delay_msg = false): void
155155
}
156156

157157
$this->reconcilePhpSrcVersion();
158+
$this->emitPreInstallEvents();
158159

159160
if ($this->interactive && !$disable_delay_msg) {
160161
// show install or build options in terminal with beautiful output
@@ -361,6 +362,15 @@ public function isPackageInstalled(Package|string $package_name): bool
361362
return false;
362363
}
363364

365+
public function emitPreInstallEvents(): void
366+
{
367+
foreach ($this->packages as $package) {
368+
if ($package->hasStage('preInstall')) {
369+
$package->runStage('preInstall');
370+
}
371+
}
372+
}
373+
364374
public function emitPostInstallEvents(): void
365375
{
366376
foreach ($this->packages as $package) {

0 commit comments

Comments
 (0)