? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
15 Mar 2015

This updates JDatabaseDriver::getInstance() to detect if the requested driver is mysql which uses the removed ext/mysql PHP extension in PHP 7 and changes the driver option to mysqli in this environment. A message is logged to the deprecation logger so that a site admin can pick up on the error without disclosing any info to end users.

Note that this is not a guaranteed failsafe; if for whatever reason an environment doesn't have the ext/mysqli PHP extension this will fail.

avatar mbabker mbabker - open - 15 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2015
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2015
Labels Added: ?
avatar zero-24
zero-24 - comment - 15 Mar 2015

@mbabker

Note that this is not a guaranteed failsafe; if for whatever reason an environment doesn't have the ext/mysqli PHP extension this will fail.

Can we not check if mysqli or pdosql is supported and switch to it if it is supported?

avatar zero-24 zero-24 - change - 15 Mar 2015
Category Libraries
avatar zero-24
zero-24 - comment - 15 Mar 2015

maybe we can place now or with 3.4.2 a postinstall message that show all admins that use mysql driver that this gets unsupported with PHP7?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6442.
avatar mbabker
mbabker - comment - 15 Mar 2015

I wouldn't go the post-install route right now. It's still far too early (PHP 7 isn't even in alpha phase yet) and as the forums have shown with this last release, users get in a panic and don't understand what to do when we suggested they update .htaccess or robots.txt.

I've retooled it to try and check support for the other drivers and switch to them. If no other driver is supported, it will just fail; otherwise it'll prefer MySQLi over PDO MySQL.

avatar zero-24
zero-24 - comment - 15 Mar 2015

Looks good :+1: I will try to test if i get some time.

avatar wilsonge
wilsonge - comment - 16 Mar 2015

Would it be better for long term to try and upgrade users to PDO rather than mysqli?

avatar mbabker
mbabker - comment - 16 Mar 2015

PDO isn't installed as commonly as the mysqli extension.

avatar mbabker
mbabker - comment - 10 May 2015

This and #6433 really just need top level decisions at this point then merging into a branch. It's much easier to keep working on PHP 7 compatibility issues if PRs are merged somewhere...

avatar wilsonge wilsonge - change - 11 May 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-05-11 00:08:58
Closed_By wilsonge
avatar wilsonge wilsonge - close - 11 May 2015
avatar wilsonge wilsonge - reference | 9fecfa2 - 11 May 15
avatar wilsonge wilsonge - merge - 11 May 2015
avatar wilsonge wilsonge - close - 11 May 2015
avatar wilsonge wilsonge - change - 11 May 2015
Milestone Added:
avatar mbabker mbabker - head_ref_deleted - 11 May 2015

Add a Comment

Login with GitHub to post a comment