Closed zeelot closed 13 years ago
You can set the KOHANA_ENV variable when running minion (or any other cli) tasks like this:
KOHANA_ENV=staging php index.php --uri=minion/module:#{task}
ahutchings is correct
KOHANA_ENV='production' php -r "echo getenv('KOHANA_ENV');"
thanks, carry on =P
This may very well be my lack of understanding of how PHP CLI works but in our bootstrap, we typically set different options depending on the values returned from getenv() calls.
Here is an example in the kohana/kohana bootstrap: https://github.com/kohana/kohana/blob/3.1/develop/application/bootstrap.php#L64
We also use
ENVIRONMENT
andAPACHE_ENVIRONMENT
in some of our applications... it seems like I should be able to add any number of values to $_ENV when running minion... usually I have a cli.php file next to index.php that uses putenv() a few times but I might just be doing it wrong...