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