Print out the version of CakePHP in use.

@param \Cake\Console\Arguments $args The command arguments.
@param \Cake\Console\ConsoleIo $io The console io
@return int
435287
public function execute(Arguments $args, ConsoleIo $io)
    {
        $io->out(Configure::version());

        return static::CODE_SUCCESS;
    }
292807
public function getCondition($type, array $args = [])
    {
        $chain = clone $this->chain;
        while ($chain) {
            /** @var TypeResolverInterface $resolver */
            $resolver = $chain->current();
            try {
                $condition = $resolver->getCondition($type, $args);
                if ($condition instanceof ConditionInterface) {
                    return $condition;
                }
            } catch (\Exception $e) {
                if (!$this->getFlagIgnoreException()) {
                    throw new Exception\RuntimeException($e->getMessage(), $e->getCode(), $e);
                }
            }
            $chain->next();
        }

        $errMsg = sprintf('Condition for type %s not found', $type);
        throw new Exception\ResultNotFoundException($errMsg);
    }
1253591
public function handleList(Args $args, IO $io)
    {
        $moduleNames = ArgsUtil::getModuleNames($args, $this->modules);
        $states = $this->getPathMappingStates($args);

        $printState = count($states) > 1;
        $printModuleName = count($moduleNames) > 1;
        $printHeaders = $printState || $printModuleName;
        $printAdvice = true;
        $indentation = ($printState && $printModuleName) ? 8
            : ($printState || $printModuleName ? 4 : 0);

        foreach ($states as $state) {
            $statePrinted = !$printState;

            if (PathMappingState::CONFLICT === $state) {
                $expr = Expr::method('getContainingModule', Expr::method('getName', Expr::in($moduleNames)))
                    ->andMethod('getState', Expr::same($state));

                $mappings = $this->repoManager->findPathMappings($expr);

                if (!$mappings) {
                    continue;
                }

                $printAdvice = false;

                if ($printState) {
                    $this->printPathMappingStateHeader($io, $state);
                }

                $this->printConflictTable($io, $mappings, $printState ? 4 : 0);

                if ($printHeaders) {
                    $io->writeLine('');
                }

                continue;
            }

            foreach ($moduleNames as $moduleName) {
                $expr = Expr::method('getContainingModule', Expr::method('getName', Expr::same($moduleName)))
                    ->andMethod('getState', Expr::same($state));

                $mappings = $this->repoManager->findPathMappings($expr);

                if (!$mappings) {
                    continue;
                }

                $printAdvice = false;

                if (!$statePrinted) {
                    $this->printPathMappingStateHeader($io, $state);
                    $statePrinted = true;
                }

                if ($printModuleName) {
                    $prefix = $printState ? '    ' : '';
                    $io->writeLine(sprintf('%sModule: %s', $prefix, $moduleName));
                    $io->writeLine('');
                }

                $this->printMappingTable($io, $mappings, $indentation, PathMappingState::ENABLED === $state);

                if ($printHeaders) {
                    $io->writeLine('');
                }
            }
        }

        if ($printAdvice) {
            $io->writeLine('No path mappings. Use "puli map <path> <file>" to map a Puli path to a file or directory.');
        }

        return 0;
    }
827635
public function execute(Arguments $args, ConsoleIo $io)
    {
        $this->loadModel('MeCms.Users');

        $groups = $this->Users->Groups->find('list');

        if ($groups->isEmpty()) {
            $io->error(__d('me_cms', 'Before you can manage users, you have to create at least a user group'));

            return null;
        }

        $groups = $groups->toList();
        $user = [];

        //Asks for some fields
        $user['username'] = $io->ask(I18N_USERNAME);
        $user['password'] = $io->ask(I18N_PASSWORD);
        $user['password_repeat'] = $io->ask(I18N_REPEAT_PASSWORD);
        $user['email'] = $io->ask(I18N_EMAIL);
        $user['first_name'] = $io->ask(I18N_FIRST_NAME);
        $user['last_name'] = $io->ask(I18N_LAST_NAME);
        $user['group_id'] = $args->getOption('group');

        //Asks for group, if not passed as option
        if (!$user['group_id']) {
            //Formats groups
            foreach ($groups as $id => $group) {
                $groups[$id] = [$id, $group];
            }

            //Sets header and prints as table
            $header = ['ID', 'Name'];
            $io->helper('table')->output(array_merge([$header], $groups));
            $user['group_id'] = $io->ask(__d('me_cms', 'Group ID'));
        }

        //Checks fields
        foreach ($user as $key => $value) {
            if (empty($value)) {
                $io->error(__d('me_cms', 'Field `{0}` is empty. Try again', $key));

                return null;
            }
        }

        //Checks the group IDs
        if (!array_key_exists($user['group_id'], $groups)) {
            $io->error(__d('me_cms', 'Invalid group ID'));

            return null;
        }

        //Saves the user
        $user = $this->Users->newEntity($user);
        if (!$this->Users->save($user)) {
            $io->err(I18N_OPERATION_NOT_OK);
            $io->err(__d('me_cms', 'The user could not be saved'));

            //With verbose, shows errors for each field
            if ($args->getOption('verbose')) {
                foreach ($user->getErrors() as $field => $errors) {
                    foreach ($errors as $error) {
                        $io->error(__d('me_cms', 'Field `{0}`: {1}', $field, lcfirst($error)));
                    }
                }
            }

            return null;
        }

        $io->success(I18N_OPERATION_OK);
        $io->success(__d('me_cms', 'The user was created with ID {0}', $user->id));

        return null;
    }
1257117
public function execute(Arguments $args, ConsoleIo $io)
    {
        $file = Folder::slashTerm(WWW_ROOT) . 'vendor' . DS . 'kcfinder' . DS . '.htaccess';

        if ($this->verboseIfFileExists($io, $file)) {
        } elseif ((new KCFinder)->isAvailable()) {
            $io->createFile(
                Folder::slashTerm(WWW_ROOT) . 'vendor' . DS . 'kcfinder' . DS . '.htaccess',
                'php_value session.cache_limiter must-revalidate' . PHP_EOL .
                'php_value session.cookie_httponly On' . PHP_EOL .
                'php_value session.cookie_lifetime 14400' . PHP_EOL .
                'php_value session.gc_maxlifetime 14400' . PHP_EOL .
                'php_value session.name CAKEPHP'
            );
        } else {
            $io->error(__d('me_tools', '{0} is not available', 'KCFinder'));
        }

        return null;
    }
113114
public function handle(Args $args, IO $io)
    {
        $criteria = array();

        if ($args->isOptionSet('path')) {
            $criteria['path'] = $args->getOption('path');
            $criteria['language'] = $args->getOption('language');
        }

        if ($args->isOptionSet('name')) {
            if (isset($criteria['path'])) {
                throw new RuntimeException('The options --name and --path cannot be combined.');
            }

            $criteria['path'] = '/**/'.$args->getOption('name');
            $criteria['language'] = $args->getOption('language');
        }

        if ($args->isOptionSet('class')) {
            $criteria['class'] = $args->getOption('class');
        }

        if ($args->isOptionSet('type')) {
            $criteria['bindingType'] = $args->getOption('type');
        }

        if (empty($criteria)) {
            throw new RuntimeException('No search criteria specified.');
        }

        return $this->listMatches($io, $criteria);
    }
340077
public function EXE(I_O $IO)
    {
        while (true) {
            try {
                if (true === $IO->I_(Type::BOOL)) {
                    return $IO->_O(true);
                }
            } catch (I_O_InputIndexException $e) {
                break;
            }
        }
        return $IO->_O(false);
    }
1049140
public function handleList(Args $args, IO $io)
    {
        $pluginClasses = $this->manager->getPluginClasses();

        if (!$pluginClasses) {
            $io->writeLine('No plugin classes. Use "puli plugin --install <class>" to install a plugin class.');

            return 0;
        }

        foreach ($pluginClasses as $pluginClass) {
            $io->writeLine(sprintf('<c1>%s</c1>', $pluginClass));
        }

        return 0;
    }
494780
private function printPathMappingStateHeader(IO $io, $pathMappingState)
    {
        switch ($pathMappingState) {
            case PathMappingState::ENABLED:
                $io->writeLine('The following path mappings are currently enabled:');
                $io->writeLine('');

                return;
            case PathMappingState::NOT_FOUND:
                $io->writeLine('The target paths of the following path mappings were not found:');
                $io->writeLine('');

                return;
            case PathMappingState::CONFLICT:
                $io->writeLine('Some path mappings have conflicting paths:');
                $io->writeLine(' (add the module names to the "override-order" key in puli.json to resolve)');
                $io->writeLine('');

                return;
        }
    }
387170
public function execute(Arguments $args, ConsoleIo $io)
    {
        foreach ($this->config as $file) {
            list($plugin, $file) = pluginSplit($file);
            $this->copyFile(
                $io,
                Plugin::path($plugin, 'config' . DS . $file . '.php'),
                Folder::slashTerm(CONFIG) . $file . '.php'
            );
        }

        return null;
    }
110447
private function printHelp()
    {
        $this->writeLn("Usage: pho [options] [files]\n");
        $this->writeLn("Options\n");

        // Loop over availableOptions, building the necessary input for
        // ConsoleFormatter::alignText()
        $options = [];
        foreach ($this->availableOptions as $name => $optionInfo) {
            $row = [$optionInfo[1], $optionInfo[0]];
            $row[] = (isset($optionInfo[3])) ? "<{$optionInfo[3]}>" : '';
            $row[] = $optionInfo[2];

            $options[] = $row;
        }

        $pad = str_repeat(' ', 3);
        foreach ($this->formatter->alignText($options, $pad) as $line) {
            $this->writeLn($pad . $line);
        }
    }
363747
private function printUpgradeIntro($io, $package)
    {
        $io->write("\n  <fg=yellow;options=bold>Seems you have "
            . ($package['direction'] === 'up' ? 'upgraded' : 'downgraded')
            . ' Yii Framework from version '
            . $package['fromPretty'] . ' to ' . $package['toPretty'] . '.</>'
        );
        $io->write("\n  <options=bold>Please check the upgrade notes for possible incompatible changes");
        $io->write('  and adjust your application code accordingly.</>');
    }
555721
public function handle(Args $args, IO $io)
    {
        $path = Path::makeAbsolute($args->getArgument('path'), $this->currentPath);

        $resource = $this->repo->get($path);

        if (!$resource->hasChildren()) {
            throw new RuntimeException(sprintf(
                'The resource "%s" does not have children.',
                $resource->getPath()
            ));
        }

        if ($args->isOptionSet('long')) {
            $this->listLong($io, $resource->listChildren());

            return 0;
        }

        $this->listShort($io, $resource->listChildren());

        return 0;
    }
744509
public function execute(Arguments $args, ConsoleIo $io)
    {
        try {
            //Will trigger events provided by `LinkScannerCommandEventListener`
            $this->LinkScanner->getEventManager()->on(new LinkScannerCommandEventListener($args, $io));

            if ($args->getOption('follow-redirects')) {
                $this->LinkScanner->setConfig('followRedirects', true);
            }
            if ($args->getOption('force')) {
                $this->LinkScanner->setConfig('lockFile', false);
            }
            if ($args->hasOption('full-base-url')) {
                $this->LinkScanner->setConfig('fullBaseUrl', $args->getOption('full-base-url'));
            }
            if ($args->hasOption('max-depth')) {
                $this->LinkScanner->setConfig('maxDepth', $args->getOption('max-depth'));
            }
            if ($args->getOption('no-cache')) {
                $this->LinkScanner->setConfig('cache', false);
            }
            if ($args->getOption('no-external-links')) {
                $this->LinkScanner->setConfig('externalLinks', false);
            }
            if ($args->hasOption('timeout')) {
                $this->LinkScanner->Client->setConfig('timeout', $args->getOption('timeout'));
            }

            $this->LinkScanner->scan();

            if ($args->getOption('export-with-filename') || $args->getOption('export')) {
                $this->LinkScanner->export($args->getOption('export-with-filename'));
            }
        } catch (Exception $e) {
            $io->error($e->getMessage());
            $this->abort();
        }

        return null;
    }
237813
protected function setOutputLevel(Arguments $args, ConsoleIo $io)
    {
        $io->setLoggers(ConsoleIo::NORMAL);
        if ($args->getOption('quiet')) {
            $io->level(ConsoleIo::QUIET);
            $io->setLoggers(ConsoleIo::QUIET);
        }
        if ($args->getOption('verbose')) {
            $io->level(ConsoleIo::VERBOSE);
            $io->setLoggers(ConsoleIo::VERBOSE);
        }
    }
544704
public function createAsciiDocHandler(Args $args, IO $io, Command $command)
    {
        $path = $this->getAsciiDocPage($command->getApplication(), $args);

        $handler = new HelpAsciiDocHandler($path, $this->executableFinder, $this->processLauncher);
        $handler->setLessBinary($this->lessBinary);

        return $handler;
    }
1059482
function printHelp(argv) {
    if (argv.help || argv.h) {
        showHelpInfo();
        process.exit(0);
    }

    // soi --version
    if (argv.version || argv.v) {
        console.log(`soi version: ${pkgInfo.version}`);
        process.exit(0);
    }
}