File tree Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,9 @@ ddev exec npm run watch
134
134
135
135
### WordPress Configuration Changes
136
136
137
+ When this add-on is added to a WordPress project, DDEV's management of the installation files is turned
138
+ off.
139
+
137
140
The changes this add-on makes to the ` wp-config-ddev.php ` file during installation can be seen below.
138
141
139
142
The ` wp-config-ddev-browserync.php ` file is included before the ` /** WP_HOME URL */ ` comment.
Original file line number Diff line number Diff line change @@ -34,10 +34,23 @@ post_install_actions:
34
34
#ddev-nodisplay
35
35
#ddev-description:Install browsersync settings for WordPress if applicable
36
36
scripts/setup-wordpress-settings.sh
37
+ - |
38
+ #ddev-nodisplay
39
+ #ddev-description:Check for WordPress and disable ddev management of wp-config file
40
+ if [[ $DDEV_PROJECT_TYPE = 'wordpress' ]]; then
41
+ ddev config --disable-settings-management=true;
42
+ fi
43
+
37
44
38
45
removal_actions :
39
46
- |
40
47
#ddev-nodisplay
41
48
#ddev-description:Remove browsersync settings for WordPress if applicable
42
49
rm -f "${DDEV_APPROOT}/wp-config-ddev-browsersync.php"
43
50
scripts/remove-wordpress-settings.sh
51
+ # Don't automatically renable settings management in case user didn't have it enabled in the first place
52
+ - |
53
+ if [[ $DDEV_PROJECT_TYPE = 'wordpress' ]]; then
54
+ echo "Note: You may wish to renable ddev's management of the wp-config file:"
55
+ echo " Run 'ddev config --disable-settings-management=false && ddev restart'"
56
+ fi
Original file line number Diff line number Diff line change 7
7
exit 0
8
8
fi
9
9
10
- if ( ddev debug configyaml 2> /dev/null | grep ' disable_settings_management:\s*true' > /dev/null 2>&1 ) ; then
11
- exit 0
12
- fi
10
+ # if ( ddev debug configyaml 2>/dev/null | grep 'disable_settings_management:\s*true' >/dev/null 2>&1 ) ; then
11
+ # exit 0
12
+ # fi
13
13
14
14
SETTINGS_FILE_NAME=" ${DDEV_APPROOT} /wp-config.php"
15
15
Original file line number Diff line number Diff line change 7
7
exit 0
8
8
fi
9
9
10
- if ( ddev debug configyaml 2> /dev/null | grep ' disable_settings_management:\s*true' > /dev/null 2>&1 ) ; then
11
- exit 0
12
- fi
10
+ # if ( ddev debug configyaml 2>/dev/null | grep 'disable_settings_management:\s*true' >/dev/null 2>&1 ) ; then
11
+ # exit 0
12
+ # fi
13
13
14
14
cp scripts/wp-config-ddev-browsersync.php $DDEV_APPROOT /
15
15
@@ -23,18 +23,17 @@ if grep -q "/\*\* Include for ddev-browsersync to modify WP_HOME and WP_SITEURL.
23
23
fi
24
24
25
25
echo " Adding wp-config-ddev-browsersync.php to: ${SETTINGS_FILE_NAME} "
26
-
26
+
27
27
# Append our code before the ddev config comment.
28
28
awk '
29
- /\/\/ Include for ddev-managed settings in wp-config- ddev.php ./ {
29
+ /\/\/ Include for settings managed by ddev./ {
30
30
print "/** Include for ddev-browsersync to modify WP_HOME and WP_SITEURL. */"
31
31
print "$ddev_browsersync_settings = dirname( __FILE__ ) . \"/wp-config-ddev-browsersync.php\";"
32
- print ""
33
32
print "if ( is_readable( $ddev_browsersync_settings ) ) {"
34
33
print " require_once( $ddev_browsersync_settings );"
35
34
print "}"
36
35
print ""
37
- print "// Include for ddev-managed settings in wp-config- ddev.php ."
36
+ print "// Include for settings managed by ddev."
38
37
next
39
38
}
40
39
{print}
You can’t perform that action at this time.
0 commit comments