PHP code example of heropoo / console

1. Go to this page and download the library: Download heropoo/console library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

heropoo / console example snippets


$console = new \Moon\Console\Console();

$console->add('hello', function (){
    return 'Hello world!';
});
$console->add('ping', 'PingCommand::ping');

$app = new \Moon\Console\ConsoleApplication();
$status = $app->handleCommand($console);
exit($status);