66d4fdaa96c0d30d8e48870d73dafce7d140d831
3 * Script to kill a MySQL thread after a specified timeout
9 $wgCommandLineMode = true;
12 ini_set( 'allow_url_fopen', 0 ); # For security...
13 require_once( './LocalSettings.php' );
15 # Windows requires ';' as separator, ':' for Unix
16 $sep = strchr( $include_path = ini_get( 'include_path' ), ';' ) ?
';' : ':';
17 ini_set( 'include_path', "$IP$sep$include_path" );
19 require_once( 'Setup.php' );
21 $wgTitle = Title
::newFromText( wfMsg( 'badtitle' ) );
22 $wgArticle = new Article($wgTitle);
24 if ( !$argv[1] ||
!$argv[2] ) {
30 # Wait for timeout (this process may be killed during this time)
31 $us = floor( $argv[1] * 1000000 ) %
1000000;
32 $s = floor( $argv[1] );
37 $conn = Database
::newFromParams( $wgDBserver, $wgDBsqluser, $wgDBsqlpassword, $wgDBname );
38 $conn->query( 'KILL '.$tid );