New answers tagged

2

It's certainly not a bad practice to keep the library configuration elements grouped in a common configuration header. On the contrary ! It eases portability to other environments/architectures and facilitates maintenance/deployment. And the application configuration could be different from the library configuration. The only issue is to avoid name ...


0

Pure config file approach that allows inheritance: Since you're looking to have a set of parent configurations that can be inherited from, could you set up a two tiered configuration file system? Have a "master" and a "specific" file, and if the master and the specific define the same configuration value, then the specific file's value is used. This isn't ...


-1

Here is another mixed approach. I would ask what often changes. Those values can be put in a excel or spread sheet like file. That field will have labels, units, and valid ranges in it for each editable value. The not often changed can go into code. This can go into use in envirment classes. The classes let use cases run, but take are for one envirment the ...


3

I usually keep tests and src completely independent, and not nested under each other. Sources and test sources are typically defined like that. In an application, I usually have following: module /Application ... /src /Form Form.php // Application\Form\Form /test /unit ...


0

I have an idea for mixed approach. We may generate configuration classes from configuration files. I imagine such a mechanism: Each module has a xsd schema for its required configuration. When the schema is changed, the configuration class will regenerated automatically. So, other classes will use configuration programmatically. Profiles will have xml ...


1

The big benefit of a configuration file, be it xml, json, ini, is that it separates data from behavior. This can help keep it readable. You can do this with code as well; you're just not forced to do it. If you'd prefer to stick with configuration files, a way to meet your need to secure your configuration would be to compile your configuration in some ...



Top 50 recent answers are included