don't add configure command to phpinfo when -release is set

This commit is contained in:
DubbleClick 2025-06-12 23:37:18 +07:00
parent 0a24a6af1f
commit d249391816

View File

@ -214,6 +214,19 @@ abstract class LibraryBase
*/
public function tryBuild(bool $force_build = false): int
{
if (str_contains((string) getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS'), '-release')) {
FileSystem::replaceFileLineContainsString(
SOURCE_PATH . '/php-src/ext/standard/info.c',
'#ifdef CONFIGURE_COMMAND',
'#ifdef NO_CONFIGURE_COMMAND',
);
} else {
FileSystem::replaceFileLineContainsString(
SOURCE_PATH . '/php-src/ext/standard/info.c',
'#ifdef NO_CONFIGURE_COMMAND',
'#ifdef CONFIGURE_COMMAND',
);
}
if (file_exists($this->source_dir . '/.spc.patched')) {
$this->patched = true;
}