2025-05-17 19:01:32 +07:00
|
|
|
<?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
|
|
|
|
|
{
|
2025-05-21 13:19:51 +07:00
|
|
|
$arg = '--enable-dom' . ($shared ? '=shared' : '');
|
2025-05-21 14:10:56 +07:00
|
|
|
$arg .= ' --with-libxml="' . BUILD_ROOT_PATH . '"';
|
2025-05-17 19:01:32 +07:00
|
|
|
return $arg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function patchBeforeBuildconf(): bool
|
|
|
|
|
{
|
|
|
|
|
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/win32/build/config.w32', 'dllmain.c ', '');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-21 12:01:00 +07:00
|
|
|
public function getWindowsConfigureArg($shared = false): string
|
2025-05-17 19:01:32 +07:00
|
|
|
{
|
|
|
|
|
return '--with-dom --with-libxml';
|
|
|
|
|
}
|
|
|
|
|
}
|