<?php
+/**
+ * Script to kill a MySQL thread after a specified timeout
+ * @package MediaWiki
+ */
+
+/**
+ *
+ */
+if( php_sapi_name() != 'cli' ) {
+ die('');
+}
-# Script to kill a MySQL thread after a specified timeout
-
+define( 'MEDIAWIKI', 1 );
$wgCommandLineMode = true;
unset( $IP );
-ini_set( "allow_url_fopen", 0 ); # For security...
-require_once( "./LocalSettings.php" );
+ini_set( 'allow_url_fopen', 0 ); # For security...
+require_once( '../LocalSettings.php' );
-# Windows requires ';' as separator, ':' for Unix
-$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
-ini_set( "include_path", "$IP$sep$include_path" );
+if( !$wgAllowSysopQueries ) {
+ die( "Queries disabled.\n" );
+}
-require_once( "Setup.php" );
+require_once( 'Setup.php' );
-$wgTitle = Title::newFromText( wfMsg( "badtitle" ) );
+$wgTitle = Title::newFromText( wfMsgForContent( 'badtitle' ) );
$wgArticle = new Article($wgTitle);
if ( !$argv[1] || !$argv[2] ) {
# Kill DB thread
$conn = Database::newFromParams( $wgDBserver, $wgDBsqluser, $wgDBsqlpassword, $wgDBname );
-$conn->query( "KILL $tid" );
+$conn->query( 'KILL '.$tid );
?>