diff --git a/Dockerfile b/Dockerfile index 444ed1b221264c2d8eb80251e0e3d54d8b7593ce..7a5b6be4a655b0db550244b300d4d588f2e8008e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ -FROM k8r.eu/justjanne/php:latest +FROM trafex/php-nginx:latest + +USER root RUN apk add --no-cache --update \ - php-json \ - php-pdo_sqlite \ - php-pdo_pgsql + php82-json \ + php82-pdo_sqlite \ + php82-pdo_pgsql USER nobody -ADD . /var/www/html/ \ No newline at end of file +ADD . /var/www/html/ diff --git a/database/Config.php b/database/Config.php index 7df6c1eeaa81881f3744dc12a3da900272c23bd1..6d5070fa7c563f7a8923a887262abed0999ef92f 100644 --- a/database/Config.php +++ b/database/Config.php @@ -20,7 +20,7 @@ class Config $this->database_connector = $database_connector; $this->username = $username; $this->password = $password; - $this->path_prefix = $path_prefix; + $this->path_prefix = rtrim($path_prefix, "/"); $this->backend = $backend; $this->database_options = $options; $this->enable_ranking = $enable_ranking; diff --git a/database/backends/PostgresSmartBackend.php b/database/backends/PostgresSmartBackend.php index 89b2c032d27e2212741ac0df58d25817d64fa2c9..def896323d9aee31a950d450d55ff0427de380f7 100644 --- a/database/backends/PostgresSmartBackend.php +++ b/database/backends/PostgresSmartBackend.php @@ -35,12 +35,19 @@ class PostgresSmartBackend implements Backend function rankingParameters(): array { - return [ - ":config_normalization", - ":weight_content", - ":weight_type", - ":weight_time" - ]; + if ($this->enable_ranking) { + return [ + ":config_normalization", + ":weight_content", + ":weight_type", + ":weight_time" + ]; + } else { + return [ + ":weight_type", + ":weight_time" + ]; + } } private function rankingFunction(): string