for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Samurai\Module;
use Samurai\Command\Command;
use Samurai\Module\Task\Factory\ModuleManagementTaskFactory;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Class ModuleCommand
* @package Samurai\Module
* @author Raphaël Lefebvre <[email protected]>
*/
class ModuleCommand extends Command
{
* @var array
public static $actions = [
'install',
'update',
'rm',
'list',
'enable',
'disable',
'run'
];
*
protected function configure()
$this
->setName('module')
->setDescription('Handles Samurai modules')
->addArgument(
'action',
InputArgument::OPTIONAL,
'sub-command: ' . json_encode(self::$actions)
)
'name',
'module name'
'package',
'package name'
'version',
'package version'
'description',
'bootstrap description'
'source',
'bootstrap source'
->setHelp('See the documentation for more info: https://github.com/Raphhh/samurai');
}
* @param InputInterface $input
* @param OutputInterface $output
* @return void
protected function execute(InputInterface $input, OutputInterface $output)
$this->getTask($input)->execute($input, $output);
$this->getService('module_manager')->flush();
* @return \Samurai\Task\ITask
private function getTask(InputInterface $input)
return ModuleManagementTaskFactory::create($input, $this->getServices());