summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavey Shafik <me@daveyshafik.com>2020-08-11 17:37:58 +0000
committerDavey Shafik <me@daveyshafik.com>2020-08-11 17:37:58 +0000
commit5ae66da8c47b4c1aa08a16411fc6cf1806671072 (patch)
treeb43438e961f39e6d96f67f6df8d836c6a0a784b2 /lib
parenta764528d59b24550c71c34ec67ebb68d00daae29 (diff)
parent97688a6f874e67cbd967392c0086db241f203683 (diff)
downloadphp7-mysql-shim-5ae66da8c47b4c1aa08a16411fc6cf1806671072.zip
php7-mysql-shim-5ae66da8c47b4c1aa08a16411fc6cf1806671072.tar.gz
php7-mysql-shim-5ae66da8c47b4c1aa08a16411fc6cf1806671072.tar.bz2
Merge branch 'master' of https://github.com/dshafik/php7-mysql-shim
Diffstat (limited to 'lib')
-rw-r--r--lib/mysql.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mysql.php b/lib/mysql.php
index 527ba3b..924d68f 100644
--- a/lib/mysql.php
+++ b/lib/mysql.php
@@ -40,6 +40,10 @@ namespace {
$new = false,
$flags = 0
) {
+ if ($new !== false) {
+ trigger_error('Argument $new is no longer supported in PHP > 7', E_USER_WARNING);
+ }
+
if (null === $hostname) {
$hostname = ini_get('mysqli.default_host') ?: null;
}
@@ -53,7 +57,7 @@ namespace {
$hash = sha1($hostname . $username . $flags);
/* persistent connections start with p: */
/* don't use a cached link for those */
- if (!$new && $hostname[1] !== ':' && isset(\Dshafik\MySQL::$connections[$hash])) {
+ if ($hostname[1] !== ':' && isset(\Dshafik\MySQL::$connections[$hash])) {
\Dshafik\MySQL::$last_connection = \Dshafik\MySQL::$connections[$hash]['conn'];
\Dshafik\MySQL::$connections[$hash]['refcount'] += 1;
return \Dshafik\MySQL::$connections[$hash]['conn'];