Skip to content

Commit 58d9797

Browse files
committed
suggestion
1 parent 2abbb75 commit 58d9797

File tree

4 files changed

+14
-21
lines changed

4 files changed

+14
-21
lines changed

src/SPC/builder/Extension.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function patchBeforeMake(): bool
193193
* If you need to patch some code, overwrite this
194194
* return true if you patched something, false if not
195195
*/
196-
public function patchBeforeSharedBuild(): bool
196+
public function patchBeforeSharedPhpize(): bool
197197
{
198198
return false;
199199
}
@@ -394,13 +394,17 @@ public function buildUnixShared(): void
394394
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
395395
];
396396

397+
if ($this->patchBeforeSharedPhpize()) {
398+
logger()->info("Extension [{$this->getName()}] patched before shared phpize");
399+
}
400+
397401
// prepare configure args
398402
shell()->cd($this->source_dir)
399403
->setEnv($env)
400404
->exec(BUILD_BIN_PATH . '/phpize');
401405

402406
if ($this->patchBeforeSharedConfigure()) {
403-
logger()->info('ext [' . $this->getName() . '] patching before shared configure');
407+
logger()->info("Extension [{$this->getName()}] patched before shared configure");
404408
}
405409

406410
shell()->cd($this->source_dir)
@@ -419,7 +423,7 @@ public function buildUnixShared(): void
419423
);
420424

421425
if ($this->patchBeforeSharedMake()) {
422-
logger()->info('ext [' . $this->getName() . '] patching before shared make');
426+
logger()->info("Extension [{$this->getName()}] patched before shared make");
423427
}
424428

425429
shell()->cd($this->source_dir)

src/SPC/builder/extension/intl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function patchBeforeBuildconf(): bool
2222
return true;
2323
}
2424

25-
public function patchBeforeSharedBuild(): bool
25+
public function patchBeforeSharedPhpize(): bool
2626
{
2727
return $this->patchBeforeBuildconf();
2828
}

src/SPC/command/BuildPHPCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ public function handle(): int
207207
// start to build
208208
$builder->buildPHP($rule);
209209

210-
SourcePatcher::patchBeforeSharedBuild($builder);
211-
212210
// build dynamic extensions if needed
213211
if (!empty($shared_extensions)) {
214212
logger()->info('Building shared extensions ...');

src/SPC/store/SourcePatcher.php

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ public static function patchBeforeBuildconf(BuilderBase $builder): void
4646
{
4747
foreach ($builder->getExts() as $ext) {
4848
if ($ext->patchBeforeBuildconf() === true) {
49-
logger()->info('Extension [' . $ext->getName() . '] patched before buildconf');
49+
logger()->info("Extension [{$ext->getName()}] patched before buildconf");
5050
}
5151
}
5252
foreach ($builder->getLibs() as $lib) {
5353
if ($lib->patchBeforeBuildconf() === true) {
54-
logger()->info('Library [' . $lib->getName() . '] patched before buildconf');
54+
logger()->info("Library [{$lib->getName()}]patched before buildconf");
5555
}
5656
}
5757
// patch windows php 8.1 bug
@@ -79,15 +79,6 @@ public static function patchBeforeBuildconf(BuilderBase $builder): void
7979
}
8080
}
8181

82-
public static function patchBeforeSharedBuild(BuilderBase $builder): void
83-
{
84-
foreach ($builder->getExts() as $ext) {
85-
if ($ext->patchBeforeSharedBuild() === true) {
86-
logger()->info('Extension [' . $ext->getName() . '] patched before shared build');
87-
}
88-
}
89-
}
90-
9182
/**
9283
* Source patcher runner before configure
9384
*
@@ -98,12 +89,12 @@ public static function patchBeforeConfigure(BuilderBase $builder): void
9889
{
9990
foreach ($builder->getExts() as $ext) {
10091
if ($ext->patchBeforeConfigure() === true) {
101-
logger()->info('Extension [' . $ext->getName() . '] patched before configure');
92+
logger()->info("Extension [{$ext->getName()}] patched before configure");
10293
}
10394
}
10495
foreach ($builder->getLibs() as $lib) {
10596
if ($lib->patchBeforeConfigure() === true) {
106-
logger()->info('Library [' . $lib->getName() . '] patched before configure');
97+
logger()->info("Library [{$lib->getName()}] patched before configure");
10798
}
10899
}
109100
// patch capstone
@@ -279,12 +270,12 @@ public static function patchBeforeMake(BuilderBase $builder): void
279270
// call extension patch before make
280271
foreach ($builder->getExts(false) as $ext) {
281272
if ($ext->patchBeforeMake() === true) {
282-
logger()->info('Extension [' . $ext->getName() . '] patched before make');
273+
logger()->info("Extension [{$ext->getName()}] patched before make");
283274
}
284275
}
285276
foreach ($builder->getLibs() as $lib) {
286277
if ($lib->patchBeforeMake() === true) {
287-
logger()->info('Library [' . $lib->getName() . '] patched before make');
278+
logger()->info("Library [{$lib->getName()}] patched before make");
288279
}
289280
}
290281
}

0 commit comments

Comments
 (0)