2017 © Pedro Peláez
 

library console

Colibri Console component

image

colibri-fw/console

Colibri Console component

  • Sunday, April 1, 2018
  • by alek13
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Colibri Console component

Usage example:, (*1)

file: ./app:, (*2)

#!/usr/bin/env php
<?php
require __DIR__ . '/vendor/autoload.php';

use Application\Command\Cache;
use Colibri\Console\Application;

exit(
    (new Application('Colibri Tools', 'dev'))
    ->setLogo('_________        .__  ._____.         .__
\_   ___ \  ____ |  | |__\_ |_________|__|
/    \  \/ /  _ \|  | |  || __ \_  __ \  |
\     \___(  <_> )  |_|  || \_\ \  | \/  |
 \______  /\____/|____/__||___  /__|  |__|
        \/                    \/          ')
    ->addCommands([
        new Cache\Clear(),
    ])
    ->run()
);

in terminal:, (*3)

chmod +x ./app

file: Application/Command/Cache/Clear.php:, (*4)

<?php
namespace Application\Command\Cache;

use Colibri\Cache\Cache;
use Colibri\Console\Command;

class Clear extends Command
{

    protected function definition(): Command
    {
        return $this
            // !!! You does not need to set the name of command. It will be 'cache:clear' automatically.
            ->setDescription('Clears all cache');
    }

    protected function go(): int
    {
        Cache::flush();

        return 0;
    }
}

The Versions

01/04 2018

dev-master

9999999-dev

Colibri Console component

  Sources   Download

MIT

The Requires

 

by Alexander Chibrikin