mirror of
https://github.com/zokradonh/kopano-docker
synced 2025-06-07 16:06:14 +00:00
Rework php cfg handling a bit (#135)
* make sed matching a bit more strict * append settings if not found instead of throwing error fixes #133
This commit is contained in:
parent
905bdf0edd
commit
48e22da9d1
6
Makefile
6
Makefile
@ -58,7 +58,7 @@ build-simple:
|
||||
build-base:
|
||||
component=base make build
|
||||
|
||||
build-core:
|
||||
build-core: build-base
|
||||
component=core make build
|
||||
|
||||
build-konnect:
|
||||
@ -70,7 +70,7 @@ build-kwmserver:
|
||||
build-ldap-demo:
|
||||
component=ldap_demo make build-simple
|
||||
|
||||
build-meet:
|
||||
build-meet: build-base
|
||||
component=meet make build
|
||||
|
||||
build-playground:
|
||||
@ -91,7 +91,7 @@ build-utils: build-core
|
||||
build-web:
|
||||
component=web make build-simple
|
||||
|
||||
build-webapp:
|
||||
build-webapp: build-base
|
||||
component=webapp make build
|
||||
|
||||
build-zpush:
|
||||
|
@ -13,22 +13,22 @@ php_cfg_gen() {
|
||||
local cfg_setting="$2"
|
||||
local cfg_value="$3"
|
||||
if [ -e "$cfg_file" ]; then
|
||||
if grep -q "$cfg_setting" "$cfg_file"; then
|
||||
echo "Setting $cfg_setting = $cfg_value in $cfg_file"
|
||||
case $cfg_value in
|
||||
true|TRUE|false|FALSE)
|
||||
echo boolean value
|
||||
sed -ri "s#(\s*define).+${cfg_setting}.+#\tdefine(\x27${cfg_setting}\x27, ${cfg_value}\);#g" "$cfg_file"
|
||||
;;
|
||||
*)
|
||||
sed -ri "s#(\s*define).+${cfg_setting}.+#\tdefine(\x27${cfg_setting}\x27, \x27${cfg_value}\x27\);#g" "$cfg_file"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "Error: Config option $cfg_setting not found in $cfg_file"
|
||||
echo "Setting $cfg_setting = $cfg_value in $cfg_file"
|
||||
if ! grep -q "$cfg_setting" "$cfg_file"; then
|
||||
echo "WARNING: Config option $cfg_setting not found in $cfg_file! You may have misspelled the confing setting."
|
||||
echo "define('$cfg_setting', '$cfg_value');" >> "$cfg_file"
|
||||
cat "$cfg_file"
|
||||
exit 1
|
||||
return
|
||||
fi
|
||||
case $cfg_value in
|
||||
true|TRUE|false|FALSE)
|
||||
echo boolean value
|
||||
sed -ri "s#(\s*define).+${cfg_setting}'.+#\tdefine(\x27${cfg_setting}\x27, ${cfg_value}\);#g" "$cfg_file"
|
||||
;;
|
||||
*)
|
||||
sed -ri "s#(\s*define).+${cfg_setting}'.+#\tdefine(\x27${cfg_setting}\x27, \x27${cfg_value}\x27\);#g" "$cfg_file"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "Error: Config file $cfg_file not found. Plugin not installed?"
|
||||
local dir
|
||||
|
Loading…
x
Reference in New Issue
Block a user