mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 14:55:39 +08:00
Add custom Windows micro logo support (#358)
* add custom windows micro logo option `--with-micro-logo` * bump version 2.1.2
This commit is contained in:
@@ -39,6 +39,10 @@ class BuildCliCommand extends BuildCommand
|
||||
$this->addOption('without-micro-ext-test', null, null, 'Disable phpmicro with extension test code');
|
||||
|
||||
$this->addOption('with-upx-pack', null, null, 'Compress / pack binary using UPX tool (linux/windows only)');
|
||||
|
||||
if (PHP_OS_FAMILY === 'Windows') {
|
||||
$this->addOption('with-micro-logo', null, InputOption::VALUE_REQUIRED, 'Use custom .ico for micro.sfx');
|
||||
}
|
||||
}
|
||||
|
||||
public function handle(): int
|
||||
@@ -63,6 +67,14 @@ class BuildCliCommand extends BuildCommand
|
||||
if ($rule === BUILD_TARGET_ALL) {
|
||||
logger()->warning('--build-all option makes `--no-strip` always true, be aware!');
|
||||
}
|
||||
if (($rule & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO && $this->getOption('with-micro-logo')) {
|
||||
$logo = $this->getOption('with-micro-logo');
|
||||
if (!file_exists($logo)) {
|
||||
logger()->error('Logo file ' . $logo . ' not exist !');
|
||||
return static::FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
// Check upx
|
||||
$suffix = PHP_OS_FAMILY === 'Windows' ? '.exe' : '';
|
||||
if ($this->getOption('with-upx-pack')) {
|
||||
|
||||
Reference in New Issue
Block a user