Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGS-7620] define WP_HOME #115

Merged
merged 13 commits into from
Apr 15, 2024
Merged

[BUGS-7620] define WP_HOME #115

merged 13 commits into from
Apr 15, 2024

Conversation

jazzsequence
Copy link
Contributor

@jazzsequence jazzsequence commented Apr 8, 2024

Adds a new application.pantheon.php file for Pantheon-specific modifications to config/application.php. Checks if WP_HOME is defined in .env and defines it if not.

@jazzsequence jazzsequence marked this pull request as ready for review April 8, 2024 20:11
@jazzsequence jazzsequence requested review from a team as code owners April 8, 2024 20:11
* Pantheon platform application settings.
*
* IMPORTANT NOTE:
* Do not modify this file. This file is maintained by Pantheon.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, Pantheon-managed files in a composer-managed site are brought in via a dependency, e.g. pantheon-systems/drupal-integrations for Drupal sites. For WordPress composer-managed sites, this pattern was not followed because there were not many files to manage this way. Is there any appetite to revisit this decision?

Copy link
Contributor Author

@jazzsequence jazzsequence Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimately, I don't know that that would leave us in a better place than adding a file for Pantheon-maintained modifications as far as merge conflicts. Currently, we're making a one-line change in a part of application.php that is unlikely to change much, if they've changed the file at all. If we added a dependency and moved our modifications there, we'd make changes to the composer.json, which users almost certainly have made modifications to.

Also, environment-specific application.php files is a recommended practice for Bedrock. We're going against the grain a little bit by not using the /environment/ directory, but since our changes apply to the platform and not a specific environment, this seemed to make the most sense. If people are familiar with Bedrock already, having a Pantheon-specific config file won't seem out of place.

I'm not broadly opposed to the idea, but this is also code that would otherwise have already existed in wp-config.php (or wp-config-pantheon.php) and I think it would be weirder to not make it part of the core project.

…ine them

if they're already defined, we don't run this code path
@jazzsequence jazzsequence merged commit f5ccfd5 into default Apr 15, 2024
4 checks passed
@jazzsequence jazzsequence deleted the BUGS-7620-define-wp_home branch April 15, 2024 20:49
jazzsequence added a commit that referenced this pull request Jul 31, 2024
* require a new application.pantheon.php file

* use application.pantheon.php to define WP_HOME
and make it available for future application.php modifications

* ignore internal errors in phpcs rulesets

* linting

* ignore application.pantheon.php filename pattern

* bump actions/cache to v4

* patch set-output with environment var
see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

* add the WP_HOME and WP_SITEURL values to the environment after we define them
if they're already defined, we don't run this code path

* look for the LANDO environment variable to check for Lando

* use the lando environment variable in application.php, too

* fix spacing

* ignore the putenv that we added
jazzsequence added a commit that referenced this pull request Aug 1, 2024
* require a new application.pantheon.php file

* use application.pantheon.php to define WP_HOME
and make it available for future application.php modifications

* ignore internal errors in phpcs rulesets

* linting

* ignore application.pantheon.php filename pattern

* bump actions/cache to v4

* patch set-output with environment var
see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

* add the WP_HOME and WP_SITEURL values to the environment after we define them
if they're already defined, we don't run this code path

* look for the LANDO environment variable to check for Lando

* use the lando environment variable in application.php, too

* fix spacing

* ignore the putenv that we added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants