Add ext-trader

This commit is contained in:
crazywhalecc 2026-03-17 12:27:14 +08:00
parent bfb6fcd436
commit deef11c86a
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,14 @@
ext-trader:
type: php-extension
artifact:
source:
type: pecl
name: trader
metadata:
license-files: [LICENSE]
license: BSD-2-Clause
php-extension:
support:
BSD: wip
Windows: wip
arg-type: enable

View File

@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Package\Extension;
use Package\Target\php;
use StaticPHP\Attribute\Package\BeforeStage;
use StaticPHP\Attribute\Package\Extension;
use StaticPHP\Package\PackageInstaller;
use StaticPHP\Package\PhpExtensionPackage;
use StaticPHP\Util\FileSystem;
#[Extension('trader')]
class trader extends PhpExtensionPackage
{
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-trader')]
public function patchBeforeBuildconf(PackageInstaller $installer): bool
{
FileSystem::replaceFileStr("{$this->getSourceDir()}/config.m4", 'PHP_TA', 'PHP_TRADER');
return true;
}
}