Deployer\Deployer::addConsoleCommands PHP Method

addConsoleCommands() public method

Transform tasks to console commands.
public addConsoleCommands ( )
    public function addConsoleCommands()
    {
        $this->getConsole()->addUserArgumentsAndOptions();
        foreach ($this->tasks as $name => $task) {
            if ($task->isPrivate()) {
                continue;
            }
            $this->getConsole()->add(new TaskCommand($name, $task->getDescription(), $this));
        }
    }

Usage Example

Esempio n. 1
0
 public function setUp()
 {
     // Create App tester.
     $console = new Application();
     $console->setAutoExit(false);
     $console->setCatchExceptions(false);
     $this->tester = new ApplicationTester($console);
     // Prepare Deployer
     $input = $this->getMock('Symfony\\Component\\Console\\Input\\InputInterface');
     $output = $this->getMock('Symfony\\Component\\Console\\Output\\OutputInterface');
     $this->deployer = new Deployer($console, $input, $output);
     // Load recipe
     $this->setUpServer();
     $this->loadRecipe();
     // Init Deployer
     $this->deployer->addConsoleCommands();
 }