Does anyone know the best way I can create a configuration for a Console/Command-line Command (or indeed in any part of the application?)
What I would like to achieve is this (for example)
$ app/console myapp:sync --server=server_2
connecting to "server2.servers.com"...success!
sync completed.
Where myapp is a command line class under /src/myBundle/Command/SyncCommand.php and in the configuration (app/config/config.yml?) this:
myapp:
server_1:
hostname: "server1.servers.com"
port: 22
server_2:
hostname: "server2.servers.com"
port: 22
For this example it isn't important what the sync does (the code has already been written as SyncCommand.php), I am just interested in knowing in which configuration file to use (I presume either config.yml or parameters.ini) and how to read that config out (treeBuilder? or something like $this->getParameters('myapp')? I suspect I am missing something obvious somewhere.
Thanks!