Read the base path from the options

@param   InputInterface   $input   An InputInterface instance
@param   OutputInterface  $output  An OutputInterface instance

@return  string  The base path
6565
protected function handleBasePath(InputInterface $input, OutputInterface $output)
	{
		$path = realpath($input->getOption('basepath'));
		$this->writeln($output, 'Joomla! installation expected in ' . $path, OutputInterface::VERBOSITY_DEBUG);

		return $path;
	}
1083551
public function execute(InputInterface $input, OutputInterface $output)
    {
        // graviton root
        $baseDir = __DIR__.'/../../../';

        // vendorized? - go back some more..
        if (strpos($baseDir, '/vendor/') !== false) {
            $baseDir .= '../../../';
        }

        $this->finder
            ->in($baseDir)
            ->path('Resources/config')
            ->name('/migrations.(xml|yml)/')
            ->files();

        foreach ($this->finder as $file) {
            if (!$file->isFile()) {
                continue;
            }

            $output->writeln('Found '.$file->getRelativePathname());

            $command = $this->getApplication()->find('mongodb:migrations:migrate');

            $helperSet = $command->getHelperSet();
            $helperSet->set($this->documentManager, 'dm');
            $command->setHelperSet($helperSet);

            $configuration = $this->getConfiguration($file->getPathname(), $output);
            self::injectContainerToMigrations($this->container, $configuration->getMigrations());
            $command->setMigrationConfiguration($configuration);

            $arguments = $input->getArguments();
            $arguments['command'] = 'mongodb:migrations:migrate';
            $arguments['--configuration'] = $file->getPathname();

            $migrateInput = new ArrayInput($arguments);
            $migrateInput->setInteractive($input->isInteractive());
            $returnCode = $command->run($migrateInput, $output);

            if ($returnCode !== 0) {
                $this->errors[] = sprintf(
                    'Calling mongodb:migrations:migrate failed for %s',
                    $file->getRelativePathname()
                );
            }
        }

        if (!empty($this->errors)) {
            $output->writeln(
                sprintf('<error>%s</error>', implode(PHP_EOL, $this->errors))
            );
            return -1;
        }

        return 0;
    }
556352
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $router = $this->getContainer()->get($this->getRouterServiceId());
        $name = $input->getArgument('name');
        $helper = new DescriptorHelper();

        if ($name) {
            $route = $router->getRouteCollection()->get($name);
            if (!$route) {
                throw new \InvalidArgumentException(sprintf('The route "%s" does not exist.', $name));
            }
            $this->convertItinerary($route);
            $helper->describe($output, $route, [
                'format' => $input->getOption('format'),
                'raw_text' => $input->getOption('raw'),
                'name' => $name,
            ]);
        } else {
            $routes = $router->getRouteCollection();

            foreach ($routes as $route) {
                $this->convertItinerary($route);
            }

            $helper->describe($output, $routes, [
                'format' => $input->getOption('format'),
                'raw_text' => $input->getOption('raw'),
                false,
            ]);
        }
    }
809136
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $path = $input->getOption('path');
        $context = array();

        // if we're not given a path at all, try to figure it out
        if ($path === null) {
            $path = php_ini_loaded_file();
        }

        if (!is_file($path)) {
            throw new \Exception('Path is null or not accessible: "'.$path.'"');
        }

        $scan = new \Psecio\Iniscan\Scan($path, $context);
        $scan->execute();

        $scan->getMarked();
        $result = pathinfo($path);

        // to start, we need a backup of the file (overwrite if there)
        $backupPath = './'.$result['basename'].'-'.date('mdy');
        copy($path, $backupPath);

        // Now les get our rules and parse them
        $scan = new \Psecio\Iniscan\Scan($path, $context);
        $rules = get_object_vars($scan->getRules());

        $output->writeLn($this->generateIniOutput($rules));
    }
285035
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $paths = $input->getArgument('paths');
        foreach ($paths as $path) {
            if (!file_exists($path)) {
                self::error($output, "One or more of the specified paths are missing");
                return;
            }
        }

        if (!FileUtils::deleteDirectory('./lib')) {
            self::error($output, "Unable to remove the output directory");
        };

        if (!file_exists('./lib') || !is_dir('./lib')) {
            mkdir('./lib', 0755, true);
        }

        $magentofier = new Pearify($paths, $output);
        $magentofier->process();
    }
472889
protected function getConverter(InputInterface $input)
    {
        return $this->getConverterFactory()->get($input->getOption('input-format'), $this->output_format);
    }
896252
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->configFilePath = $input->getOption('config-path');

        if (!$this->verifyNotInstalled($output)) {
            return;
        }

        $output->writeln('');
        $output->writeln('<info>******************</info>');
        $output->writeln('<info> '.Lang::get('welcome_to_phpci').'</info>');
        $output->writeln('<info>******************</info>');
        $output->writeln('');

        $this->checkRequirements($output);

        $output->writeln(Lang::get('please_answer'));
        $output->writeln('-------------------------------------');
        $output->writeln('');

        // ----
        // Get MySQL connection information and verify that it works:
        // ----
        $connectionVerified = false;

        while (!$connectionVerified) {
            $db = $this->getDatabaseInformation($input, $output);

            $connectionVerified = $this->verifyDatabaseDetails($db, $output);
        }

        $output->writeln('');

        $conf = array();
        $conf['b8']['database'] = $db;

        // ----
        // Get basic installation details (URL, etc)
        // ----
        $conf['phpci'] = $this->getPhpciConfigInformation($input, $output);

        $this->writeConfigFile($conf);
        $this->setupDatabase($output);
        $admin = $this->getAdminInformation($input, $output);
        $this->createAdminUser($admin, $output);
    }
809560
protected function getFilePointer(InputInterface $input, OutputInterface $output)
    {
        if (false !== ftell(STDIN)) {
            return STDIN;
        }

        if (!$input->getOption('file')) {
            throw new \RuntimeException('Please provide a CSV file argument or CSV input stream');
        }

        return fopen($input->getOption('file'), 'r');
    }
16468
protected function execute(InputInterface $input, OutputInterface $output)
    {

        $listType = $input->getArgument('option');

        switch ($listType) {
            case "help":

                $help = [
                    '<info>',
                    '*******************************************************',
                    '* typo3 alias:show                shows help          *',
                    '* typo3 show:aliases this         shows current alias *',
                    '* typo3 show:aliases help         shows help          *',
                    '*******************************************************',
                    '</info>',
                ];

                $output->writeln($help);

                break;
            case "this":
                $contents = Yaml\Yaml::parse(file_get_contents($this->filename));

                foreach ($contents as $key => $value ){
                    if($value["path"] == PATH_site){
                        $output->writeln('<info>You are here: </info><question>'.$key.'</question>');
                    }

                }


                break;
            default:

                $output->writeln("Type 'show:aliases help' to find out more commands.");

                $output->writeln('Reading existing alias file');
                $contents = Yaml\Yaml::parse(file_get_contents($this->filename));

                $aliasesOutput = array();

                foreach ($contents as $key => $value ){
                    $aliasesOutput[] = '<question>'.$key.':</question>';
                    foreach ($value as $key2 => $value2){
                        $aliasesOutput[] = '   <info>'.$key2.': </info><comment>'.$value2.'</comment>';
                    }

                }


                $output->writeln($aliasesOutput);
                break;
        }

        return 0;

    }
1199295
private function getFilePath(InputInterface $input, $subDir)
    {
        $path = [];

        $path[] = $this->getContainer()->getParameter('sculpin.source_dir');
        $path[] = $subDir;
        $path[] = $input->getOption('filename');

        return implode(DIRECTORY_SEPARATOR, array_filter($path));
    }
797697
public function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new OutputStyle($input, $output);

        $composerPath = $this->getComposerPathFromInput($input);

        $ladder = new Ladder($composerPath);

        $packages = $ladder->getOutdatedPackages();

        $io->newLine();

        if (!count($packages)) {
            $io->write('All dependencies match the latest package versions <fg=green>:)</>');
            $io->newLine();

            return 1;
        }

        $outdated = [];
        $upgradable = [];

        foreach ($packages as $package) {
            if ($package->isUpgradable()) {
                $upgradable[$package->getName()] = $package;
            } else {
                $outdated[$package->getName()] = $package;
            }
        }

        if ($input->getOption('all')) {
            $upgradable = array_merge($upgradable, $outdated);
        }

        if (empty($upgradable)) {
            $io->warning('Nothing to install or update, did you forget the flag --all?');

            return 1;
        }

        foreach ($upgradable as $package) {
            $command = $input->getOption('global') ? 'composer global require' : 'composer require';

            $command .= sprintf(' %s=^%s', $package->getName(), $package->getLatestVersion());

            if ($package->getDevDependency()) {
                $command .= ' --dev';
            }

            $process = new Process($command, $composerPath, array_merge($_SERVER, $_ENV), null, null);

            $process->run(function ($type, $line) use ($io) {
                $io->write($line);
            });

            $io->newLine();
        }

        return 0;
    }
608343
public function execute(InputInterface $input, OutputInterface $output)
    {
        if (empty($path = $input->getArgument('path'))) {
            $this->render($input, $output);
        } else {
            $this->test($input->getArgument('method'), $path, $input, $output);
        }

        return 0;
    }
1060578
protected function targetDirectory(InputInterface $input)
    {
        $pid = $input->getParameterOption(['--path', '-p']);

        if (empty($pid)) {
            $path = app()->getPath().'/runtime/process';
        } else {
            $path = dirname($pid);
        }
        if (!file_exists($path)) {
            mkdir($path, 0755, true);
        }

        return $this->pidPath = $path;
    }
552191
private function createOptions(InputInterface $input, OutputInterface $output)
    {
        $options = ['notifier' => $this->createNotifier($input, $output)];

        if ($input->hasArgument('path')) {
            $options['path'] = $input->getArgument('path');
        }

        if ($input->hasOption('release')) {
            $options['release'] = $input->getOption('release');
        }

        if ($input->hasOption('tag')) {
            $options['version'] = $input->getOption('tag');
        }

        if ($input->hasOption('exclude')) {
            $options['excludes'] = $input->getOption('exclude');
        }

        if ($input->hasOption('clear')) {
            $options['clear'] = $input->getOption('clear');
        }

        return array_filter($options);
    }
462347
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $configurationPath = $input->getOption('configurationPath');
        $deploymentName = $input->getArgument('deploymentName');
        $basePath = $this->factory->getDeploymentsBasePath($configurationPath);

        $deploymentFileName = $basePath . '/' . $deploymentName . '.php';

        $legacyMap = require __DIR__ . '/../../Migrations/Code/LegacyClassMap.php';
        $fileContent = file_get_contents($deploymentFileName);
        foreach ($legacyMap as $identifier => $className) {
            if ($fileContent !== str_ireplace($identifier, str_replace('\\', '\\\\', $className), $fileContent)) {
                $output->writeln(sprintf('<warning>Legacy deployment task name or task option "%s" found!</warning>', $identifier));
                $fileContent = str_ireplace($identifier, str_replace('\\', '\\\\', $className), $fileContent);
            }
        }
        file_put_contents($deploymentFileName, $fileContent);
        $output->writeln('<info>Migrated deployment definition "' . $deploymentName . '"</info>');
    }
840413
protected function execute( InputInterface $input, OutputInterface $output ) {
		$this->output = $output;
		$this->input = $input;
		$path = $this->setup();
		if ( is_int( $path ) ) {
			return $path;
		}
		$err = $this->loadConfig( $path );
		if ( is_int( $err ) ) {
			return $err;
		}

		$output->writeln( "Processing $path..." );
		$bad = $this->checkPath( $path );
		$output->write( "\n" );
		if ( $bad ) {
			foreach ( $bad as $file ) {
				$output->writeln( "Error: {$file->getPathname()} should not be executable" );
			}
			return 1;
		} else {
			$output->writeln( 'All good!' );
			return 0;
		}
	}
227191
private function generateOutput(InputInterface $input): OutputInterface
    {
        return new Output(
            $this->name,
            array_merge(
                $this->evaluateInputExports($input),
                $this->generateOutputParams($input)
            )
        );
    }