diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2025-04-14 15:21:10 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2025-04-14 15:21:10 +0300 |
| commit | 7e403aae92166de6e83a5ab39738ea8ffe6eb713 (patch) | |
| tree | c6714eb8b826d8eae6cba141634b9a7e8f26cd80 /classes | |
| parent | b154bc7a10e46dc9fa0406996507c4fd410366da (diff) | |
further mysql/DB_TYPE related cleanup
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/Config.php | 7 | ||||
| -rw-r--r-- | classes/Db.php | 2 | ||||
| -rw-r--r-- | classes/Db_Migrations.php | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/classes/Config.php b/classes/Config.php index f8f9aaa18..1921796db 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -18,13 +18,16 @@ class Config { * * or config.php: * - * putenv('TTRSS_DB_TYPE=pgsql'); + * putenv('TTRSS_DB_HOST=my-patroni.example.com'); * * note lack of quotes and spaces before and after "=". * */ - /** database type: pgsql */ + /** this is kept for backwards/plugin compatibility, the only supported database is PostgreSQL + * + * @deprecated could be replaced with default (and only) value: `pgsql` + */ const DB_TYPE = "DB_TYPE"; /** database server hostname */ diff --git a/classes/Db.php b/classes/Db.php index 92bbec8b4..6310d11e3 100644 --- a/classes/Db.php +++ b/classes/Db.php @@ -27,7 +27,7 @@ class Db { $db_port = Config::get(Config::DB_PORT) ? ';port=' . Config::get(Config::DB_PORT) : ''; $db_host = Config::get(Config::DB_HOST) ? ';host=' . Config::get(Config::DB_HOST) : ''; - return Config::get(Config::DB_TYPE) . ':dbname=' . Config::get(Config::DB_NAME) . $db_host . $db_port; + return 'pgsql:dbname=' . Config::get(Config::DB_NAME) . $db_host . $db_port; } // this really shouldn't be used unless a separate PDO connection is needed diff --git a/classes/Db_Migrations.php b/classes/Db_Migrations.php index 62619b377..33bc64a32 100644 --- a/classes/Db_Migrations.php +++ b/classes/Db_Migrations.php @@ -23,7 +23,7 @@ class Db_Migrations { } function initialize(string $root_path, string $migrations_table, bool $base_is_latest = true, int $max_version_override = 0): void { - $this->base_path = "$root_path/" . Config::get(Config::DB_TYPE); + $this->base_path = "$root_path/pgsql"; $this->migrations_path = $this->base_path . "/migrations"; $this->migrations_table = $migrations_table; $this->base_is_latest = $base_is_latest; |