mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
30 lines
770 B
PHP
30 lines
770 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace StaticPHP\Command;
|
||
|
|
|
||
|
|
use Symfony\Component\Console\Attribute\AsCommand;
|
||
|
|
use Symfony\Component\Console\Input\InputArgument;
|
||
|
|
|
||
|
|
#[AsCommand('build:libs')]
|
||
|
|
class BuildLibsCommand extends BaseCommand
|
||
|
|
{
|
||
|
|
public function configure()
|
||
|
|
{
|
||
|
|
$this->addArgument('libraries', InputArgument::REQUIRED, 'The library packages will be compiled, comma separated');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function handle(): int
|
||
|
|
{
|
||
|
|
$libs = parse_comma_list($this->input->getArgument('libraries'));
|
||
|
|
|
||
|
|
$installer = new \StaticPHP\Package\PackageInstaller($this->input->getOptions());
|
||
|
|
foreach ($libs as $lib) {
|
||
|
|
$installer->addBuildPackage($lib);
|
||
|
|
}
|
||
|
|
$installer->run();
|
||
|
|
return static::SUCCESS;
|
||
|
|
}
|
||
|
|
}
|