Skip to content

Commit 5d59de3

Browse files
committed
fix: Improve tdb error handling when config.php is invalid
1 parent f4a24c4 commit 5d59de3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bin/tdb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ config_output=$( eval "$php_command /bin/zsh -i -c 'cd $remote_path && config_va
121121
if [[ "$config_output" =~ "dataroot is not configured properly" ]]; then
122122
echo -e "\x1B[33m\$CFG->dataroot is not configured properly, directory does not exist or is not accessible.\x1B[0m"
123123
exit
124-
elif [[ "$config_output" =~ "Parse error" ]]; then
124+
elif [[ "$config_output" =~ "Parse error" || "$config_output" =~ "Fatal error" || "$config_output" =~ "Warning" || "$config_output" =~ "Notice" ]]; then
125125
echo -e "\x1B[33mThe site config.php is invalid or the currently running PHP container version is incompatible with this totara version.\nDouble check your config.php and/or try stopping all running php containers and up the correct container for this site.\x1B[0m"
126126
exit
127127
elif [[ "$config_output" =~ "Creating default object from empty value" ]]; then

0 commit comments

Comments
 (0)