/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Console
NameSizeModeActions
Command/-0755rm
Exception/-0755rm
TestSuite/-0755rm
Arguments.php39260644editdlrm
BaseCommand.php85150644editdlrm
Command.php1420644editdlrm
CommandCollection.php74910644editdlrm
CommandCollectionAwareInterface.php10270644editdlrm
CommandFactory.php19790644editdlrm
CommandFactoryInterface.php10010644editdlrm
CommandInterface.php16980644editdlrm
CommandRunner.php126430644editdlrm
CommandScanner.php48430644editdlrm
composer.json11730644editdlrm
ConsoleErrorHandler.php1890644editdlrm
ConsoleInput.php28530644editdlrm
ConsoleInputArgument.php55680644editdlrm
ConsoleInputOption.php89290644editdlrm
ConsoleInputSubcommand.php39340644editdlrm
ConsoleIo.php215160644editdlrm
ConsoleOptionParser.php315660644editdlrm
ConsoleOutput.php100000644editdlrm
Helper.php17050644editdlrm
HelperRegistry.php32650644editdlrm
HelpFormatter.php73140644editdlrm
LICENSE.txt12040644editdlrm
README.md34650644editdlrm
Shell.php293710644editdlrm
ShellDispatcher.php121610644editdlrm
TaskRegistry.php29310644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Console/README.md (3465B)
[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/http.svg?style=flat-square)](https://packagist.org/packages/cakephp/console) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE.txt) # CakePHP Console Library This library provides a framework for building command line applications from a set of commands. It provides abstractions for defining option and argument parsers, and dispatching commands. # installation You can install it from Composer. In your project: ``` composer require cakephp/console ``` # Getting Started To start, define an entry point script and Application class which defines bootstrap logic, and binds your commands. Lets put our entrypoint script in `bin/tool.php`: ```php #!/usr/bin/php -q run($argv)); ```` For our `Application` class we can start with: ```php add('hello', HelloCommand::class); return $commands; } } ``` Next we'll build a very simple `HelloCommand`: ```php addArgument('name', [ 'required' => true, 'help' => 'The name to say hello to', ]) ->addOption('color', [ 'choices' => ['none', 'green'], 'default' => 'none', 'help' => 'The color to use.' ]); return $parser; } public function execute(Arguments $args, ConsoleIo $io): ?int { $color = $args->getOption('color'); if ($color === 'none') { $io->out("Hello {$args->getArgument('name')}"); } elseif ($color == 'green') { $io->out("Hello {$args->getArgument('name')}"); } return static::CODE_SUCCESS; } } ``` Next we can run our command with `php bin/tool.php hello Syd`. To learn more about the various features we've used in this example read the docs: * [Option Parsing](https://book.cakephp.org/4/en/console-commands/option-parsers.html) * [Input & Output](https://book.cakephp.org/4/en/console-commands/input-output.html)