Skip to content

do not require check for or creation of civicrm.settings.php to allow… - #365

Open
jackrabbithanna wants to merge 1 commit into
civicrm:masterfrom
jackrabbithanna:allow-existing-civicrm-settings-php
Open

do not require check for or creation of civicrm.settings.php to allow…#365
jackrabbithanna wants to merge 1 commit into
civicrm:masterfrom
jackrabbithanna:allow-existing-civicrm-settings-php

Conversation

@jackrabbithanna

Copy link
Copy Markdown
Contributor

… 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

… using a template, do check if civicrm database tables exist in the civicrm.settings.php CIVICRM_DSN
@christianwach

Copy link
Copy Markdown
Member

@jackrabbithanna This looks like it's getting quite complicated. Do you think it's worth considering a new class to encapsulate Composer compatibility?

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.

2 participants