3 * Script to kill a MySQL thread after a specified timeout
10 if( php_sapi_name() != 'cli' ) {
14 define( 'MEDIAWIKI', 1 );
15 $wgCommandLineMode = true;
18 ini_set( 'allow_url_fopen', 0 ); # For security...
19 require_once( '../LocalSettings.php' );
21 if( !$wgAllowSysopQueries ) {
22 die( "Queries disabled.\n" );
25 require_once( 'Setup.php' );
27 $wgTitle = Title
::newFromText( wfMsgForContent( 'badtitle' ) );
28 $wgArticle = new Article($wgTitle);
30 if ( !$argv[1] ||
!$argv[2] ) {
36 # Wait for timeout (this process may be killed during this time)
37 $us = floor( $argv[1] * 1000000 ) %
1000000;
38 $s = floor( $argv[1] );
43 $conn = Database
::newFromParams( $wgDBserver, $wgDBsqluser, $wgDBsqlpassword, $wgDBname );
44 $conn->query( 'KILL '.$tid );