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

Update craftcms project type defaults #4907

Merged
merged 2 commits into from May 13, 2023

Conversation

AugustMiller
Copy link
Contributor

@AugustMiller AugustMiller commented May 12, 2023

The Craft team is gradually shifting its priority to MySQL support over MariaDB, and would prefer this as the default.

This PR also changes the default PHP version to 8.1. New projects/config can still choose their database driver and PHP version via the --database and --php-version flags, if the user desires.

The Issue

MariaDB has slowly drifted away from being a drop-in replacement for MySQL, and this has resulted in some frustration from our community, as well as an increased support burden.

How This PR Solves The Issue

We implemented a new craftCmsConfigOverrideAction function that sets the PHPVersion and Database properties for the current DdevApp, using predefined constants. This function is assigned to the project type’s configOverrideAction so it runs during setup.

Manual Testing Instructions

The current recommended config command…

mkdir ddev-default-db-test
cd ddev-default-db-test
ddev config --project-type=craftcms --docroot=web --create-docroot

…should now produce output like this:

name: ddev-default-db-test
type: craftcms
docroot: web
php_version: "8.1"
webserver_type: nginx-fpm
# ...
database:
    type: mysql
    version: "8.0"

Overrides should still be reflected in the resolved config file, so this command…

ddev config --project-type=craftcms --docroot=web --create-docroot --php-version=8.0 --database=mariadb:10.4

…produces this output:

name: ddev-default-db-test
type: craftcms
docroot: web
php_version: "8.0"
# ...
database:
    type: mariadb
    version: "10.4"

Automated Testing Overview

No automated tests have been added.

Related Issue Link(s)

None

Release/Deployment Notes

  • Craft CMS projects now default to PHP 8.1 and MySQL 8.0.

We are gradually shifting our priority to MySQL support over MariaDB, and would prefer this as the default.
@AugustMiller AugustMiller requested review from a team as code owners May 12, 2023 19:04
@github-actions
Copy link

Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

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

This looks like it should be OK to me. Any thoughts on whether it could impact existing projects? I think it should be OK.

Is the Craft team using mysql:8.0-specific features?

@AugustMiller
Copy link
Contributor Author

AugustMiller commented May 12, 2023

Given that configOverrideAction only comes into effect the first time a configuration is created, I don't see this impacting existing projects.

Craft currently supports MySQL 5.7.8+, but we are evaluating features only available in MySQL 8.x and Postgres for future versions of Craft. We want to put new users in a good place if/when we decide to end support for 5.x (and/or MariaDB).

Edit: We have updated our Minimum + Recommended system requirements to reflect this—basically, this PR brings new DDEV projects into alignment with our official recommendations. 👍

@rfay
Copy link
Member

rfay commented May 13, 2023

I manually tested and brought up default craft cms site, everything works fine, does what it should. Thanks for this contribution!

@rfay rfay merged commit e1cfc65 into ddev:master May 13, 2023
17 of 18 checks passed
@AugustMiller AugustMiller deleted the am-craftcms-default-db branch May 14, 2023 03:01
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.

None yet

2 participants