"php - application config file stored as - ini,php,sql,cached,php class,json,php array?" Code Answer

5

The best thing you can do is the simplest thing that could possibly work (php variables) and wrap it up in a class. That way you can change the implementation later without changing any client code. Create an interface that the configuration class implements and make the client code use the interface methods. If you later decide to store configuration in a database or JSON or whatever, you can simply swap out the existing implementation with a new one. Make sure your configuration class is testable and write unit tests.

By Developer Póllo on November 18 2022

Answers related to “php - application config file stored as - ini,php,sql,cached,php class,json,php array?”

Only authorized users can answer the search term. Please sign in first, or register a free account.