The configuration file of TorneLIB is written i JSON-style formatting like the example below, and should normally be put in /etc with the filename tornevall_database.json or tornevall_database
Formatting of configuration
{ "database": { "servers": { "localhost": { "user": "root", "server": "localhost", "password": "password" }, "production": { "user": "root", "server": "remotehost", "password": "password" }, "config":{ "exceptions":true, "forcenew":true, "mysql_deprecated":false, "timeout":6, "authdetails":false, "mysqldriverpriority": ["mysqli", "pdo", "deprecated"], "blockoverride": [] } } }
TorneLIB configuration is using a bunch of defaults, but may be "overriden" through the configuration file. Some of those configuration rows may also be runtime set. Here's what the parameters doing
Database configuration
Base database configuration
Parameter | Type | Description |
---|---|---|
exceptions | boolean | Allow TorneLIB to throw exceptions into the client. If false, TorneLIB will silently avoid throwing exceptions when it's possible |
forcenew | boolean | Force new database connection, each time we're trying to query a database (may sometimes be good during forkings, etc) |
mysql_deprecated | boolean | The deprecated MySQL-driver is normally not accepted by TorneLIB, and it prefers to use the mysqli-driver instead. Setting this paramter to true accepts the deprecated driver |
timeout | integer | Sets a timeout value to the database calls where it's possible. Sometimes there's a need for longer or shorter timeouts. This parameter changes this |
authdetails | boolean | If this parameter is set to false, TorneLIB will return much lesser information on connection failures whether is is possible. Normally, drivers throw more details about what failed on a connection - this parameter suppresses that |
mysqldriverpriority | object | Defines in which order TorneLIB should find a proper driver to use when connecting and makes queries to a MySQL-database. The preferred default order for TorneLIB is mysqli -> pdo -> the deprecated driver |
blockoverride | object | Defines if anything in the configuration should be blocked from overriders. This is good if an attacker somehow got access to the site source code or similar but still has no access to the confguration file and tries to inject override commands into TorneLIB |