mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 08:45:40 +08:00
Add frankenphp SAPI build support
This commit is contained in:
29
src/Package/Extension/phar.php
Normal file
29
src/Package/Extension/phar.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Extension;
|
||||
|
||||
use Package\Target\php;
|
||||
use StaticPHP\Attribute\Package\AfterStage;
|
||||
use StaticPHP\Attribute\Package\BeforeStage;
|
||||
use StaticPHP\Attribute\Package\Extension;
|
||||
use StaticPHP\Attribute\PatchDescription;
|
||||
use StaticPHP\Util\SourcePatcher;
|
||||
|
||||
#[Extension('phar')]
|
||||
class phar
|
||||
{
|
||||
#[BeforeStage('php', [php::class, 'makeMicroForUnix'], 'ext-phar')]
|
||||
#[PatchDescription('Patch phar extension for micro SAPI to support compressed phar')]
|
||||
public function beforeMicroUnixBuild(): void
|
||||
{
|
||||
SourcePatcher::patchMicroPhar(php::getPHPVersionID());
|
||||
}
|
||||
|
||||
#[AfterStage('php', [php::class, 'makeMicroForUnix'], 'ext-phar')]
|
||||
public function afterMicroUnixBuild(): void
|
||||
{
|
||||
SourcePatcher::unpatchMicroPhar();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user