Remove some unused variables
Add some braces
This commit is contained in:
parent
702ff3c5f2
commit
86fd539c32
10 changed files with 11 additions and 15 deletions
|
|
@ -30,12 +30,15 @@ function wfProfileIn( $fn = '' ) {
|
|||
*/
|
||||
function wfProfileOut( $fn = '' ) {
|
||||
global $hackwhere, $wgDBname, $haveProctitle;
|
||||
if( !$haveProctitle )
|
||||
if( !$haveProctitle ) {
|
||||
return;
|
||||
if( count( $hackwhere ) )
|
||||
}
|
||||
if( count( $hackwhere ) ) {
|
||||
array_pop( $hackwhere );
|
||||
if( count( $hackwhere ) )
|
||||
}
|
||||
if( count( $hackwhere ) ) {
|
||||
setproctitle( $hackwhere[count( $hackwhere )-1] . " [$wgDBname]" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ class ApiProtect extends ApiBase {
|
|||
global $wgUser, $wgRestrictionLevels;
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
$titleObj = null;
|
||||
|
||||
$titleObj = Title::newFromText( $params['title'] );
|
||||
if ( !$titleObj ) {
|
||||
$this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ class ApiQueryAllmessages extends ApiQueryBase {
|
|||
$prop = array_flip( (array)$params['prop'] );
|
||||
|
||||
// Determine which messages should we print
|
||||
$messages_target = array();
|
||||
if ( in_array( '*', $params['messages'] ) ) {
|
||||
$message_names = array_keys( Language::getMessagesFor( 'en' ) );
|
||||
sort( $message_names );
|
||||
|
|
|
|||
|
|
@ -43,13 +43,13 @@ class ApiQueryUserInfo extends ApiQueryBase {
|
|||
public function execute() {
|
||||
$params = $this->extractRequestParams();
|
||||
$result = $this->getResult();
|
||||
$r = array();
|
||||
|
||||
if ( !is_null( $params['prop'] ) ) {
|
||||
$this->prop = array_flip( $params['prop'] );
|
||||
} else {
|
||||
$this->prop = array();
|
||||
}
|
||||
|
||||
$r = $this->getCurrentUserInfo();
|
||||
$result->addValue( 'query', $this->getModuleName(), $r );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ class ApiUndelete extends ApiBase {
|
|||
global $wgUser;
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
$titleObj = null;
|
||||
|
||||
if ( !$wgUser->isAllowed( 'undelete' ) ) {
|
||||
$this->dieUsageMsg( array( 'permdenied-undelete' ) );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ function wfSpecialNewimages( $par, $specialPage ) {
|
|||
} else {
|
||||
$ts = false;
|
||||
}
|
||||
$sql = '';
|
||||
|
||||
# If we were clever, we'd use this to cache.
|
||||
$latestTimestamp = wfTimestamp( TS_MW, $ts );
|
||||
|
|
@ -100,7 +99,7 @@ function wfSpecialNewimages( $par, $specialPage ) {
|
|||
$where[] = "img_timestamp >= '" . $dbr->timestamp( $from ) . "'";
|
||||
$invertSort = true;
|
||||
}
|
||||
$sql='SELECT img_size, img_name, img_user, img_user_text,'.
|
||||
$sql = 'SELECT img_size, img_name, img_user, img_user_text,'.
|
||||
"img_description,img_timestamp FROM $image";
|
||||
|
||||
if( $hidebotsql ) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ class SpecialTags extends SpecialPage {
|
|||
$wgOut->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' );
|
||||
|
||||
// Write the headers
|
||||
$html = '';
|
||||
$html = Xml::tags( 'tr', null, Xml::tags( 'th', null, wfMsgExt( 'tags-tag', 'parseinline' ) ) .
|
||||
Xml::tags( 'th', null, wfMsgExt( 'tags-display-header', 'parseinline' ) ) .
|
||||
Xml::tags( 'th', null, wfMsgExt( 'tags-description-header', 'parseinline' ) ) .
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ This gives a huge speed improvement for very large links tables which are MyISAM
|
|||
|
||||
global $wgContLang;
|
||||
|
||||
$tuplesAdded = $numBadLinks = $curRowsRead = 0; # counters etc
|
||||
$numBadLinks = $curRowsRead = 0; # counters etc
|
||||
$totalTuplesInserted = 0; # total tuples INSERTed into links_temp
|
||||
|
||||
$reportCurReadProgress = true; # whether or not to give progress reports while reading IDs from cur table
|
||||
|
|
|
|||
|
|
@ -47,8 +47,9 @@ class ReassignEdits extends Maintenance {
|
|||
$report = $this->hasOption( 'report' );
|
||||
$count = $this->doReassignEdits( $from, $to, !$this->hasOption( 'norc' ), $report );
|
||||
# If reporting, and there were items, advise the user to run without --report
|
||||
if ( $report )
|
||||
if ( $report ) {
|
||||
$this->output( "Run the script again without --report to update.\n" );
|
||||
}
|
||||
} else {
|
||||
$ton = $to->getName();
|
||||
$this->error( "User '{$ton}' not found." );
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ class StorageTypeStats extends Maintenance {
|
|||
exit( 1 );
|
||||
}
|
||||
|
||||
$rangeStart = 0;
|
||||
$binSize = intval( pow( 10, floor( log10( $endId ) ) - 3 ) );
|
||||
if ( $binSize < 100 ) {
|
||||
$binSize = 100;
|
||||
|
|
|
|||
Loading…
Reference in a new issue