for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* CRM library
* @author Tao <[email protected]>
*/
namespace Slince\Crm\Command;
use Slince\Crm\ConfigPath;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class AddCommand extends Command
{
* Command name
* @var string
const NAME = 'add';
* {@inheritdoc}
public function configure()
$this->setName(static::NAME)
->setDescription('Add one custom registry')
->addArgument('registry-name', InputArgument::REQUIRED, 'The registry name')
->addArgument('registry-url', InputArgument::REQUIRED, 'The registry url');
}
public function execute(InputInterface $input, OutputInterface $output)
$registryName = $input->getArgument('registry-name');
$registryUrl = $input->getArgument('registry-url');
//Add registry & dump to config file
$this->getManager()->addRegistry($registryName, $registryUrl);
$this->getManager()->dumpRepositoriesToFile(ConfigPath::getUserConfigFile());
$output->writeln("<info>Add registry [{$registryName}] success</info>");