I have an application that is sharing code in 100% and the only difference is database each customer is connecting to. In WEB application it was quite easy - I read first part of the hostname (each client gets its own) and I use it to connect to proper db, example:
https://client_name.application.com will connect to application_client_name DB
Now I would like to do similar trick in CLI command using Yii - for example to run some maintenance scripts. I know I can do it using curl or something but then some web server limitations apply like timeout for script or something and some of those actions might take some time
Is it possible to provide to ./yii controller/action a parameter that will be used to create proper connection string or maybe there is a different method you might suggest.