diff options
author | Davey Shafik <me@daveyshafik.com> | 2020-08-11 01:26:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 01:26:06 -0700 |
commit | 97688a6f874e67cbd967392c0086db241f203683 (patch) | |
tree | e62cd1a5e841ae4c6e3052e4ca10c92382ae64ef /lib/mysql.php | |
parent | 4b796ffef0834a7b167f9e8536f6d164933ff6ae (diff) | |
parent | db8266f22ccd67bdaefc2332f4748ce323bc139d (diff) | |
download | php7-mysql-shim-97688a6f874e67cbd967392c0086db241f203683.zip php7-mysql-shim-97688a6f874e67cbd967392c0086db241f203683.tar.gz php7-mysql-shim-97688a6f874e67cbd967392c0086db241f203683.tar.bz2 |
Merge pull request #52 from dshafik/fixup-tests
Add Codespaces support & Fixup Tests
Diffstat (limited to 'lib/mysql.php')
-rw-r--r-- | lib/mysql.php | 6 |
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']; |