#5645 - Re-design how $SITE_INFO works

  • By
  • Added
  • 7 views
Identifier #5645
Issue type Feature request or suggestion
Title Re-design how $SITE_INFO works
Status Open
Tags

Roadmap: Sponsorship (custom)

Handling member Deleted
Addon core
Description The current system of _config.php is not very reliable when you factor in switches for git branches and hostnames. I propose instead of a single _config.php file, we use a similar override system to the sources scripts.

* Have a new site_info directory (no need for site_info_custom as addons would not override these).

* site_info contains default.php, which is the default configuration used (e.g. the old _config.php and the one checked to see if Composr is installed). This one is always loaded up, and is the first one to be loaded. That way, overrides are loaded in later which will change relevant variables to what they should be based on the override.

* both site_info contains git_branch and hostname directories for specifying PHP files to act as overrides based on git branch or by hostname. For example, site_info/git_branch/v11.php would be loaded in when running on the v11 branch of git. site_info/hostname/somesite_com.php would be loaded in when the hostname is somesite.com.

* config_editor would be modified accordingly to specify which config file to edit. (should be renamed to site_info_editor) Note that this interface should omit variables which were left blank on the interface (e.g. use whatever is provided in default.php, or what the software default is if not specified there either). But have some validation when editing default.php to ensure required variables are saved.
Steps to reproduce

Additional information When the installer is run, it overwrites _config.php which may have contained switch conditions based on git or hostname criteria for determining which config to use. It's a pain to have to keep merging these in after every clean install during development. And I believe a directory structure would make keeping these configs more organised.

Also we should stop calling it "config" as that can get confused with the software configuration. It used to be called "info". I think it should match what the global is... "site info".
Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated