MyBB Community Forums

Full Version: Misuse of DB classes' `type` and `engine` properties
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The properties of DB's type and engine defined in https://github.com/mybb/mybb/blob/mybb_1...b_base.php are a bit confusing:
type is The type of db software being used.
engine is The engine used to run the SQL database.

The db connecting process in inc/init.php (https://github.com/mybb/mybb/blob/mybb_1...t.php#L152) would make it clear that:
type is The type of DBMS being used, which as of now would be MySQL, PostgreSQL or SQLite.
engine is The PHP extension (engine or API) used to connect to the SQL database, which could be mysql, mysqli, pgsql, *_pdo or pdo, sqlite or pdo.

So, when referred to the using of different SQL syntax and database systems, type should be used and if the extensions, engine should be used.

Currently, most of type usages look good but a few of engine's seem wrong (should be type I think):
https://github.com/mybb/mybb/blob/mybb_1...b.php#L231
https://github.com/mybb/mybb/blob/mybb_1...b.php#L250
https://github.com/mybb/mybb/blob/mybb_1...db.php#L77
https://github.com/mybb/mybb/blob/mybb_1...db.php#L96
We may want to: