for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of RoboSystemService.
*
* @author Aitor García Martínez (Falc) <[email protected]>
* @copyright 2015 Aitor García Martínez (Falc) <[email protected]>
* @author Polyvaniy Oleksii (alexndlm) <[email protected]>
* @copyright 2016 Polyvaniy Oleksii (alexndlm) <[email protected]>
* @license MIT
*/
namespace Falc\Robo\Service;
use Robo\Contract\CommandInterface;
* Service start
* ``` php
* // Starting a service:
* $this->taskServiceStart()
* ->serviceManager('systemd')
* ->service('httpd')
* ->run();
* // Compact form:
* $this->taskServiceStart('systemd', 'httpd')->run();
* ```
class Start extends BaseTask implements CommandInterface
{
* {@inheritdoc}
* @throws \Exception
public function getCommand()
if ($this->builder === null) {
throw new \InvalidArgumentException('Service manager not defined');
}
$this->builder->start($this->service);
if (!$this->verbose) {
$this->builder->quiet();
return $this->builder->getCommand();
public function run()
$command = $this->getCommand();
$this->printTaskInfo('Starting service...');
return $this->executeCommand($command);