Skip to content

Commit b384345

Browse files
committed
Add php-micro patch for embed mode
1 parent f4bb026 commit b384345

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Package/Target/micro.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Package\Target;
6+
7+
use StaticPHP\Attribute\Package\BeforeStage;
8+
use StaticPHP\Attribute\Package\Target;
9+
use StaticPHP\Attribute\PatchDescription;
10+
use StaticPHP\Package\TargetPackage;
11+
use StaticPHP\Util\FileSystem;
12+
13+
#[Target('php-micro')]
14+
class micro
15+
{
16+
#[BeforeStage('php', 'unix-make-embed', 'php-micro')]
17+
#[PatchDescription('Patch Makefile to build only libphp.la for embedding')]
18+
public function patchBeforeEmbed(TargetPackage $package): void
19+
{
20+
FileSystem::replaceFileStr("{$package->getSourceDir()}/Makefile", 'OVERALL_TARGET =', 'OVERALL_TARGET = libphp.la');
21+
}
22+
}

0 commit comments

Comments
 (0)