Merge pull request #780 from J0WI/tbl-prefix

Avoid empty table prefix
This commit is contained in:
Tilo Spannagel 2019-06-22 19:08:34 +02:00 committed by GitHub
commit ea5b853ab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 40 additions and 40 deletions

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'

View File

@ -23,7 +23,9 @@ if (getenv('SQLITE_DATABASE')) {
} }
if ($autoconfig_enabled) { if ($autoconfig_enabled) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX') ?: ""; if (getenv('NEXTCLOUD_TABLE_PREFIX')) {
$AUTOCONFIG["dbtableprefix"] = getenv('NEXTCLOUD_TABLE_PREFIX');
}
$AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data"; $AUTOCONFIG["directory"] = getenv('NEXTCLOUD_DATA_DIR') ?: "/var/www/html/data";
} }

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'

View File

@ -73,8 +73,6 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"' install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016 # shellcheck disable=SC2016
@ -82,7 +80,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
install=false install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database" echo "Installing with SQLite database"
# shellcheck disable=SC2016 # shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"' install_options=$install_options' --database-name "$SQLITE_DATABASE"'