PHP code example of kasundon / lib-console

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

    

kasundon / lib-console example snippets






class Test implements Command {
     
    /**
     * Pre-execution command setup
     */
    public function setup() 
    {
        CommandUtility::log("pre command setup");
    }
    
    /**
     * Executes command routines
     */
    public function execute() 
    {
        CommandUtility::log("execute");
    }
    
    /**
     *  Returns command name/description
     * 
     * @return string
     */
    public function getCommand() 
    {
        return "Test Command";
    }
}

 $this->arguments
shell
php composer.phar install
shell
php console.phar -help
shell
php app.php Test --abc 1
shell
php console.phar Test --abc 1