Add local environment support. #374
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Getting a convenient environment running quickly with sites built on Project Base has often been a matter of developers needing to find what works for them, which makes things very open and free, but for some, they just want something that's there, and that works.
The
wp-envpackage solved this for single plugin, theme, or project setups that were built on a normal WordPress folder, but there was never a good direct solution for sites with composer based setups built on the Bedrock principles, that is, until now!This PR introduces the
bedrock-wp-envpackage, which allows any user with Docker installed the ability to quickly spin up a local environment with a simple call tonpm run env start!The environment is slightly opinionated, while at the same time being as flexible as possible. It uses Apache at its base, which should hopefully save any developers from needing to understand server configurations if plugins or themes require custom redirect rules, they should be able to just rely on WordPress rewrite engine to handle it for them, or to generate the hard written rules if needed.
A set of new files are required for this (but they are only needed locally, this is why they are added to the
.gitignore file); Namely theindex.phpin the project root (there to prevent the Docker images from downloading WordPress core files in duplicate), and the.htaccessfile within the web root folder (public/.htaccessin the case of Project Base).To go along with the new possibility of a local environment, is a new
documentationfolder; The intent of which is two-fold: