Support separate web root and WordPress core directory#217
Support separate web root and WordPress core directory#217
Conversation
On WP Cloud sites, the web root (/srv/htdocs with wp-content/) and the WordPress core directory (/srv/htdocs/__wp__/ with wp-load.php, wp-admin, wp-includes) can be separate paths. Previously the runner assumed they were always the same directory. This introduces a WP_CORE_DIR env var alongside DOCROOT so subprocess scripts can find WordPress core files independently of the web root. The ExistingSiteResolver auto-detects the core directory by scanning immediate subdirectories for wp-load.php, and a --wp-core-path CLI flag allows explicit configuration.
Keep the language generic since this is a package for all hosts.
3292d9b to
c1ecdbe
Compare
|
I circled back to this doing some testing and am still unable to get the blueprint runner to execute on the WP Cloud environment. To test I checked out this project locally and built the phar that I uploaded to my test site. I tested using the following command and blueprint.json file. The built phar has the new code as it accepts wp-core-path as a known option. blueprints.json testing with. I was looking over this change in more detail and on the WP Cloud environments we have a symlink at The issue is stemming from the following test executed in |
|
@mdbitz thank you for reviewing! I'll revisit this and ping you |
Summary
On WP Cloud sites, the web root and WordPress core directory are separate paths:
/srv/htdocs(containswp-content/)/srv/htdocs/__wp__/(containswp-load.php,wp-includes/,wp-admin/)The blueprint runner previously assumed these were always the same directory. All subprocess scripts used
DOCROOTto find bothwp-content/andwp-load.php, which breaks on split layouts.This PR introduces a
WP_CORE_DIRenvironment variable that points to where WordPress core files live, independent ofDOCROOT(the web root). On standard installs they're identical; on WP Cloud they differ.The
ExistingSiteResolverauto-detects the core directory by scanning immediate subdirectories forwp-load.php, so existing blueprints work without changes. A--wp-core-pathCLI flag is also available for explicit configuration.Test plan
detect_wordpress_core_dir()(standard layout,__wp__/subdirectory, custom subdirectory, no WP found, deeply nested, nonexistent path)RunnerConfiguration(default fallback, explicit override, reset to null)WP_CORE_DIRdefaults toDOCROOT)