Can I get the value of an environment variable in routes.php (or other config files)? I am trying to get the value of an environment variable (defined in the general.php config file) in the routes.php config file. Is it possible or not? I tried $environmentVariables = craft()-&gt;config-&gt;get('environmentVariables')['myVariable'] but that throws an error: Call to undefined function craft().
I think you'll just need to do something like this in your routes.php file:

$general = require __DIR__.'/general.php';

return array(
    'foo' =&gt; $general['environmentVariables']['bar'],
);