PHP code example of rudra / cli

1. Go to this page and download the library: Download rudra/cli 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/ */

    

rudra / cli example snippets


#!/usr/bin/php


if (php_sapi_name() !== 'cli') {
    exit;
}

;

parse_str(implode('&', array_slice($argv, 1)), $inputArgs);

$console = new Console();
$console->addCommand('spongebob', [TestCommand::class]);
$console->addCommand('second', [TestCommand::class, 'actionSecond']);

$console->invoke($inputArgs);
 rudra spongebob
 rudra spongebob