diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 3152dd3e..0cda99b6 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -336,7 +336,7 @@ class Extension if ($this->patchBeforeSharedConfigure()) { logger()->info('ext [ . ' . $this->getName() . '] patching before shared configure'); } - + shell()->cd($this->source_dir) ->setEnv($env) ->execWithEnv('./configure ' . $this->getUnixConfigureArg(true) . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --with-pic') diff --git a/src/SPC/builder/extension/curl.php b/src/SPC/builder/extension/curl.php index 0fd2b90b..4779e67c 100644 --- a/src/SPC/builder/extension/curl.php +++ b/src/SPC/builder/extension/curl.php @@ -74,7 +74,6 @@ class curl extends Extension // Match the line containing PHP_CHECK_LIBRARY for curl $pattern = '/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],)/'; - // Restore LIBS after the check — append this just after the macro block $restore = ' LIBS="$save_LIBS"'; @@ -87,13 +86,13 @@ class curl extends Extension // Inject restore after the matching PHP_CHECK_LIBRARY block $patched = preg_replace( '/(PHP_CHECK_LIBRARY\(\[curl],\s*\[curl_easy_perform],.*?\)\n)/s', - "$1$restore\n", + "$1{$restore}\n", $patched, 1 ); if ($patched === null) { - throw new \RuntimeException("Failed to patch config.m4 due to a regex error"); + throw new \RuntimeException('Failed to patch config.m4 due to a regex error'); } FileSystem::writeFile($file, $patched); diff --git a/src/SPC/builder/extension/mbregex.php b/src/SPC/builder/extension/mbregex.php index b7d174ff..1f169e1a 100644 --- a/src/SPC/builder/extension/mbregex.php +++ b/src/SPC/builder/extension/mbregex.php @@ -21,11 +21,6 @@ class mbregex extends Extension return ''; } - public function buildUnixShared(): void - { - print('mbregex is already built as part of mbstring, skipping build' . PHP_EOL); - } - /** * mbregex is not an extension, we need to overwrite the default check. */ diff --git a/src/SPC/builder/extension/sqlsrv.php b/src/SPC/builder/extension/sqlsrv.php index 22aef95b..f6cd21a0 100644 --- a/src/SPC/builder/extension/sqlsrv.php +++ b/src/SPC/builder/extension/sqlsrv.php @@ -64,5 +64,6 @@ class sqlsrv extends Extension // check shared extension with php-cli if (file_exists(BUILD_BIN_PATH . '/php')) { $this->runSharedExtensionCheckUnix(); - } } + } + } } diff --git a/src/SPC/builder/extension/xml.php b/src/SPC/builder/extension/xml.php index 3c8b5dff..bd64d346 100644 --- a/src/SPC/builder/extension/xml.php +++ b/src/SPC/builder/extension/xml.php @@ -29,7 +29,7 @@ class xml extends Extension 'simplexml' => '--enable-simplexml', default => throw new RuntimeException('Not accept non-xml extension'), }; - $arg .= ($shared ? '=shared' : '' ) . ' --with-libxml="' . BUILD_ROOT_PATH . '"'; + $arg .= ($shared ? '=shared' : '') . ' --with-libxml="' . BUILD_ROOT_PATH . '"'; return $arg; } diff --git a/src/SPC/builder/traits/UnixLibraryTrait.php b/src/SPC/builder/traits/UnixLibraryTrait.php index 45de0cf4..962f257f 100644 --- a/src/SPC/builder/traits/UnixLibraryTrait.php +++ b/src/SPC/builder/traits/UnixLibraryTrait.php @@ -95,8 +95,8 @@ trait UnixLibraryTrait logger()->debug('Patching ' . $realpath); // replace prefix $file = FileSystem::readFile($realpath); - $file = str_replace(' /lib/', ' ' . BUILD_LIB_PATH . '/', $file); - $file = preg_replace("/^libdir=.*$/m", "libdir='" . BUILD_LIB_PATH . "'", $file); + $file = str_replace(' /lib/', ' ' . BUILD_LIB_PATH . '/', $file); + + $file = preg_replace('/^libdir=.*$/m', "libdir='" . BUILD_LIB_PATH . "'", $file); FileSystem::writeFile($realpath, $file); } }