mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
36 lines
800 B
PHP
36 lines
800 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
use SPC\builder\Extension;
|
|
use SPC\exception\RuntimeException;
|
|
use SPC\store\FileSystem;
|
|
use SPC\util\CustomExt;
|
|
|
|
#[CustomExt('dom')]
|
|
class dom extends Extension
|
|
{
|
|
/**
|
|
* @throws RuntimeException
|
|
*/
|
|
public function getUnixConfigureArg(bool $shared = false): string
|
|
{
|
|
$arg = '--enable-dom' . ($shared ? '=shared' : '');
|
|
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
|
|
return $arg;
|
|
}
|
|
|
|
public function patchBeforeBuildconf(): bool
|
|
{
|
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/win32/build/config.w32', 'dllmain.c ', '');
|
|
return true;
|
|
}
|
|
|
|
public function getWindowsConfigureArg($shared = false): string
|
|
{
|
|
return '--with-dom';
|
|
}
|
|
}
|