Get a ProcessBuilder instance

@param OutputInterface $output
@param string $address

@return ProcessBuilder
960168
private function createPhpProcessBuilder(OutputInterface $output, $address)
    {
        $router = realpath(__DIR__ . '/../../Resources/bin/router.php');
        $finder = new PhpExecutableFinder();

        if (false === $binary = $finder->find()) {
            $output->writeln('<error>Unable to find PHP binary to run server</error>');

            return;
        }

        return new ProcessBuilder([$binary, '-S', $address, $router]);
    }
1223252
protected function initializeExecute(OutputInterface $output, ProcessHelper $helper)
    {
        $this->execute = $this->execute ?: new Execute($output, $helper);
    }
658825
public function getProcessor(CommandInterface $command)
    {
        $className = get_class($command);
        try {
            return parent::getProcessor($command);
        } catch (ProcessorNotFoundException $ex) {
            if (!array_key_exists($className, $this->serviceIds)) {
                throw new InvalidArgumentException('No processor registered for given type: '.$className.'.', 500, $ex);
            }
            $this->registerProcessorForCommand($className, $this->container->get($this->serviceIds[$className]));
        }

        return parent::getProcessor($command);
    }
153146
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $method = method_exists($this, 'process') ? 'process' : 'handle';

        return $this->{$method}();
    }
657219
public function geolocateIPAddress(AddressInterface $address)
    {
        $result = new GeolocationResult();
        try {
            switch ($address->getRangeType()) {
                case IPRangeType::T_PUBLIC:
                    $addressString = (string) $address;
                    $session = $this->app->make('session');
                    $sessionKey = 'ccm/geolocation/' . $this->geolocator->getGeolocatorHandle() . '/' . $this->geolocator->getGeolocatorID() . '/' . md5(serialize($this->geolocator->getGeolocatorConfiguration())) . '/' . $addressString;
                    if ($session->has($sessionKey)) {
                        $result = $session->get($sessionKey);
                    } else {
                        $result = $this->performGeolocation($address);
                        $session->set($sessionKey, $result);
                    }
                    break;
                default:
                    $result->setError(GeolocationResult::ERR_IPNOTPUBLIC);
                    break;
            }
        } catch (Exception $x) {
            $result->setError(GeolocationResult::ERR_OTHER, '', $x);
        } catch (Throwable $x) {
            $result->setError(GeolocationResult::ERR_OTHER, '', new Exception($x->getMessage(), $x->getCode()));
        }

        return $result;
    }
866114
public function pipe(ExecutableInterface $process, $_ = null)
    {
        foreach (func_get_args() as $index => $process) {
            if ($process instanceof ExecutableInterface) {
                $this->processes[] = $process;
            } else {
                $message = 'Argument ' . $index . ' passed to ' . __METHOD__ .
                    '() must implement interface ' .
                    'Net\Bazzline\Component\ProcessPipe\ExecutableInterface' .
                    ', instance of ' . get_class($process) . ' given';
                throw new InvalidArgumentException($message);
            }
        }

        return $this;
    }
1103850
public function build(ProcessorInterface $processor = null): PipelineInterface
    {
        try {
            $config = [
                'stages' => $this->stages
            ];

            if ($processor !== null) {
                $config['processor'] = $processor;
            }
            return $this->createPipeline(
                $this->prepareConfig($config)
            );
        } catch (\Exception $e) {
            throw new InvalidArgumentException($e->getMessage());
        }
    }
180460
protected function clearSymfonyCache(OutputInterface $output)
    {
        $command   = $this->getApplication()->find('cache:clear');
        $arguments = [
            'command' => 'cache:clear',
        ];

        return $command->run(new ArrayInput($arguments), $output) === 0;
    }
247122
public function connect($address)
    {
        $factory = new Factory($this->eventLoop);

        return $factory->createClient($address)
            ->then(function (Client $client) {
                $this->amiClient = $client;
                $this->actionSender = new ActionSender($client);
                $this->actionSender->events(true);
                $client->on('close', function () {
                    $this->logger->debug('AMI connection closed');
                });
                $client->on('event', function (Event $event) {
                    $this->wsClient->emit($event->getName(), (array)$event);
                });
            }, function (\Exception $e) {
                $this->logger->err('Connection error: '.$e->getMessage());
            });
    }
922153
public static Builder newConvertBuilder(String input, String output) {
		return new Builder(input, output, TaskGroupActivity.CONVERT);
	}
435391
protected function execute(InputInterface $input, OutputInterface $output)
    {	
    	$post = new PostBuilder(
            $this->filesystem,
            $input->getArgument('title'),
            $input->getOption('m')
        );

        $post->build();

        $output->writeln(

            sprintf("<info>Post \"%s\" was generated successfully.</info>", $input->getArgument('title'))
        );
    }
980752
private static function processor(ContainerInterface $container): ProcessorInterface
    {
        if (!$container->has(ProcessorInterface::class)) {
            return new WebProcessor($container);
        }

        return $container->get(ProcessorInterface::class);
    }
179708
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        $logger = LoggerHelper::createDefaultLogger($output);

        /** @var string $cacheOption */
        $cacheOption = $input->getOption('cache');
        $fileCache = new FilesystemCache($cacheOption);
        $cache = new SimpleCacheAdapter($fileCache);

        $logger->info('initializing converting process');

        $browscap = new BrowscapUpdater($cache, $logger);

        $logger->info('started converting local file');

        /** @var string $file */
        $file = $input->getArgument('file');
        if (! $file) {
            $file = $this->defaultIniFile;
        }

        $output->writeln(sprintf('converting file %s', $file));

        try {
            $browscap->convertFile($file);
        } catch (Exception\FileNameMissingException $e) {
            $logger->debug($e);

            return 6;
        } catch (Exception\FileNotFoundException $e) {
            $logger->debug($e);

            return 7;
        } catch (Exception\ErrorReadingFileException $e) {
            $logger->debug($e);

            return 8;
        }

        $logger->info('finished converting local file');

        return 0;
    }
1161986
protected function execute(InputInterface $input, OutputInterface $output) {

		// Fetch paths for Applications
		$applications = \Skeleton\Core\Application::get_all();

		// If the paths array hasn't been defined yet, make sure it exists
		if (!isset($paths) or !is_array($paths)) {
			$paths = [];
		}

		foreach ($applications as $application) {
			$paths[$application->name] = $application->path;
		}

		// Fetch additional paths to translate
		foreach (\Skeleton\I18n\Config::$additional_template_paths as $name => $path) {
			$paths[$name] = $path;
		}

		// Translate all the applications
		foreach ($paths as $application => $directory) {
			$log = $this->translate_application($application, $directory);
			$output->writeln($log);
		}

		$packages = \Skeleton\Core\Package::get_all();

		foreach ($packages as $package) {
			$log = $this->translate_skeleton_package($package);
			$output->writeln($log);
		}

		return 0;
	}
1328807
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $cmd = "echo %s > '%s/daemon/daemon.pid'";
        $command = sprintf($cmd, getmypid(), PHPCI_DIR);
        exec($command);

        $this->output = $output;
        $this->run   = true;
        $this->sleep = 0;
        $runner      = new RunCommand($this->logger);
        $runner->setMaxBuilds(1);
        $runner->setDaemon(true);

        $emptyInput = new ArgvInput(array());

        while ($this->run) {

            $buildCount = 0;

            try {
                $buildCount = $runner->run($emptyInput, $output);
            } catch (\Exception $e) {
                $output->writeln('<error>Exception: ' . $e->getMessage() . '</error>');
                $output->writeln('<error>Line: ' . $e->getLine() . ' - File: ' . $e->getFile() . '</error>');
            }

            if (0 == $buildCount && $this->sleep < 15) {
                $this->sleep++;
            } elseif (1 < $this->sleep) {
                $this->sleep--;
            }
            echo '.'.(0 === $buildCount?'':'build');
            sleep($this->sleep);
        }
    }
1251021
public function createProcess(ProcessFactoryInterface $processFactory): Process
    {
        return $processFactory->createProcess($this->name, $this->arguments);
    }
196980
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;
		}

		$migrations = \Skeleton\Database\Migration\Runner::get_runnable();

		if (count($migrations) > 0) {
			$output->writeln('There are ' . count($migrations) . ' outstanding migrations:');
		} else {
			$output->writeln('Database is up-to-date');
		}


		$migration_count = 0;
		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->writeln("\t" . $package . ' / ' . $classname);
		}

		return 0;
	}