Skip to content

Commit

Permalink
Merge pull request #780 from J0WI/tbl-prefix
Browse files Browse the repository at this point in the history
Avoid empty table prefix
  • Loading branch information
tilosp authored Jun 22, 2019
2 parents df04887 + a87f914 commit ea5b853
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 40 deletions.
4 changes: 3 additions & 1 deletion .config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 3 additions & 1 deletion 14.0/apache/config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 1 addition & 3 deletions 14.0/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down
4 changes: 3 additions & 1 deletion 14.0/fpm-alpine/config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 1 addition & 3 deletions 14.0/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down
4 changes: 3 additions & 1 deletion 14.0/fpm/config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 1 addition & 3 deletions 14.0/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down
4 changes: 3 additions & 1 deletion 15.0/apache/config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 1 addition & 3 deletions 15.0/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down
4 changes: 3 additions & 1 deletion 15.0/fpm-alpine/config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 1 addition & 3 deletions 15.0/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down
4 changes: 3 additions & 1 deletion 15.0/fpm/config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 1 addition & 3 deletions 15.0/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down
4 changes: 3 additions & 1 deletion 16.0/apache/config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 1 addition & 3 deletions 16.0/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down
4 changes: 3 additions & 1 deletion 16.0/fpm-alpine/config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 1 addition & 3 deletions 16.0/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down
4 changes: 3 additions & 1 deletion 16.0/fpm/config/autoconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
}

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";
}
4 changes: 1 addition & 3 deletions 16.0/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down
4 changes: 1 addition & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
if [ -n "${NEXTCLOUD_TABLE_PREFIX+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --database-table-prefix "$NEXTCLOUD_TABLE_PREFIX"'
else
install_options=$install_options' --database-table-prefix ""'
fi
if [ -n "${NEXTCLOUD_DATA_DIR+x}" ]; then
# shellcheck disable=SC2016
install_options=$install_options' --data-dir "$NEXTCLOUD_DATA_DIR"'
fi

install=false
if [ -n "${SQLITE_DATABASE+x}" ]; then
if [ -n "${SQLITE_DATABASE+x}" ]; then
echo "Installing with SQLite database"
# shellcheck disable=SC2016
install_options=$install_options' --database-name "$SQLITE_DATABASE"'
Expand Down

0 comments on commit ea5b853

Please sign in to comment.