Skip to content
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

Auto enable app_local.php and .env loading #707

Closed
inoas opened this issue Sep 7, 2019 · 7 comments
Closed

Auto enable app_local.php and .env loading #707

inoas opened this issue Sep 7, 2019 · 7 comments
Labels
Milestone

Comments

@inoas
Copy link
Contributor

@inoas inoas commented Sep 7, 2019

Can we have that? That would make creating docker compose environments for cakephp a breeze regarding database credentials, cache settings etc

@inoas

This comment has been minimized.

Copy link
Contributor Author

@inoas inoas commented Sep 7, 2019

Same question goes towards //Configure::load('app_local', 'default'); why is this not the default?

@ADmad

This comment has been minimized.

Copy link
Member

@ADmad ADmad commented Sep 7, 2019

I don't see why anyone would use both .env files as well as environment based app_*.php files. So having both enabled by default would be quite silly IMO.

I am in favor of having the app_*.php files loading enabled by default.

@saeideng saeideng added this to the Future milestone Sep 7, 2019
@inoas

This comment has been minimized.

Copy link
Contributor Author

@inoas inoas commented Sep 7, 2019

Much like requirements.php which can be removed one can remove the file_exists check / code for app_local.php and/or .env

That aside env files do not allow in any way calucations where as app_local.php does. But this is not about .env vs true env variables vs app_local vs boot parameters etc. but just about conventions:

If you supply an app_local.php or .env file it should just work. even both at the same time. where env sets the basics and app_local can overwrite.

Both should also be in .gitignore by default.

I came across this when creating my environments that I can just fire up like so: https://github.com/htstudios/cakephp-docker-compose-box/

@markstory

This comment has been minimized.

Copy link
Member

@markstory markstory commented Sep 8, 2019

Using environment variables will make deployments in kubernetes or other container based hosting simpler, while 'local' files make applications living on servers managed by ansible/puppet/chef easier. I'm not confident we can make a decision in either direction here, as each style is used for a different deployment style, and choosing only one will likely make the other harder, and choosing both adds complexity and opportunity for confusion. The current opt-in approach we have lets people choose the style they need.

@inoas

This comment has been minimized.

Copy link
Contributor Author

@inoas inoas commented Sep 10, 2019

@markstory though u cannot just composer create and work with that but have to fork the cakephp/app repo because app_local and/or .env must be loaded early in the bootstrap process.

Is the file_exists check really so expensive that this cannot be the default that you can opt-out of. Convention over configuration?

This was referenced Sep 10, 2019
@inoas

This comment has been minimized.

Copy link
Contributor Author

@inoas inoas commented Sep 10, 2019

There are two PRs now, I hope that one will get accepted so that creating fresh cakephp projects via docker boxes is easier to do like so https://github.com/htstudios/cakephp-docker-compose-box/

@inoas inoas changed the title Auto enable .env loading Auto enable app_local.php and .env loading Sep 10, 2019
@dereuromark

This comment has been minimized.

Copy link
Member

@dereuromark dereuromark commented Sep 16, 2019

PRs open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.