From 86ce7e9d25dee0988a83c3cd735a5802ea48bc3c Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Sun, 29 Oct 2023 00:48:30 +0200 Subject: [PATCH] rename --by-extensions to --for-extensions --without-suggests to --without-suggestions --- README-zh.md | 2 +- README.md | 2 +- src/SPC/command/DownloadCommand.php | 12 ++++++------ src/SPC/command/DumpLicenseCommand.php | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README-zh.md b/README-zh.md index ab86733b..94f79ce7 100755 --- a/README-zh.md +++ b/README-zh.md @@ -126,7 +126,7 @@ chmod +x bin/spc # 拉取所有依赖库 ./bin/spc fetch --all # 只拉取编译指定扩展需要的所有依赖 -./bin/spc download --by-extensions=openssl,pcntl,mbstring,pdo_sqlite +./bin/spc download --for-extensions=openssl,pcntl,mbstring,pdo_sqlite # 构建包含 bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl 扩展的 php-cli 和 micro.sfx ./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-cli --build-micro ``` diff --git a/README.md b/README.md index 8e75ff1f..d89d48f3 100755 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ Basic usage for building php and micro with some extensions: # fetch all libraries ./bin/spc download --all # only fetch necessary sources by needed extensions -./bin/spc download --by-extensions=openssl,pcntl,mbstring,pdo_sqlite +./bin/spc download --for-extensions=openssl,pcntl,mbstring,pdo_sqlite # with bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl extension, build both CLI and phpmicro SAPI ./bin/spc build bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl --build-cli --build-micro ``` diff --git a/src/SPC/command/DownloadCommand.php b/src/SPC/command/DownloadCommand.php index dfad36fe..435bcf00 100644 --- a/src/SPC/command/DownloadCommand.php +++ b/src/SPC/command/DownloadCommand.php @@ -35,8 +35,8 @@ class DownloadCommand extends BaseCommand $this->addOption('all', 'A', null, 'Fetch all sources that static-php-cli needed'); $this->addOption('custom-url', 'U', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Specify custom source download url, e.g "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"'); $this->addOption('from-zip', 'Z', InputOption::VALUE_REQUIRED, 'Fetch from zip archive'); - $this->addOption('by-extensions', 'e', InputOption::VALUE_REQUIRED, 'Fetch by extensions, e.g "openssl,mbstring"'); - $this->addOption('without-suggests', null, null, 'Do not fetch suggested sources when using --by-extensions'); + $this->addOption('for-extensions', 'e', InputOption::VALUE_REQUIRED, 'Fetch by extensions, e.g "openssl,mbstring"'); + $this->addOption('without-suggestions', null, null, 'Do not fetch suggested sources when using --for-extensions'); } public function initialize(InputInterface $input, OutputInterface $output): void @@ -45,7 +45,7 @@ class DownloadCommand extends BaseCommand $input->getOption('all') || $input->getOption('clean') || $input->getOption('from-zip') - || $input->getOption('by-extensions') + || $input->getOption('for-extensions') ) { $input->setArgument('sources', ''); } @@ -108,10 +108,10 @@ class DownloadCommand extends BaseCommand Config::$source['openssl']['regex'] = '/href="(?openssl-(?1.[^"]+)\.tar\.gz)\"/'; } - // --by-extensions - if ($by_ext = $this->getOption('by-extensions')) { + // --for-extensions + if ($by_ext = $this->getOption('for-extensions')) { $ext = array_map('trim', array_filter(explode(',', $by_ext))); - $sources = $this->calculateSourcesByExt($ext, !$this->getOption('without-suggests')); + $sources = $this->calculateSourcesByExt($ext, !$this->getOption('without-suggestions')); array_unshift($sources, 'php-src', 'micro', 'pkg-config'); } else { // get source list that will be downloaded diff --git a/src/SPC/command/DumpLicenseCommand.php b/src/SPC/command/DumpLicenseCommand.php index 98b5a4fe..5535f820 100644 --- a/src/SPC/command/DumpLicenseCommand.php +++ b/src/SPC/command/DumpLicenseCommand.php @@ -20,7 +20,7 @@ class DumpLicenseCommand extends BaseCommand { public function configure(): void { - $this->addOption('by-extensions', null, InputOption::VALUE_REQUIRED, 'Dump by extensions and related libraries', null); + $this->addOption('for-extensions', null, InputOption::VALUE_REQUIRED, 'Dump by extensions and related libraries', null); $this->addOption('without-php', null, InputOption::VALUE_NONE, 'Dump without php-src'); $this->addOption('by-libs', null, InputOption::VALUE_REQUIRED, 'Dump by libraries', null); $this->addOption('by-sources', null, InputOption::VALUE_REQUIRED, 'Dump by original sources (source.json)', null); @@ -35,9 +35,9 @@ class DumpLicenseCommand extends BaseCommand public function handle(): int { $dumper = new LicenseDumper(); - if ($this->getOption('by-extensions') !== null) { + if ($this->getOption('for-extensions') !== null) { // 从参数中获取要编译的 extensions,并转换为数组 - $extensions = array_map('trim', array_filter(explode(',', $this->getOption('by-extensions')))); + $extensions = array_map('trim', array_filter(explode(',', $this->getOption('for-extensions')))); // 根据提供的扩展列表获取依赖库列表并编译 [$extensions, $libraries] = DependencyUtil::getExtLibsByDeps($extensions); $dumper->addExts($extensions); @@ -67,7 +67,7 @@ class DumpLicenseCommand extends BaseCommand $this->output->writeln('Dump target dir: ' . $this->getOption('dump-dir')); return static::SUCCESS; } - $this->output->writeln('You must use one of "--by-extensions=", "--by-libs=", "--by-sources=" to dump'); + $this->output->writeln('You must use one of "--for-extensions=", "--by-libs=", "--by-sources=" to dump'); return static::FAILURE; } }