From: Brion Vibber Date: Fri, 6 Aug 2004 19:07:55 +0000 (+0000) Subject: Wrap Database::setTimer() in a check for existence of mysql_thread_id() X-Git-Tag: 1.5.0alpha1~2501 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=eda444e2175bad10dc7f3c5297a4c8edebb628d5;p=lhc%2Fweb%2Fwiklou.git Wrap Database::setTimer() in a check for existence of mysql_thread_id() function which was added in 4.3.0. If it's not available, don't set up the thread killer. --- diff --git a/includes/Database.php b/includes/Database.php index b76b2f2a3e..1680761f49 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -650,9 +650,11 @@ class Database { function startTimer( $timeout ) { global $IP; - - $tid = mysql_thread_id( $this->mConn ); - exec( "php $IP/killthread.php $timeout $tid &>/dev/null &" ); + if( function_exists( "mysql_thread_id" ) ) { + # This will kill the query if it's still running after $timeout seconds. + $tid = mysql_thread_id( $this->mConn ); + exec( "php $IP/killthread.php $timeout $tid &>/dev/null &" ); + } } function stopTimer()