protected function runOtherCommand($name, array $arguments = [], OutputInterface $output = null)
    {
        /** @var \Platformsh\Cli\Application $application */
        $application = $this->getApplication();
        $command = $application->find($name);

        // Pass on interactivity arguments to the other command.
        if (isset($this->input)) {
            $arguments += [
                '--yes' => $this->input->getOption('yes'),
                '--no' => $this->input->getOption('no'),
            ];
        }

        $cmdInput = new ArrayInput(['command' => $name] + $arguments);
        if (!empty($arguments['--yes']) || !empty($arguments['--no'])) {
            $cmdInput->setInteractive(false);
        } elseif (isset($this->input)) {
            $cmdInput->setInteractive($this->input->isInteractive());
        }

        $this->debug('Running command: ' . $name);

        // Give the other command an entirely new service container, because the
        // "input" and "output" parameters, and all their dependents, need to
        // change.
        $container = self::$container;
        self::$container = null;

        $application->setCurrentCommand($command);
        $result = $command->run($cmdInput, $output ?: $this->output);
        $application->setCurrentCommand($this);

        // Restore the old service container.
        self::$container = $container;

        return $result;
    }
protected function runOtherCommand($name, array $arguments = [], OutputInterface $output = null)
    {
        /** @var \Platformsh\Cli\Application $application */
        $application = $this->getApplication();
        $command = $application->find($name);

        // Pass on interactivity arguments to the other command.
        if (isset($this->input)) {
            $arguments += [
                '--yes' => $this->input->getOption('yes'),
                '--no' => $this->input->getOption('no'),
            ];
        }

        $cmdInput = new ArrayInput(['command' => $name] + $arguments);
        if (!empty($arguments['--yes']) || !empty($arguments['--no'])) {
            $cmdInput->setInteractive(false);
        } elseif (isset($this->input)) {
            $cmdInput->setInteractive($this->input->isInteractive());
        }

        $this->debug('Running command: ' . $name);

        // Give the other command an entirely new service container, because the
        // "input" and "output" parameters, and all their dependents, need to
        // change.
        $container = self::$container;
        self::$container = null;

        $application->setCurrentCommand($command);
        $result = $command->run($cmdInput, $output ?: $this->output);
        $application->setCurrentCommand($this);

        // Restore the old service container.
        self::$container = $container;

        return $result;
    }
protected function runOtherCommand ( $ name , array $ arguments = [ ] , OutputInterface $ output = null ) { /** @var \Platformsh\Cli\Application $application */ $ application = $ this -> getApplication ( ) ; $ command = $ application -> find ( $ name ) ; // Pass on interactivity arguments to the other command. if ( isset ( $ this -> input ) ) { $ arguments += [ '--yes' => $ this -> input -> getOption ( 'yes' ) , '--no' => $ this -> input -> getOption ( 'no' ) , ] ; } $ cmdInput = new ArrayInput ( [ 'command' => $ name ] + $ arguments ) ; if ( ! empty ( $ arguments [ '--yes' ] ) || ! empty ( $ arguments [ '--no' ] ) ) { $ cmdInput -> setInteractive ( false ) ; } elseif ( isset ( $ this -> input ) ) { $ cmdInput -> setInteractive ( $ this -> input -> isInteractive ( ) ) ; } $ this -> debug ( 'Running command: ' . $ name ) ; // Give the other command an entirely new service container, because the // "input" and "output" parameters, and all their dependents, need to // change. $ container = self :: $ container ; self :: $ container = null ; $ application -> setCurrentCommand ( $ command ) ; $ result = $ command -> run ( $ cmdInput , $ output ? : $ this -> output ) ; $ application -> setCurrentCommand ( $ this ) ; // Restore the old service container. self :: $ container = $ container ; return $ result ; }
Run another CLI command.

@param string         $name
The name of the other command.
@param array          $arguments
Arguments for the other command.
@param OutputInterface $output
The output for the other command. Defaults to the current output.

@return int
Run another CLI command .