addArgument('extension', InputArgument::REQUIRED, 'The library name');
}
public function initialize(InputInterface $input, OutputInterface $output): void
{
$this->no_motd = true;
parent::initialize($input, $output);
}
public function handle(): int
{
// Get lib object
$builder = BuilderProvider::makeBuilderByInput($this->input);
$ext_conf = Config::getExt($this->getArgument('extension'));
$builder->proveExts([$this->getArgument('extension')], true);
// Check whether lib is extracted
// if (!is_dir(SOURCE_PATH . '/' . $this->getArgument('library'))) {
// $this->output->writeln("Library {$this->getArgument('library')} is not extracted");
// return static::FAILURE;
// }
$version = $builder->getExt($this->getArgument('extension'))->getExtVersion();
if ($version === null) {
$this->output->writeln("Failed to get version of extension {$this->getArgument('extension')}");
return static::FAILURE;
}
$this->output->writeln("{$version}");
return static::SUCCESS;
}
}