mandrasch / ddev-pull-wp-scripts

Inofficial DDEV pull scripts for happy local WordPress development.
https://ddev-pull-wp.mandrasch.eu/
Creative Commons Zero v1.0 Universal
21 stars 6 forks source link

Add better support / warnings for wp-config.php quote variants #3

Closed mandrasch closed 1 month ago

mandrasch commented 2 years ago

The scripts provided here parses out config settings like DB_NAME from wp-config.php.

See:

Settings for wp-config.php can be written in 3 styles:


// single quotes
define('DB_NAME', 'my-db');

// double quotes
define("DB_NAME", "my-db");

// mixed quotes
define('DB_NAME', "my-db");

Currently only single quotes are supported, which causes problems for users, e.g. https://github.com/mandrasch/ddev-pull-wp-scripts/issues/2.

A better regex could get values from all three variants.

If anyone is a pro, I'm happy to receive PRs for this challenge 👍

Tekime commented 1 month ago

Submitted a PR to support multiple quote types: https://github.com/mandrasch/ddev-pull-wp-scripts/pull/5

Tested with single, double, and mixed successfully for me.

Thanks!

mandrasch commented 1 month ago

Thanks very much!