[TYPO3-core] MySQL to MySQLi: The "small change" way
Ernesto Baschny [cron IT]
ernst at cron-it.de
Tue Mar 26 17:05:59 CET 2013
Stefan Neufeind schrieb am 25.03.2013 20:00:
> We've discussed a few times that it might in the short run be useful to
> migrate from MySQL to MySQLi, especially since the PHP-versions we
> meanwhile require ship MySQLi anyway and some might decide to drop MySQL
> in a not too distant future.
php.net states: "mysql has been deprecated as of PHP 5.5.0 and will be
removed in the future".
> It was suggested, and I fully agree, that a clean solution allowing
> multiple database-connection, maybe abstraction with the DBAL-relevant
> part of Doctrine would be great to have. And I'll be happy to also work
> on that - maybe/hopefully for 6.2 then.
> (But that's a separate discussion I won't want to start here.)
> I've given it a quick try how much is needed to turn DatabaseConnection
> into using MySQLi, as a short-stop solution. And the change seems
> actually reasonably small imho. See https://review.typo3.org/19280
Small steps sounds like a good idea.
I can imagine that this could break existing extensions that were
previously accessing t3lib_db (I mean...
TYPO3\CMS\Core\Database\DatabaseConnection) directly (i.e.
$TYPO3_DB->link) or XCLASSing it and internally calling mysql*() methods.
> This has not yet been checked in connection with DBAL or the like or
> with a fresh intropackage-install without an existing DB. But that
> should require only minimum adjustments here or there.
DBAL XCLASSes t3lib_db, and internally calls some mysql*() methods and
accesses this->link. So it needs to be adapted at the same time for it
to continue to work.
adodb (which is the abstraction layer below DBAL) provides a driver for
mysqli too, which DBAL could use already.
The Installer also checks for the "mysql" extension, this would also
need to be adapted, I guess.
> It would be great if some core-devs could make up their mind about it.
> And if you don't want it for 6.1, I hope somebody will start working on
> the "big solution" for 6.2 then.
> But I see this "small" change as a first step to "raise the bar" with
> 6.1 to now require MySQLi - with a not too large change codewise.
So we should do "something" at last for 6.2 LTS, because it will
probably out-live PHP 5.5 and we want it TYPO3 LTS continue working by
Doing the "experiment" of switching from mysql to mysqli in 6.1 seems
like a good compromise.
Meanwhile we could start working on a "better replacement" for TYPO3_DB,
but we will have to stick to our deprecation strategy (only deprecate
TYPO3_DB as soon as the whole core is not using it anymore). I doubt
that we have time to acchieve that until 6.2, so that could be a
candidate project for the versions to come (7.0?).
More information about the TYPO3-team-core