PHP code example of alcamo / cli

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

    

alcamo / cli example snippets



use alcamo\cli\AbstractCli;

tractCli
{
    public const OPTIONS =
        [
            'foo' => [ 'f', self::REQUIRED_ARGUMENT, 'Set foo.']
        ]
        + parent::OPTIONS;

    public function innerRun(): int
    {
        if ($this->getOption('foo')) {
            $this->getLogger()
                ->notice('Foo was set to ' . $this->getOption('foo'));
        }

        $this->getLogger()->info('Info message.');

        return 0;
    }