Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get working environment in Symfony 1.4

I have some features that I only want shown when the website is run in dev mode (or in development environment). How can I programmatically determine what environment is currently being used?

E.g.

// $inDevEnvironment = ?
if ($inDevEnvironment) {

    // DEV feature here
}
like image 564
Czar Pino Avatar asked Feb 15 '23 11:02

Czar Pino


1 Answers

Use sfConfig::get('sf_environment');. It returns the string dev when in dev environment.

See this page for more info: http://sunzhen.blogspot.com/2012/02/symfony-get-working-environmentdevelopm.html

like image 109
Czar Pino Avatar answered Feb 18 '23 00:02

Czar Pino