rabin 8a464021cf edit | 9 mesiacov pred | |
---|---|---|
.. | ||
.github | 9 mesiacov pred | |
src | 9 mesiacov pred | |
CONTRIBUTING.md | 9 mesiacov pred | |
LICENSE | 9 mesiacov pred | |
README.md | 9 mesiacov pred | |
SECURITY.md | 9 mesiacov pred | |
composer.json | 9 mesiacov pred |
Silly CLI micro-framework based on Symfony Console.
Professional support for Silly is available via Tidelift
$ composer require mnapoli/silly
Example of a Silly application:
use Symfony\Component\Console\Output\OutputInterface;
$app = new Silly\Application();
$app->command('greet [name] [--yell]', function ($name, $yell, OutputInterface $output) {
$text = $name ? "Hello, $name" : "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
$ php application.php greet --yell john
HELLO JOHN
Silly\Application
extends Symfony\Console\Application
and can be used wherever Symfony's Application can.
Silly is just an implementation over the Symfony Console. Read the Symfony documentation to learn everything you can do with it.
Interested in seeing examples of Silly applications? Have a look at this short selection:
See the CONTRIBUTING file.