mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
Add php-micro patch for embed mode
This commit is contained in:
parent
f4bb0263f6
commit
b384345723
22
src/Package/Target/micro.php
Normal file
22
src/Package/Target/micro.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Target;
|
||||
|
||||
use StaticPHP\Attribute\Package\BeforeStage;
|
||||
use StaticPHP\Attribute\Package\Target;
|
||||
use StaticPHP\Attribute\PatchDescription;
|
||||
use StaticPHP\Package\TargetPackage;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
|
||||
#[Target('php-micro')]
|
||||
class micro
|
||||
{
|
||||
#[BeforeStage('php', 'unix-make-embed', 'php-micro')]
|
||||
#[PatchDescription('Patch Makefile to build only libphp.la for embedding')]
|
||||
public function patchBeforeEmbed(TargetPackage $package): void
|
||||
{
|
||||
FileSystem::replaceFileStr("{$package->getSourceDir()}/Makefile", 'OVERALL_TARGET =', 'OVERALL_TARGET = libphp.la');
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user