Jerry Ma a7adec1341
Add extension ev support (#703)
* Add extension ev support

* Sort config

* Correct ev build arg for windows

* Use static-php mirror of nasm

* Fix windows ev patch

* Oops
2025-04-19 20:39:48 +08:00

32 lines
835 B
PHP

<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\exception\FileSystemException;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('ev')]
class ev extends Extension
{
/**
* @throws FileSystemException
*/
public function patchBeforeBuildconf(): bool
{
/*
* replace EXTENSION('ev', php_ev_sources, true, ' /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
* to EXTENSION('ev', php_ev_sources, PHP_EV_SHARED, ' /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
*/
FileSystem::replaceFileLineContainsString(
$this->source_dir . '/config.w32',
'EXTENSION(\'ev\'',
" EXTENSION('ev', php_ev_sources, PHP_EV_SHARED, ' /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');"
);
return true;
}
}