devMode, phpdotenv variable ignored I'm using dotphpenv for environment specific config. 

This works perfectly for my db config. I added another 2 environment vars for devMode and allowAutoUpdates

DEV_MODE=false
AUTO_UPDATE=false


and updated general.php 

&lt;?php

return array(

  // Default

  '*' =&gt; array(
    ...
    'devMode' =&gt; getenv('DEV_MODE'),
    'allowAutoUpdates' =&gt; getenv('AUTO_UPDATE'),
    ...
  )
);


But with that set, dev mode and auto-update are still available to production.

If I set both to false we have no problem. This is obviously a phpdotenv thing because Craft is doing what it's supposed to but if anyone can shed light I'd appreciate it.
It looks like getenv returns a string (or false if the variable is not set, but it is in this case). So you need to cast the string to a boolean value to make it work. However, (bool)'false' gives true, not false. There are two possible solutions:


Set the variable to 0 instead of false in your .env file:

DEV_MODE=0
AUTO_UPDATE=0


And then in your config:

'devMode' =&gt; (bool)getenv('DEV_MODE')


This works because (bool)'0' gives false.
Use this solution:

'devMode' =&gt; filter_var(getenv('DEV_MODE'), FILTER_VALIDATE_BOOLEAN);


This works because the FILTER_VALIDATE_BOOLEAN filter returns TRUE for "1", "true", "on" and "yes", and returns FALSE for any other value.