Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
COmanage Registry 2.0.0 (Passing Fad)
Description
The mysql driver was removed from PHP 7.
So this code in DatabaseShell.php fails when the CakePHP configuration has 'datasource' => 'Database/Mysql' and PHP_MAJOR_VERSION >= 7:
$db_driver = explode("/", $db->config['datasource'], 2);
if($db_driver[0] != 'Database')
{ throw new RuntimeException("Unsupported db_method: " . $db_driver[0]); }$dbc = ADONewConnection($db_driver[1]);
The ADOdb preferred driver for PHP 7 is mysqli. See
http://adodb.org/dokuwiki/doku.php?id=v5:database:mysql
A tested solution that works is
$db_driver = explode("/", $db->config['datasource'], 2);
if($db_driver[0] != 'Database')
{ throw new RuntimeException("Unsupported db_method: " . $db_driver[0]); } $db_driverName = $db_driver[1];
if(preg_match("/mysql/i", $db_driverName) && PHP_MAJOR_VERSION >= 7)
$dbc = ADONewConnection($db_driverName);