summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavey Shafik <me@daveyshafik.com>2017-01-10 19:41:34 -0800
committerDavey Shafik <me@daveyshafik.com>2017-01-10 19:41:34 -0800
commitf97a21e6788eef7c114f8080ed2d44c798486502 (patch)
tree19d0aa35690b16000580adcb9f6f79de909a6b4c
parent3ae199a61119dfe727e9180c2c610d9ac021ff35 (diff)
downloadphp7-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)
-rw-r--r--lib/mysql.php18
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,