2024-05-11 14:46:36 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
|
|
|
|
use SPC\exception\WrongUsageException;
|
2024-12-05 18:43:31 +08:00
|
|
|
use SPC\store\FileSystem;
|
2024-05-11 14:46:36 +08:00
|
|
|
use SPC\util\CustomExt;
|
|
|
|
|
|
|
|
|
|
#[CustomExt('parallel')]
|
|
|
|
|
class parallel extends Extension
|
|
|
|
|
{
|
2024-05-16 13:01:11 +08:00
|
|
|
public function validate(): void
|
2024-05-11 14:46:36 +08:00
|
|
|
{
|
|
|
|
|
if (!$this->builder->getOption('enable-zts')) {
|
|
|
|
|
throw new WrongUsageException('ext-parallel must be built with ZTS builds. Use "--enable-zts" option!');
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-05 18:43:31 +08:00
|
|
|
|
|
|
|
|
public function patchBeforeBuildconf(): bool
|
|
|
|
|
{
|
|
|
|
|
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/ext/parallel/config.m4', '/PHP_VERSION=.*/m', '');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2024-05-11 14:46:36 +08:00
|
|
|
}
|