Skip to content

updates wp-config.php template, updates fingerprint to work for stock wp - #112

Closed
tannerjfco wants to merge 2 commits into
ddev:masterfrom
tannerjfco:new-wp-tpl
Closed

tannerjfco wants to merge 2 commits into
ddev:masterfrom
tannerjfco:new-wp-tpl

Conversation

@tannerjfco

@tannerjfco tannerjfco commented Mar 29, 2017 •

Copy link
Copy Markdown
Contributor

The Problem:

As noted in #107, our current wp-config.php template provides many optional configurations and assumptions, and does not work for a normal wordpress site. Our template should only provide the minimal configuration necessary to deploy a site, and leave the rest to the user to define via use of a wp-config.local.php or wp-config.custom.php as necessary.

The Fix:

This introduces a new wp-config.php template. It only configures the database credentials, and auto-generates hash salts. This is equivalent to what would be configured for you from the site installation process.

This PR additionally updates the path "fingerprint" for wordpress to a pattern that should be satisfied on a stock wp setup. The previous looked for a custom core directory 'wp'. This new fingerprint won't work for sites w/ custom core dirs, they will need to manually specify their site type.

The Test:

This is currently difficult to test, as you need to import to really test, and we don't have a good test candidate for stock wp yet. It does not make sense to me to create one for this change since we are about to remove the archive dependence. The intent to opening this PR is to ensure this updated configuration is known and available to whoever ends up moving on the import changes, as they will need a config file that can run a stock wp site. As such, this is WIP.

Automation Overview:

Our current test coverage for config file writing simply ensure the file is written, it does not verify contents. I could add that if we think it would be useful. Otherwise, I am open to consider further test coverages to introduce.

Related Issue Link(s):

#107 update wp-config template
#32 wordpress support
#33 asset import for local plugin.

Release/Deployment notes:

Does this affect anything else, or are there ramifications for other code? Does anything have to be done on deployment?

I removed the following configurations, believing they can be defined in a custom config file as needed. They are not required for stock wp, but they would be required for a site that used them previously. If users are good with defining these in a custom config file, we're good. If not, we would need to provide prompts for these in ddev config so that a valid config file could be written for these sites.

  • WP_HOME - define URL of the site in config. The default behavior is for this to be read from WP's options table.
  • WP_SITEURL - define URL of the site's core files in config. The default behavior is for this to be read from WP's options table, and unless the site is using a custom core directory, would match the value of WP_HOME
  • custom core directory: This allows core files to be put into their own directory. It is defined as part of WP_SITEURL, and would be appended to the ABSPATH definition that is used to bootstrap wordpress.

I removed many more configurations beyond these, but none of them are critical to a site's operation and should be simple to define as needed.

@tannerjfco

Copy link
Copy Markdown
Contributor Author

I have introduced this as part of the work in #123 introducing the new import-db and import-files commands.

@tannerjfco tannerjfco closed this Apr 3, 2017
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.

1 participant