From f97a21e6788eef7c114f8080ed2d44c798486502 Mon Sep 17 00:00:00 2001 From: Davey Shafik Date: Tue, 10 Jan 2017 19:41:34 -0800 Subject: Check ext/mysqli is available (for non-composer installs) --- lib/mysql.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/mysql.php b/lib/mysql.php index d95abdc..cd45f46 100644 --- a/lib/mysql.php +++ b/lib/mysql.php @@ -21,13 +21,17 @@ namespace { if (!extension_loaded('mysql')) { - define ('MYSQL_ASSOC', 1); - define ('MYSQL_NUM', 2); - define ('MYSQL_BOTH', 3); - define ('MYSQL_CLIENT_COMPRESS', 32); - define ('MYSQL_CLIENT_SSL', 2048); - define ('MYSQL_CLIENT_INTERACTIVE', 1024); - define ('MYSQL_CLIENT_IGNORE_SPACE', 256); + if (!extension_loaded('mysqli')) { + trigger_error('php7-mysql-shim: ext/mysqli is required', E_USER_ERROR); + } + + define('MYSQL_ASSOC', 1); + define('MYSQL_NUM', 2); + define('MYSQL_BOTH', 3); + define('MYSQL_CLIENT_COMPRESS', 32); + define('MYSQL_CLIENT_SSL', 2048); + define('MYSQL_CLIENT_INTERACTIVE', 1024); + define('MYSQL_CLIENT_IGNORE_SPACE', 256); function mysql_connect( $hostname = null, -- cgit v1.1