* @subpackage Database
[lhc/web/wiklou.git] / includes / killthread.php
index 625bad7..b12eccb 100644 (file)
@@ -1,20 +1,31 @@
 <?php
+/**
+ * Script to kill a MySQL thread after a specified timeout
+ * @package MediaWiki
+ * @subpackage Database
+ */
+
+/**
+ *
+ */
+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' );
+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' );
 
-$wgTitle = Title::newFromText( wfMsg( 'badtitle' ) );
+$wgTitle = Title::newFromText( wfMsgForContent( 'badtitle' ) );
 $wgArticle = new Article($wgTitle);
 
 if ( !$argv[1] || !$argv[2] ) {