Joomlatools\Console\Application::run PHP Метод

run() публичный Метод

Runs the current application.
public run ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : integer
$input Symfony\Component\Console\Input\InputInterface An Input instance
$output Symfony\Component\Console\Output\OutputInterface An Output instance
Результат integer 0 if everything went fine, or an error code
    public function run(Input\InputInterface $input = null, Output\OutputInterface $output = null)
    {
        if (null === $input) {
            $input = new Input\ArgvInput();
        }
        if (null === $output) {
            $output = new Output\ConsoleOutput();
        }
        $this->_input = $input;
        $this->_output = $output;
        $this->configureIO($this->_input, $this->_output);
        $this->_loadPlugins();
        parent::run($this->_input, $this->_output);
    }

Usage Example

Пример #1
0
 public static function install()
 {
     if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
         return;
     }
     $input = new ArgvInput();
     if ($input->hasParameterOption(array('--no-interaction', '-n'))) {
         return;
     }
     $cwd = getcwd();
     $www = dirname($cwd);
     $site = basename($cwd);
     $arguments = array('site:install', 'site' => $site, '--www' => $www, '--interactive' => true, '--mysql_db_prefix' => '');
     self::logo();
     $output = new ConsoleOutput();
     $output->writeln("<info>Welcome to the Joomla Platform installer!</info>");
     $output->writeln("Fill in the following details to configure your new application.");
     $application = new Application();
     $application->run(new ArrayInput($arguments));
 }
All Usage Examples Of Joomlatools\Console\Application::run