Returns server

@param Symfony\Component\Console\Input\InputInterface   $input
@param Symfony\Component\Console\Output\OutputInterface $output

@return Atipik\Hoa\WebSocketBundle\WebSocket\Runner
434207
public function getRunner(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getContainer();

        // inject output in logger
        $container->get('atipik_hoa_web_socket.logger')->setOutput($output);

        // get runner
        $runner = $container->get('atipik_hoa_web_socket.runner');

        $groups = $input->getOption('group');

        if (!empty($groups)) {
            $runner->setGroups($groups);
        }

        return $runner;
    }
108254
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $name = strtolower($input->getArgument('name'));
    $table = $input->getOption('table');

    $class = implode('', array_map('ucfirst', explode('_', $name)));

    if ($table == null || $table == '') {
      if ($this->add($name, $class)) {
        return $output->writeln('<info>Migration "' . $class . '" has been successfully created.</info>');
      }

      return $output->writeln('Migration "' . $class . '" already exists.');
    }

    if ($this->add($name, $class, $table)) {
      return $output->writeln('<info>Migration "' . $class . '" has been successfully created.</info>');
    }

    return $output->writeln('Migration "' . $class . '" already exists.');
  }
271765
protected function execute(InputInterface $input, OutputInterface $output) {
		if (!file_exists(\Skeleton\Database\Migration\Config::$migration_directory)) {
			$output->writeln('<error>Config::$migration_directory is not set to a valid directory</error>');
			return 1;
		}

		if (isset(\Skeleton\Object\Config::$cache_handler) AND \Skeleton\Object\Config::$cache_handler != '') {
			$output->writeln('Flush cache');
			\Skeleton\Object\Cache::cache_flush();
		}

		$output->writeln('Running migrations');
		$migrations = \Skeleton\Database\Migration\Runner::get_runnable();

		foreach ($migrations as $migration) {
			try {
				$package = $migration->get_skeleton();
				$package = $package->name;
			} catch (\Exception $e) {
				$package = 'project';
			}


			if (preg_match('@\\\\([\w]+)$@', get_class($migration), $matches)) {
				$classname = $matches[1];
			} else {
				$classname = get_class($migration);
			}
			$output->write("\t" . $package . ' / ' . $classname . ' ');
			try {
				$migration->run('up');
				$output->writeln('<info>ok</info>');
			} catch (\Exception $e) {
				$output->writeln('<error>' . $e->getMessage() . '</error>');
				$output->writeln('<comment>' . $e->getTraceAsString() . '</comment>');
				return 1;
			}
		}

		$output->writeln('Database up-to-date' );
		return 0;
	}
589179
protected function getMigrationConfiguration(
        InputInterface $input,
        OutputInterface $output
    ): Configuration {
        if (!$this->configuration) {
            $conn = $this->getDatabaseConnection($input);

            $outputWriter = new OutputWriter(function($message) use ($output) {
                return $output->writeln($message);
            });

            $migrationsConfigFile = $input->getOption('configuration');

            $this->configuration = ConfigurationBuilder::create()
                ->setConnection($conn)
                ->setOutputWriter($outputWriter)
                ->setOnDiskConfiguration($migrationsConfigFile)
                ->build();
        }

        return $this->configuration;
    }
660892
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);
        $this->logger->info('Getting table metadata for database "' . $input->getArgument('database') . '".');
        $tables = $this->getTables($input);
        $outputTable = new Table($output);
        $outputTable
            ->setHeaders(array('Database', 'Rows', 'Size in ' . $input->getOption('unit')));
        foreach ($tables as $name => $table) {
            $outputTable->addRow([$name, $table['rows'], $table['size']]);
        }
        $outputTable->render();
        return 0;
    }
1177371
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->requireConfig();

        $output->writeln('Starting <fg=blue>Magallanes</>');
        $output->writeln('');

        $table = new Table($output);
        $table->setHeaders(['Environment', 'User', 'Branch', 'Hosts']);

        $configuration = $this->runtime->getConfigOption('environments');
        foreach ($configuration as $environment => $config) {
            $row = [$environment];

            $row[] = (isset($config['user']) ? $config['user'] : '-');
            $row[] = (isset($config['branch']) ? $config['branch'] : '-');
            $row[] = (isset($config['hosts']) ? implode(PHP_EOL, $config['hosts']) : '-');

            $table->addRow($row);
        }

        $table->render();

        $output->writeln('');
        $output->writeln('Finished <fg=blue>Magallanes</>');

        return 0;
    }
69594
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);
        $url = $input->getArgument('url');
        $target = $input->getArgument('target');

        $io->title('Update the GeoIP2 database');
        $this->stopwatch->start('update');

        $tmp_zip = sys_get_temp_dir().DIRECTORY_SEPARATOR.basename(parse_url($url, PHP_URL_PATH));
        $tmp_unzip = sys_get_temp_dir().DIRECTORY_SEPARATOR.basename($target);

        $io->comment(sprintf('Beginning download of file: %s', $url));

        $this->fs->copy($url, $tmp_zip, true);

        $io->comment('Download complete');
        $io->comment('De-compressing file');

        $this->fs->mkdir(dirname($target), 0777);
        $this->compressor->uncompress($tmp_zip, $tmp_unzip);

        $io->comment('Decompression complete');

        $this->fs->copy($tmp_unzip, $target, true);
        $this->fs->chmod($target, 0777);
        $this->fs->remove([$tmp_zip, $tmp_unzip]);

        $io->success('Finished downloading');

        $this->stopwatch($io, $this->stopwatch->stop('update'));

        return 0;
    }
1341932
public function run(InputInterface $input = null, OutputInterface $output = null)
    {
        $this->boot();

        return $this->container['console']->run($input, $output);
    }
708171
public function daemon(InputInterface $input, OutputInterface $output)
    {
        // Init services
        $container = $this->getContainer();

        if (is_null($this->dispatcher) && $container->has('event_dispatcher')) {
            $this->dispatcher = $this->getContainer()->get('event_dispatcher');
        }

        $this->loop = $container->get('m6_daemon_bundle.event_loop');

        // Last configuration
        $this->configureEvents();

        // Options
        $this->setShutdownOnException($input->hasOption('shutdown-on-exception') ? $input->getOption('shutdown-on-exception') : false);
        $this->setMemoryMax($input->hasOption('memory-max') ? $input->getOption('memory-max') : -1);
        $this->setShowExceptions($input->hasOption('show-exceptions') ? $input->getOption('show-exceptions') : false);

        if ($input->hasOption('run-once') && (bool) $input->getOption('run-once')) {
            $this->setLoopMax(1);
        } else {
            if ($input->hasOption('run-max')) {
                $this->setLoopMax($input->getOption('run-max'));
            }
        }

        // Ok starting...
        $this->dispatchEvent(DaemonEvents::DAEMON_START);

        // Setup
        $this->setup($input, $output);

        // General loop
        $this->dispatchEvent(DaemonEvents::DAEMON_LOOP_BEGIN);

        // First tick
        $this->loop->futureTick(function () use ($input, $output) {
            $this->loop($input, $output);
        });

        // Go !
        $this->loop->run();

        $this->dispatchEvent(DaemonEvents::DAEMON_LOOP_END);

        // Prepare for shutdown
        $this->tearDown($input, $output);
        $this->dispatchEvent(DaemonEvents::DAEMON_STOP);

        return $this->returnCode;
    }
1071262
public function createTable(InputInterface $input, OutputInterface $output)
    {
        $databse = $this->getApplication()->find('create:table');
        $databse_arguments = array(
            'command'   => 'create:table',
            'table'     => $input->getArgument('table'),
            'column'    => $input->getArgument('column')
        );
        $input_db   = new ArrayInput($databse_arguments);
        $return_db  = $databse->run($input_db,$output);
        return $output->writeln($return_db);
    }
873502
protected function serve(InputInterface $input, OutputInterface $output)
    {
        $port = $this->port($input);
        $continue = true;
        do {
            if ($this->check_port($port)) {
                $this->output->writeln('<info>Running php artisan serve --port='.$port.'</info>');
                exec('php artisan serve --port='.$port.' > /dev/null 2>&1 &');
                sleep(1);
                if (file_exists('/usr/bin/sensible-browser')) {
                    $this->output->writeln('<info>Opening http://localhost:'.$port.' with default browser</info>');
                    passthru('/usr/bin/sensible-browser http://localhost:'.$port);
                }
                $continue = false;
            }
            ++$port;
        } while ($continue);
    }
370118
public function run(InputInterface $input, OutputInterface $output): int
    {
        $command = (string) $input;
        $command = strtr($command, [
            ' -name' => ' -N',
            ' -type' => ' -T',
            ' -maxdepth' => ' -M',
            ' -delete' => ' -d true',
        ]);

        return parent::run(new StringInput($command), $output);
    }
356952
public function run(InputInterface $input, OutputInterface $output)
    {
        $this->isFinishedCleanly = false;
        if ($mutexFile = $this->getMutexFile()) {
            $self = $this;
            $result = null;

            $mutex = new Mutex($mutexFile, false);
            $isLockAcquired = false;
            $mutex->run(
                function () use ($self, $input, $output, &$result) {
                    return $self->doParentRun($input, $output);
                },
                $isLockAcquired
            );
            if (!$isLockAcquired && $this->logger) {
                $this->logger->addWarning("Mutex failed in " . get_class($this) . ", job was not run");
            }
        } else {
            $result = $this->doParentRun($input, $output);
        }
        $this->cleanup();
        return $result;
    }
1338476
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $start = microtime(true);
        $style = new SymfonyStyle($input, $output);
        $style->setDecorated(true);
        $style->title($this->description);

        $util = new Util();
        $cbf = $util->checkBinary('phpcbf');
        $output->writeln($util->checkVersion($cbf));
        $source = $util->checkSource($input);
        if ($input->getOption('diff')) {
            $source = $util->getDiffSource();
        }

        if (empty($source)) {
            $output->writeln('<error>No files found</>');
            $style->newLine();

            return 1;
        }

        $cmd = $cbf.' --standard='.$input->getOption('standard').' '.$source;
        $output->writeln('<info>Command: '.$cmd.'</>');
        $style->newLine();
        $process = new Process($cmd);
        $exitCode = $process->setTimeout(3600)->run();

        $changes = true;
        if (strpos($process->getOutput(), 'No fixable errors were found') !== false) {
            $changes = false;
            $output->writeln('<info>No changes</>');
            $style->newLine();

            return 0;
        }

        $changed = $util->getDiffSource();
        if ($changes && !empty($changed)) {
            $output->writeln(str_replace(' ', PHP_EOL, $changed));
            $sources = explode(' ', $changed);
            $style->newLine();

            foreach ($sources as $source) {
                $git = 'git -c color.ui=always';
                $options = '--compaction-heuristic -U0 --patch --minimal --patience';
                $process = new Process($git.' diff '.$options.' '.$source);
                $process->run();
                $output->writeln($process->getOutput());
            }
        }

        $end = microtime(true);
        $time = round($end - $start);

        $style->section('Results');
        $output->writeln('<info>Time: '.$time.' seconds</>');
        $style->newLine();

        return $exitCode;
    }
850737
protected function execute(InputInterface $input, OutputInterface $output)
    {
        return $this->getRunner($input, $output)->run() ? 0 : -1;
    }
652896
protected function execute(InputInterface $input, OutputInterface $output)
  {
    if(empty($this->host))
    {
      if($this->cubexLocalSubDomain)
      {
        $this->host = $this->cubexLocalSubDomain . '.cubex-local.com';
      }
      else
      {
        $this->host = $this->debug ? '0.0.0.0' : 'localhost';
      }
    }

    if($this->port === null)
    {
      $this->port = 8888;
      $this->useNextAvailablePort = true;
    }

    if($this->useNextAvailablePort)
    {
      for($i = 0; $i < 100; $i++)
      {
        if($this->_isPortAvailable($this->port))
        {
          break;
        }
        $this->port++;
      }
    }

    if(ValueAs::bool($this->showfig))
    {
      $output->write(Figlet::create('PHP WEB', 'ivrit'));
      $output->write(Figlet::create('SERVER', 'ivrit'));
    }

    return $this->_runCommand($this->_buildCommand($output));
  }
1225865
public function doRun(InputInterface $input, OutputInterface $output)
    {

        $ioFactory = ConsoleIOFactory::buildDefault($input, $output, $this->getHelperSet());
        $this->io = $ioFactory->get();

        return parent::doRun($input, $output);
    }