New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment::get('development'); returning empty array #1177
Comments
It's probably because the environment is lazily initialized here https://github.com/UnionOfRAD/framework/blob/f3b1c20a7228a529ec59b582fc033f9911b9551a/app/config/bootstrap/action.php#L42 by default in the famework repo. |
I'm not sure I follow you. I tried removing the Environment::set call you mentioned but got the same results. I did take a look at the Environment class in lithium/core/Environment.php and noticed this:
Should I be setting up my connections here instead and not in app/config/bootstrap/connections.php? |
Don't remove it, just move the initialization call before using it in the bootstrap file. |
Closing as this is not a bug. |
@jails I am a little confused here, I put actions.php back to its orignal form and removed the Environment::Set call I was making in my bootstrap file. My connections.php file is still setup as described above, but now when I go to my site I get this error: Fatal error: Uncaught exception 'lithium\core\ConfigException' with message 'No adapter set for configuration in class |
I am having some trouble with the Environment::get() method. From my understanding of the documentation found here: http://li3.me/docs/lithium/core/Environment::get() passing in the string of the name of an environment should return an array of the entire configuration.
I have my Connections setup as so:
However when i call Environment::get('development'); it returns an empty array. Is there something I am missing? I tried calling Environment::get('default'); and it gave me a null.
I have set my environment to 'development' in my bootstrap file:
I am not sure what else could be going wrong.
The text was updated successfully, but these errors were encountered: