diff options
author | Davey Shafik <me@daveyshafik.com> | 2017-01-10 19:41:34 -0800 |
---|---|---|
committer | Davey Shafik <me@daveyshafik.com> | 2017-01-10 19:41:34 -0800 |
commit | f97a21e6788eef7c114f8080ed2d44c798486502 (patch) | |
tree | 19d0aa35690b16000580adcb9f6f79de909a6b4c /lib/mysql.php | |
parent | 3ae199a61119dfe727e9180c2c610d9ac021ff35 (diff) | |
download | php7-mysql-shim-f97a21e6788eef7c114f8080ed2d44c798486502.zip php7-mysql-shim-f97a21e6788eef7c114f8080ed2d44c798486502.tar.gz php7-mysql-shim-f97a21e6788eef7c114f8080ed2d44c798486502.tar.bz2 |
Check ext/mysqli is available (for non-composer installs)
Diffstat (limited to 'lib/mysql.php')
-rw-r--r-- | lib/mysql.php | 18 |
1 files 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, |