Skip to content

Commit

Permalink
added get env var for db
Browse files Browse the repository at this point in the history
  • Loading branch information
shirosaidev committed May 7, 2024
1 parent 960d9fa commit 1d4d93c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions diskover-web/src/diskover/ConfigDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ public function connect()
require 'config_defaults_web.php';

// Get database file path from config defaults
$this->databaseFilename = $config_defaults_web['DATABASE'];

// Check for env var
$this->databaseFilename = getenv('DATABASE') ?: $config_defaults_web['DATABASE'];

try {
// Open sqlite database
$this->db = new SQLite3($this->databaseFilename);
Expand Down
3 changes: 2 additions & 1 deletion diskover-web/src/diskover/UserDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public function connect()
require 'config_defaults_web.php';

// Get database file path from config defaults
$this->databaseFilename = $config_defaults_web['DATABASE'];
// Check for env var
$this->databaseFilename = getenv('DATABASE') ?: $config_defaults_web['DATABASE'];

try {
// Open sqlite database
Expand Down

0 comments on commit 1d4d93c

Please sign in to comment.