In terms of this, the thing to remember here is that we *always* set $g_db_type as part of our config during installation.

 

It’s actually more dangerous to initialize it to some variable. 

 

So for instance, we changed it from mysql->mysqli two months ago ( https://github.com/mantisbt/mantisbt/commit/c13c74b2d23427bcacf9dd3c107115de520a9d4c ). The PHP people have been saying to use mysqli over mysql for several years now, but given that this string never actually gets used as we set the value of db_type from the installer.

 

What it does mean by having it here, is there is a chance you could attempt to initialise mantis/checks with the wrong db driver i.e. for example a) how do you identify a Config error (of db_type not being set) if we set it. There’s a chance you could end up doing $x = new DBLayer(Mysqli) when you that’s not what you actually intend. 

 

P.S. both of those examples would require a serious bug or config problem to be an issue in the first place…

 

 

From: Victor Boctor [mailto:notifications@github.com] 
Sent: 05 April 2014 05:53
To: mantisbt/mantisbt
Cc: grangeway
Subject: Re: [mantisbt] Mantis 2.0 - Database Layer Patch (#156)

 

In config_defaults_inc.php:

> @@ -83,7 +83,7 @@
>   *
>   * @global string $g_db_type
>   */
> -$g_db_type                         = 'mysqli';

Why did mysql no longer the default?

—
Reply to this email directly or view it on GitHub <https://github.com/mantisbt/mantisbt/pull/156/files#r11320016> .  <https://github.com/notifications/beacon/434241__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMjI5Mjc1NCwiZGF0YSI6eyJpZCI6MjkzMzYwNTJ9fQ==--91daf6b4dba48746d2b12abbc214f90d57d85b0b.gif>