I've run into an issue.
When running commands via WP-CLI, the $_SERVER['HTTP_HOST'] value isn't populated, so if you have code that uses that value (and expects it to be the current host), the value has to be manually set. I'd like to set this in content/config.php so that it can be included in the project repo. However, $_SERVER['HTTP_HOST'] is used to set constants in wp-config.php before loading config.php. This means that the only way to set the value before it's utilized is in a local-config.php file, which is outside the content folder and so can't be packaged up with a project.
Would it be too messy of a change to declare WP_CONTENT_DIR and load config.php directly after the Load Chassis extensions block? That is, load the project configs immediately after their local overrides. That would allow the project-level config to potentially allow the setting of a number of core values: ABSPATH, $_SERVER['HTTP_HOST'], and by extension all of the constants that are set from $_SERVER['HTTP_HOST'] (such as DOMAIN_CURRENT_SITE, WP_CONTENT_URL, WP_SITEURL, and WP_HOME—all of which might be used in a CLI command and would benefit from having the correct $_SERVER['HTTP_HOST'] value).
I've run into an issue.
When running commands via WP-CLI, the
$_SERVER['HTTP_HOST']value isn't populated, so if you have code that uses that value (and expects it to be the current host), the value has to be manually set. I'd like to set this incontent/config.phpso that it can be included in the project repo. However,$_SERVER['HTTP_HOST']is used to set constants inwp-config.phpbefore loadingconfig.php. This means that the only way to set the value before it's utilized is in alocal-config.phpfile, which is outside thecontentfolder and so can't be packaged up with a project.Would it be too messy of a change to declare
WP_CONTENT_DIRand loadconfig.phpdirectly after theLoad Chassis extensionsblock? That is, load the project configs immediately after their local overrides. That would allow the project-level config to potentially allow the setting of a number of core values:ABSPATH,$_SERVER['HTTP_HOST'], and by extension all of the constants that are set from$_SERVER['HTTP_HOST'](such asDOMAIN_CURRENT_SITE,WP_CONTENT_URL,WP_SITEURL, andWP_HOME—all of which might be used in a CLI command and would benefit from having the correct$_SERVER['HTTP_HOST']value).