Skip to content

Commit

Permalink
Add envvar to switch dbtype
Browse files Browse the repository at this point in the history
  • Loading branch information
williammck committed Jun 16, 2023
1 parent 671374a commit b23af6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ You'll also need to configure some way of running Moodle's cron job, such as a c

* `WWW_ROOT` - The URL of the Moodle instance, used for generating links in emails and other places. Defaults to `http://localhost`.
* `SSL_PROXY` - The presence of this environment variable will enable the `sslproxy` setting in Moodle.
* `DB_TYPE` - The type of database to use, currently either `mysqli` or `mariadb`. Defaults to `mysqli`.
* `DB_HOST` - The hostname of the database server. Defaults to `127.0.0.1`.
* `DB_PORT` - The port of the database server. Defaults to `3306`.
* `DB_DATABASE` - The name of the database to use. Defaults to `moodle`.
Expand Down
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Database configuration
*/

$CFG->dbtype = 'mysqli';
$CFG->dbtype = getenv('DB_TYPE') ?: 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = getenv('DB_HOST') ?: '127.0.0.1';
$CFG->dbname = getenv('DB_DATABASE') ?: 'moodle';
Expand Down

0 comments on commit b23af6a

Please sign in to comment.