| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Rakit Console is simple PHP library to create Command Line Interface (CLI) Application. This library strongly inspired by Laravel Artisan Console.
Just run this composer command:
composer require rakit/consoleCreate a file named cli (without extension).
<?php
use Rakit\Console\App;
require('vendor/autoload.php');
// 1. Initialize app
$app = new App;
// 2. Register commands
$app->command('hello {name}', 'Say hello to someone', function($name) {
$this->writeln("Hello {$name}");
});
// 3. Run app
$app->run();Open terminal/cmd, go to your app directory, run this command:
php cli hello "John Doe"
You can see available commands by typing this:
php cli list
You can show help by putting --help or -h for each command. For example:
php cli hello --help
| Back | FazBrowse Home | New Git URL |