From: <var...@us...> - 2016-02-08 09:01:30
|
Revision: 9775 http://sourceforge.net/p/phpwiki/code/9775 Author: vargenau Date: 2016-02-08 09:01:28 +0000 (Mon, 08 Feb 2016) Log Message: ----------- mysql --> mysqli Modified Paths: -------------- trunk/lib/WikiDB/backend/PearDB_mysqli.php Modified: trunk/lib/WikiDB/backend/PearDB_mysqli.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_mysqli.php 2016-02-04 20:50:31 UTC (rev 9774) +++ trunk/lib/WikiDB/backend/PearDB_mysqli.php 2016-02-08 09:01:28 UTC (rev 9775) @@ -2,10 +2,6 @@ require_once 'lib/WikiDB/backend/PearDB.php'; -// See http://sql-info.de/mysql/gotchas.html for mysql specific quirks. - -// The slowest function overall is mysql_connect with [680ms] -// 2nd is db_mysql::simpleQuery with [257ms] class WikiDB_backend_PearDB_mysqli extends WikiDB_backend_PearDB { @@ -26,7 +22,7 @@ } // esp. needed for utf databases if ($this->_serverinfo['version'] > 401.0) { - mysql_query("SET NAMES 'UTF-8'"); + mysqli_set_charset($this->_dbh->connection, 'UTF-8'); } } } @@ -37,15 +33,15 @@ function _timeout() { if (empty($this->_dbparams['timeout'])) return; - $result = mysql_query("SHOW processlist"); - while ($row = mysql_fetch_array($result)) { + $result = mysqli_query($this->_dbh->connection, "SHOW processlist"); + while ($row = mysqli_fetch_array($result)) { if ($row["db"] == $this->_dbh->dsn['database'] and $row["User"] == $this->_dbh->dsn['username'] and $row["Time"] > $this->_dbparams['timeout'] and $row["Command"] == "Sleep" ) { $process_id = $row["Id"]; - mysql_query("KILL $process_id"); + mysqli_query($this->_dbh->connection, "KILL $process_id"); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |