suggestion

This commit is contained in:
DubbleClick
2025-06-20 17:11:52 +07:00
parent 2abbb75f98
commit 58d979712e
4 changed files with 14 additions and 21 deletions

View File

@@ -193,7 +193,7 @@ class Extension
* If you need to patch some code, overwrite this * If you need to patch some code, overwrite this
* return true if you patched something, false if not * return true if you patched something, false if not
*/ */
public function patchBeforeSharedBuild(): bool public function patchBeforeSharedPhpize(): bool
{ {
return false; return false;
} }
@@ -394,13 +394,17 @@ class Extension
'LD_LIBRARY_PATH' => BUILD_LIB_PATH, 'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
]; ];
if ($this->patchBeforeSharedPhpize()) {
logger()->info("Extension [{$this->getName()}] patched before shared phpize");
}
// prepare configure args // prepare configure args
shell()->cd($this->source_dir) shell()->cd($this->source_dir)
->setEnv($env) ->setEnv($env)
->exec(BUILD_BIN_PATH . '/phpize'); ->exec(BUILD_BIN_PATH . '/phpize');
if ($this->patchBeforeSharedConfigure()) { if ($this->patchBeforeSharedConfigure()) {
logger()->info('ext [' . $this->getName() . '] patching before shared configure'); logger()->info("Extension [{$this->getName()}] patched before shared configure");
} }
shell()->cd($this->source_dir) shell()->cd($this->source_dir)
@@ -419,7 +423,7 @@ class Extension
); );
if ($this->patchBeforeSharedMake()) { if ($this->patchBeforeSharedMake()) {
logger()->info('ext [' . $this->getName() . '] patching before shared make'); logger()->info("Extension [{$this->getName()}] patched before shared make");
} }
shell()->cd($this->source_dir) shell()->cd($this->source_dir)

View File

@@ -22,7 +22,7 @@ class intl extends Extension
return true; return true;
} }
public function patchBeforeSharedBuild(): bool public function patchBeforeSharedPhpize(): bool
{ {
return $this->patchBeforeBuildconf(); return $this->patchBeforeBuildconf();
} }

View File

@@ -207,8 +207,6 @@ class BuildPHPCommand extends BuildCommand
// start to build // start to build
$builder->buildPHP($rule); $builder->buildPHP($rule);
SourcePatcher::patchBeforeSharedBuild($builder);
// build dynamic extensions if needed // build dynamic extensions if needed
if (!empty($shared_extensions)) { if (!empty($shared_extensions)) {
logger()->info('Building shared extensions ...'); logger()->info('Building shared extensions ...');

View File

@@ -46,12 +46,12 @@ class SourcePatcher
{ {
foreach ($builder->getExts() as $ext) { foreach ($builder->getExts() as $ext) {
if ($ext->patchBeforeBuildconf() === true) { if ($ext->patchBeforeBuildconf() === true) {
logger()->info('Extension [' . $ext->getName() . '] patched before buildconf'); logger()->info("Extension [{$ext->getName()}] patched before buildconf");
} }
} }
foreach ($builder->getLibs() as $lib) { foreach ($builder->getLibs() as $lib) {
if ($lib->patchBeforeBuildconf() === true) { if ($lib->patchBeforeBuildconf() === true) {
logger()->info('Library [' . $lib->getName() . '] patched before buildconf'); logger()->info("Library [{$lib->getName()}]patched before buildconf");
} }
} }
// patch windows php 8.1 bug // patch windows php 8.1 bug
@@ -79,15 +79,6 @@ class SourcePatcher
} }
} }
public static function patchBeforeSharedBuild(BuilderBase $builder): void
{
foreach ($builder->getExts() as $ext) {
if ($ext->patchBeforeSharedBuild() === true) {
logger()->info('Extension [' . $ext->getName() . '] patched before shared build');
}
}
}
/** /**
* Source patcher runner before configure * Source patcher runner before configure
* *
@@ -98,12 +89,12 @@ class SourcePatcher
{ {
foreach ($builder->getExts() as $ext) { foreach ($builder->getExts() as $ext) {
if ($ext->patchBeforeConfigure() === true) { if ($ext->patchBeforeConfigure() === true) {
logger()->info('Extension [' . $ext->getName() . '] patched before configure'); logger()->info("Extension [{$ext->getName()}] patched before configure");
} }
} }
foreach ($builder->getLibs() as $lib) { foreach ($builder->getLibs() as $lib) {
if ($lib->patchBeforeConfigure() === true) { if ($lib->patchBeforeConfigure() === true) {
logger()->info('Library [' . $lib->getName() . '] patched before configure'); logger()->info("Library [{$lib->getName()}] patched before configure");
} }
} }
// patch capstone // patch capstone
@@ -279,12 +270,12 @@ class SourcePatcher
// call extension patch before make // call extension patch before make
foreach ($builder->getExts(false) as $ext) { foreach ($builder->getExts(false) as $ext) {
if ($ext->patchBeforeMake() === true) { if ($ext->patchBeforeMake() === true) {
logger()->info('Extension [' . $ext->getName() . '] patched before make'); logger()->info("Extension [{$ext->getName()}] patched before make");
} }
} }
foreach ($builder->getLibs() as $lib) { foreach ($builder->getLibs() as $lib) {
if ($lib->patchBeforeMake() === true) { if ($lib->patchBeforeMake() === true) {
logger()->info('Library [' . $lib->getName() . '] patched before make'); logger()->info("Library [{$lib->getName()}] patched before make");
} }
} }
} }