remove runSharedExtensionCheckUnix

This commit is contained in:
DubbleClick
2025-05-21 18:35:48 +07:00
parent af51469b62
commit b376d1682f
12 changed files with 45 additions and 61 deletions

View File

@@ -24,17 +24,6 @@ class opcache extends Extension
}
}
public function runSharedExtensionCheckUnix(): void
{
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n -d "zend_extension=' . BUILD_MODULES_PATH . '/opcache.so" -v');
if ($ret !== 0) {
throw new RuntimeException('opcache.so failed to load.');
}
if (!str_contains(join($out), 'with Zend OPcache')) {
throw new RuntimeException('opcache.so failed to load.');
}
}
public function patchBeforeBuildconf(): bool
{
if (file_exists(SOURCE_PATH . '/php-src/.opcache_patched')) {
@@ -62,4 +51,9 @@ class opcache extends Extension
{
return 'Zend Opcache';
}
protected function isZendExtension(): bool
{
return true;
}
}

View File

@@ -29,10 +29,5 @@ class pdo_sqlsrv extends Extension
->execWithEnv('make clean')
->execWithEnv('make -j' . $this->builder->concurrency)
->execWithEnv('make install');
// check shared extension with php-cli
if (file_exists(BUILD_BIN_PATH . '/php')) {
$this->runSharedExtensionCheckUnix();
}
}
}

View File

@@ -60,10 +60,5 @@ class sqlsrv extends Extension
->execWithEnv('make clean')
->execWithEnv('make -j' . $this->builder->concurrency)
->execWithEnv('make install');
// check shared extension with php-cli
if (file_exists(BUILD_BIN_PATH . '/php')) {
$this->runSharedExtensionCheckUnix();
}
}
}

View File

@@ -5,20 +5,13 @@ declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\exception\RuntimeException;
use SPC\util\CustomExt;
#[CustomExt('xdebug')]
class xdebug extends Extension
{
public function runSharedExtensionCheckUnix(): void
protected function isZendExtension(): bool
{
[$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n -d "zend_extension=' . BUILD_MODULES_PATH . '/xdebug.so" -v');
if ($ret !== 0) {
throw new RuntimeException('xdebug.so failed to load.');
}
if (!str_contains(join($out), 'with Xdebug')) {
throw new RuntimeException('xdebug.so failed to load.');
}
return str_contains($this->builder->getExt('zend')->getName(), 'xdebug');
}
}

View File

@@ -56,10 +56,5 @@ class xhprof extends Extension
->execWithEnv('make clean')
->execWithEnv('make -j' . $this->builder->concurrency)
->execWithEnv('make install');
// check shared extension with php-cli
if (file_exists(BUILD_BIN_PATH . '/php')) {
$this->runSharedExtensionCheckUnix();
}
}
}