mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 14:25:41 +08:00
Add dba
This commit is contained in:
@@ -20,6 +20,12 @@ ext-curl:
|
||||
- ext-openssl
|
||||
php-extension:
|
||||
arg-type: with
|
||||
ext-dba:
|
||||
type: php-extension
|
||||
suggests:
|
||||
- qdbm
|
||||
php-extension:
|
||||
arg-type: custom
|
||||
ext-mbregex:
|
||||
type: php-extension
|
||||
depends:
|
||||
|
||||
28
src/Package/Extension/dba.php
Normal file
28
src/Package/Extension/dba.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Extension;
|
||||
|
||||
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
||||
use StaticPHP\Attribute\Package\Extension;
|
||||
use StaticPHP\Package\PackageInstaller;
|
||||
|
||||
#[Extension('dba')]
|
||||
class dba
|
||||
{
|
||||
#[CustomPhpConfigureArg('Darwin')]
|
||||
#[CustomPhpConfigureArg('Linux')]
|
||||
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
|
||||
{
|
||||
$qdbm = ($qdbm = $installer->getLibraryPackage('qdbm')) ? (" --with-qdbm={$qdbm->getBuildRootPath()}") : '';
|
||||
return '--enable-dba' . ($shared ? '=shared' : '') . $qdbm;
|
||||
}
|
||||
|
||||
#[CustomPhpConfigureArg('Windows')]
|
||||
public function getWindowsConfigureArg(PackageInstaller $installer): string
|
||||
{
|
||||
$qdbm = $installer->getLibraryPackage('qdbm') ? ' --with-qdbm' : '';
|
||||
return '--with-dba' . $qdbm;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user