How should I store settings for project?
Which is better - to use a $settings
array with all my settings:
$settings[\'max_photos\'] = 30;
//
My two cents: Use both. Most application configuration settings belong in a global array variable. Config data needs to be accessible from diverse application parts, and this is what global variables are for. And keeping everything together in a an array is most sensible. An array can be extended, e.g. some options set in a config.php and the rest read from a config.ini for example.
But there is also a place for CONSTANTS. The fine line to draw is, if an option is really something that MIGHT change during the application runtime, or if it is more a of fixed/magic value. If once set up, you should not change an application setting (or rendering might fail), then this option shouldn't be in the array, but sementically fixed as constant. (That's an interpretative rule of thumb, but served me well.)