mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add ext-pcntl,ext-pdo,ext-pdo_mysql,ext-pdo_odbc
This commit is contained in:
parent
7a690fd9a3
commit
74865025bd
@ -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:
|
||||
|
||||
35
src/Package/Extension/pdo_odbc.php
Normal file
35
src/Package/Extension/pdo_odbc.php
Normal 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';
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user