mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
simplify deployBinary a little bit
This commit is contained in:
parent
8e4d4b7be5
commit
23c0d6f4aa
@ -128,9 +128,6 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
{
|
{
|
||||||
logger()->debug('Deploying binary from ' . $src . ' to ' . $dst);
|
logger()->debug('Deploying binary from ' . $src . ' to ' . $dst);
|
||||||
|
|
||||||
// UPX for linux
|
|
||||||
$upx_option = (bool) $this->getOption('with-upx-pack', false);
|
|
||||||
|
|
||||||
// file must exists
|
// file must exists
|
||||||
if (!file_exists($src)) {
|
if (!file_exists($src)) {
|
||||||
throw new SPCInternalException("Deploy failed. Cannot find file: {$src}");
|
throw new SPCInternalException("Deploy failed. Cannot find file: {$src}");
|
||||||
@ -152,13 +149,14 @@ abstract class UnixBuilderBase extends BuilderBase
|
|||||||
$this->extractDebugInfo($dst);
|
$this->extractDebugInfo($dst);
|
||||||
|
|
||||||
// strip
|
// strip
|
||||||
if (!$this->getOption('no-strip', false)) {
|
if (!$this->getOption('no-strip')) {
|
||||||
$this->stripBinary($dst);
|
$this->stripBinary($dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compress binary with UPX if needed (only for Linux)
|
// UPX for linux
|
||||||
|
$upx_option = $this->getOption('with-upx-pack');
|
||||||
if ($upx_option && PHP_OS_FAMILY === 'Linux' && $executable) {
|
if ($upx_option && PHP_OS_FAMILY === 'Linux' && $executable) {
|
||||||
if ($this->getOption('no-strip', false)) {
|
if ($this->getOption('no-strip')) {
|
||||||
logger()->warning('UPX compression is not recommended when --no-strip is enabled.');
|
logger()->warning('UPX compression is not recommended when --no-strip is enabled.');
|
||||||
}
|
}
|
||||||
logger()->info("Compressing {$dst} with UPX");
|
logger()->info("Compressing {$dst} with UPX");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user