mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
linter
This commit is contained in:
parent
7698ceb108
commit
3f8d297fb1
@ -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')
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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.
|
||||
*/
|
||||
|
||||
@ -64,5 +64,6 @@ class sqlsrv extends Extension
|
||||
// check shared extension with php-cli
|
||||
if (file_exists(BUILD_BIN_PATH . '/php')) {
|
||||
$this->runSharedExtensionCheckUnix();
|
||||
} }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user