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