Bref: Enable the `pdo_mysql` extension by default

Created on 8 Aug 2019  路  6Comments  路  Source: brefphp/bref

Since we include the pdo_mysql extension, I think we should enable by default.

Using a MySQL db is very common with PHP, and I don't think enabling pdo_mysql by default will make anything slower.

What do you think?

enhancement good first issue help wanted

Most helpful comment

I agree with @nealio82 on this one, I don't think there is any needs to do so, for example, not all functions or applications is going to use it, in my case am planning to use bref to do some API calls which don't needs pdo nor pdo_mysql at all, but this does not mean am aginst pdo. Plus, as you said unload an extension is not as easy as enabling a new one.

All 6 comments

PDO is what Laravel uses by default, right? In that case, I vote yes, all the way.

@skyrpex yes this is what most people are using, including Laravel, Doctrine/Symfony, etc.

Out of interest, is there a way to re-disable an enabled extension through php/conf.d/php.ini? For example, at my work we use pdo_pgsql, and so pdo_mysql is just (albeit very tiny) unnecessary overhead.

@nealio82 AFAIK it's not possible to unload an extension, unless by editing the original php.ini that loads it. It could be done via an extra layer, but that is a bit overkill.

I agree with @nealio82 on this one, I don't think there is any needs to do so, for example, not all functions or applications is going to use it, in my case am planning to use bref to do some API calls which don't needs pdo nor pdo_mysql at all, but this does not mean am aginst pdo. Plus, as you said unload an extension is not as easy as enabling a new one.

@nealio82 you could override the default php.ini using the PHP_INI_SCAN_DIR environment variable by leaving out the default scan dir and provide only the configuration you need. So yeah with tricks you could override the default configuration.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akondas picture akondas  路  7Comments

mnapoli picture mnapoli  路  6Comments

t-geindre picture t-geindre  路  4Comments

anandvns picture anandvns  路  8Comments

f3l1x picture f3l1x  路  6Comments