Add ext-pcntl,ext-pdo,ext-pdo_mysql,ext-pdo_odbc

This commit is contained in:
crazywhalecc 2026-03-12 22:06:42 +08:00
parent 7a690fd9a3
commit 74865025bd
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 57 additions and 0 deletions

View File

@ -165,6 +165,28 @@ ext-password-argon2:
php-extension:
arg-type: custom
display-name: ''
ext-pcntl:
type: php-extension
ext-pdo:
type: php-extension
ext-pdo_mysql:
type: php-extension
depends:
- ext-pdo
- ext-mysqlnd
php-extension:
arg-type: with
ext-pdo_odbc:
type: php-extension
depends:
- ext-pdo
- ext-odbc
depends@unix:
- unixodbc
- ext-pdo
- ext-odbc
php-extension:
arg-type: custom
ext-phar:
type: php-extension
depends:

View File

@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace Package\Extension;
use Package\Target\php;
use StaticPHP\Attribute\Package\BeforeStage;
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
use StaticPHP\Attribute\Package\Extension;
use StaticPHP\Package\PhpExtensionPackage;
use StaticPHP\Util\FileSystem;
#[Extension('pdo_odbc')]
class pdo_odbc extends PhpExtensionPackage
{
#[BeforeStage('php', [php::class, 'buildconfForUnix'], 'ext-pdo_odbc')]
public function patchBeforeBuildconf(): void
{
FileSystem::replaceFileStr("{$this->getSourceDir()}/config.m4", 'PDO_ODBC_LDFLAGS="$pdo_odbc_def_ldflags', 'PDO_ODBC_LDFLAGS="-liconv $pdo_odbc_def_ldflags');
}
#[CustomPhpConfigureArg('Linux')]
#[CustomPhpConfigureArg('Darwin')]
public function getUnixConfigureArg(bool $shared): string
{
return '--with-pdo-odbc=' . ($shared ? 'shared,' : '') . 'unixODBC,' . BUILD_ROOT_PATH;
}
#[CustomPhpConfigureArg('Windows')]
public function getWindowsConfigureArg(bool $shared): string
{
return '--with-pdo-odbc';
}
}