exu / symfony2-console-standalone
Symfony2 console as standalone component
Requires
- symfony/console: dev-master
This package is not auto-updated.
Last update: 2025-03-11 05:39:52 UTC
README
All files are located on My GitHub project: Symfony2 Console as standalone component
To use symfony console you should create [[https://github.com/exu/symfony2-console-standalone/blob/master/composer.json][composer.json]]
file and add symfony/console
component
You should replace ”dev-master
” to current stable version (I’m trying whats new in development branch).
I’m using composer autoloader, so in this example all classes will be loaded from src
directory,
you can change it to other dir (in composer.json
)
Next run $ composer update
to install dependencies in your new project.
Next thing to do is Your new shiny command loader.
Put it in bin/console
file - or whatever you want - but if you change
directory position remember that you should adjust your paths details in console file
Finally create your new command file (src) for example:
Thats all, command loader should detect this file and load it. You can use your command by running
php bin/console say:nothing
.
You can put other commands in src/Command
directory try save content below as [[https://github.com/exu/symfony2-console-standalone/blob/master/src/Command/TestCommand.php][src/Command/TestCommand.php]]
and then run:
bin/console say:mynamebitch Jacek
You will get some nice colorized output.