File tree 13 files changed +91
-0
lines changed 13 files changed +91
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
Original file line number Diff line number Diff line change @@ -152,6 +152,13 @@ if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROT
152
152
153
153
EOPHP
154
154
chown " $user :$group " wp-config.php
155
+ elif [ -e wp-config.php ] && [ -n " $WORDPRESS_CONFIG_EXTRA " ] && [[ " $( < wp-config.php) " != * " $WORDPRESS_CONFIG_EXTRA " * ]]; then
156
+ # (if the config file already contains the requested PHP code, don't print a warning)
157
+ echo >&2
158
+ echo >&2 ' WARNING: environment variable "WORDPRESS_CONFIG_EXTRA" is set, but "wp-config.php" already exists'
159
+ echo >&2 ' The contents of this variable will _not_ be inserted into the existing "wp-config.php" file.'
160
+ echo >&2 ' (see https://github.com/docker-library/wordpress/issues/333 for more details)'
161
+ echo >&2
155
162
fi
156
163
157
164
# see http://stackoverflow.com/a/2705678/433558
You can’t perform that action at this time.
0 commit comments