diff options
Diffstat (limited to 'lib/mysql.php')
-rw-r--r-- | lib/mysql.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/mysql.php b/lib/mysql.php index 025d6af..7b0201d 100644 --- a/lib/mysql.php +++ b/lib/mysql.php @@ -40,9 +40,6 @@ 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; } @@ -55,7 +52,8 @@ namespace { $hash = sha1($hostname . $username . $flags); /* persistent connections start with p: */ - if ($hostname{1} !== ':' && isset(\Dshafik\MySQL::$connections[$hash])) { + /* don't use a cached link for those */ + if (!$new && $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']; |