Fix php74 upx bug (#450)

* fix php74 cannot compile with no-strip or with-upx-pack (including lint some code)

* use captainhook installer instead of plugin composer

* use captainhook installer instead of plugin composer

* add [no build test] flag

* update actions/cache version [no build test]

* test update actions/cache version

* test update actions/cache version

* test update actions/cache version
This commit is contained in:
Jerry Ma
2024-05-16 10:51:31 +08:00
committed by GitHub
parent 1632c25223
commit 3e84becf77
17 changed files with 1349 additions and 646 deletions

View File

@@ -132,4 +132,14 @@ abstract class BaseCommand extends Command
{
return true;
}
protected function logWithResult(bool $result, string $success_msg, string $fail_msg): int
{
if ($result) {
logger()->info($success_msg);
return static::SUCCESS;
}
logger()->error($fail_msg);
return static::FAILURE;
}
}

View File

@@ -17,7 +17,7 @@ use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use ZM\Logger\ConsoleColor;
#[AsCommand('build', 'build PHP')]
#[AsCommand('build', 'build PHP', ['build:php'])]
class BuildCliCommand extends BuildCommand
{
public function configure(): void

View File

@@ -61,6 +61,8 @@ class BuildLibsCommand extends BuildCommand
$builder->setLibsOnly();
// 编译和检查库完整
$libraries = DependencyUtil::getLibs($libraries);
logger()->info('Building libraries: ' . implode(',', $libraries));
sleep(2);
$builder->buildLibs($libraries);
$time = round(microtime(true) - START_TIME, 3);

View File

@@ -57,8 +57,11 @@ class DumpLicenseCommand extends BaseCommand
$libraries = DependencyUtil::getLibs($libraries);
$dumper->addLibs($libraries);
$dumper->dump($this->getOption('dump-dir'));
$this->output->writeln('Dump target dir: ' . $this->getOption('dump-dir'));
return static::SUCCESS;
return $this->logWithResult(
$dumper->dump($this->getOption('dump-dir')),
'Dump target dir: ' . $this->getOption('dump-dir'),
'Dump failed!'
);
}
if ($this->getOption('for-sources') !== null) {
$sources = array_map('trim', array_filter(explode(',', $this->getOption('for-sources'))));