New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] The driver name is misleading #18661
Comments
MySQLi is still MySQLi. Because of how things got named with the Framework and it dropping |
That's confusing. When I tried using However, that's most definitely a blatant lie. I am using MySQLi with Joomla! 3. On the other hand if I use So, to sum it up:
Um, did I break everything as soon as I touched it? :D |
In the service provider we mapped "pdomysql" to "mysql" so sites didn't crash and burn on updating. So that's why using that can still work. https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php#L350 is the support check for MySQLi. The part that might be tripping you up is the presence of |
/me confused |
OK, now it makes perfect sense! After RTFMing a little bit it seems that prepared statements are only available with the mysqlnd driver. This is, in fact, not available on my system. Humph. I'll have to check the build options. Now, Joomla! 4 looks for prepared statement support. Since it's missing (per the explanation above) it believes that the MySQLi driver is missing. This explains why I couldn't see it in the installer or use it. The mapping of pdomysql to mysql makes perfect sense now, thank you. And since PDO always supports prepared statements we can use it just fine. I think you need to document that mysqlnd is required and warn people in the installer if MySQLi is available but it doesn't use mysqlnd. This would at least point users to the right direction for solving installation issues. Not to mention that this has to be a pre-upgrade check. I am closing this issue as I consider it resolved for the scope that I submitted it. |
Steps to reproduce the issue
Look at the
configuration.php-dist
Expected result
The driver name
mysqli
with the trailing i is accurate.Actual result
If you try to use that you get a crash. The MySQLi driver name in Joomla! 4 is
mysql
, notmysqli
.System information (as much as possible)
Irrelevant.
Additional comments
IMHO this is a bad choice for naming the driver.
Problem for users: they have heard us tell them for years that MySQL is deprecated and they should be using MySQLi. The literature (documentation, forum posts, blog posts) out there says you should use MySQLi. There is a discrepancy between what the PHP information reports (MySQLi with the trailing i) and what Joomla! expects in configuration.php.
Problem for developers: Granted, not many of us are affected. Probably just me and the Falang guys. When I'm restoring your backups I don't know which Joomla! version you are using with absolute certainty. I check which PHP extensions are available and give you the relevant options. Now I have to somehow magically figure out when you are using Joomla! 4 and map MySQLi to MySQL which I can guarantee will be a source of bugs.
I would keep the driver consistently named mysqli with the trailing i to save everyone's sanity. Knowing that this is Joomla!, where sanity comes to die, I am preparing to add yet another layer of compatibility in my software and God help me :)
The text was updated successfully, but these errors were encountered: