DEV Community

loading...

Discussion on: Production-friendly Configuration Files in PHP

Collapse
antoniocs profile image
AntonioCS

Please stop doing this.
Use a modern php framework (Symfony, Laravel, etc) and follow their convention on how to store config data.

Using things like include or require should not happen in modern PHP.
Stop doing this!

Collapse
jbdano profile image
jbdano

I like this implementation.

@antoniocs Can you elaborate? I don't see why an entire framework is needed for such a seemingly minor objective.

Collapse
antoniocs profile image
AntonioCS

You talk about applications, in my mind an application, even if small can benefit from a framework like symfony (especially 4 which is quite lean and small).
Even if you don't want a framework I am sure you can find a package that will help with this.
Trying to do this on your own is fine, but create a post telling others to do this and that this is good is wrong.