currentMenu |
---|
home |
Silly CLI micro-framework based on Symfony Console.
$ composer require mnapoli/silly
Example of a Silly application:
$app = new Silly\Application();
$app->command('greet [name] [--yell]', function ($name, $yell, OutputInterface $output) {
if ($name) {
$text = 'Hello, '.$name;
} else {
$text = 'Hello';
}
if ($yell) {
$text = strtoupper($text);
}
$output->writeln($text);
});
$app->run();
Running the application is the same as running any other Symfony Console application:
$ php application.php greet
Hello
$ php application.php greet john --yell
HELLO JOHN
Silly\Application
extends Symfony\Console\Application
and can be used wherever Symfony's Application can.
- Command definition
- Command callables
- Console helpers
- Dependency injection
- The PHP-DI edition
- The Pimple edition
Silly is just an implementation over the Symfony Console. Read the Symfony documentation to learn everything you can do with it.
See the CONTRIBUTING file.