do not require check for or creation of civicrm.settings.php to allow… - #365
Open
jackrabbithanna wants to merge 1 commit into
Open
do not require check for or creation of civicrm.settings.php to allow…#365jackrabbithanna wants to merge 1 commit into
jackrabbithanna wants to merge 1 commit into
Conversation
… using a template, do check if civicrm database tables exist in the civicrm.settings.php CIVICRM_DSN
Member
|
@jackrabbithanna This looks like it's getting quite complicated. Do you think it's worth considering a new class to encapsulate Composer compatibility? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
… using a template, do check if civicrm database tables exist in the civicrm.settings.php CIVICRM_DSN
Overview
Now that composer based installations are supported, a next step is leveling up support for automatic deployments to PaaS systems with read only file systems such as Upsun.
For many years the CiviCRM Wordpress plugin installation has checked for whether a civicrm.settings.php exists to determine if CiviCRM was already installed, and if so, then stop the installation process.
This PR checks to see if a CIVICRM_DSN is defined via a civicrm.settings.php file, and if so, checks to see if "civicrm_" tables exist in that database. If not, proceed with installation, if so, halt the installation.
The PR only does this for composer based installations, that is when civicrm-core is discovered in a vendor directory.
Standard installs are not affected.
Before
Installing CiviCRM on PaaS with civicrm.settings.php template provided in repo impossible.
After
Installation is possible
Technical Details
Interesting tangent: https://lab.civicrm.org/dev/wordpress/-/work_items/162
Will update this PR and/or template below based on that work.
Replaces: #362
Comments
Full example composer template: https://github.com/Skvare/upsun-wordpress-bedrock-civicrm-template
Detailed blog article explaining this: https://github.com/jackrabbithanna/wordpress-bedrock-civicrm-upsun-blog/blob/main/civicrm-wordpress-bedrock-on-upsun.md