mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add separated patchedBeforeWindowsConfigure
This commit is contained in:
parent
e1c9240698
commit
07d66ade85
@ -183,6 +183,14 @@ class Extension
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch code before ./configure.bat for Windows
|
||||
*/
|
||||
public function patchBeforeWindowsConfigure(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch code before make
|
||||
* If you need to patch some code, overwrite this
|
||||
|
||||
@ -288,6 +288,16 @@ abstract class LibraryBase
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch code before windows configure.bat
|
||||
* If you need to patch some code, overwrite this
|
||||
* return true if you patched something, false if not
|
||||
*/
|
||||
public function patchBeforeWindowsConfigure(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch code before make
|
||||
* If you need to patch some code, overwrite this
|
||||
|
||||
@ -20,9 +20,6 @@ class bz2 extends Extension
|
||||
*/
|
||||
public function patchBeforeConfigure(): bool
|
||||
{
|
||||
if (!is_unix()) {
|
||||
return false;
|
||||
}
|
||||
$frameworks = $this->builder instanceof MacOSBuilder ? ' ' . $this->builder->getFrameworks(true) . ' ' : '';
|
||||
FileSystem::replaceFileRegex(SOURCE_PATH . '/php-src/configure', '/-lbz2/', $this->getLibFilesString() . $frameworks);
|
||||
return true;
|
||||
|
||||
@ -24,7 +24,7 @@ class sqlsrv extends Extension
|
||||
return false;
|
||||
}
|
||||
|
||||
public function patchBeforeConfigure(): bool
|
||||
public function patchBeforeWindowsConfigure(): bool
|
||||
{
|
||||
if ($this->pdo_sqlsrv_patched) {
|
||||
// revert pdo_sqlsrv patch
|
||||
|
||||
@ -7,6 +7,7 @@ namespace SPC\store;
|
||||
use SPC\builder\BuilderBase;
|
||||
use SPC\builder\linux\SystemUtil;
|
||||
use SPC\builder\unix\UnixBuilderBase;
|
||||
use SPC\builder\windows\WindowsBuilder;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
@ -87,7 +88,8 @@ class SourcePatcher
|
||||
public static function patchBeforeConfigure(BuilderBase $builder): void
|
||||
{
|
||||
foreach ($builder->getExts() as $ext) {
|
||||
if ($ext->patchBeforeConfigure() === true) {
|
||||
$patch = $builder instanceof WindowsBuilder ? $ext->patchBeforeWindowsConfigure() : $ext->patchBeforeConfigure();
|
||||
if ($patch === true) {
|
||||
logger()->info("Extension [{$ext->getName()}] patched before configure");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user