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