// Has it got a comma already?
if ( strpos( $lastEltPath, '@extra' ) === false && !$lastEltInfo['hasComma'] ) {
// No comma, insert one after the value region
- list( $start, $end ) = $this->findValueRegion( $lastEltPath );
+ list( , $end ) = $this->findValueRegion( $lastEltPath );
$this->replaceSourceRegion( $end - 1, $end - 1, ',' );
}
list( $start, $end ) = $this->findDeletionRegion( $lastEltPath );
if ( $key === null ) {
- list( $indent, $arrowIndent ) = $this->getIndent( $start );
+ list( $indent, ) = $this->getIndent( $start );
$textToInsert = "$indent$value,";
} else {
list( $indent, $arrowIndent ) =
if ( $firstEltPath === false ) {
throw new MWException( "Can't find array element of \"$path\"" );
}
- list( $start, $end ) = $this->findDeletionRegion( $firstEltPath );
+ list( $start, ) = $this->findDeletionRegion( $firstEltPath );
$info = $this->pathInfo[$firstEltPath];
// Make the text to insert
if ( $key === null ) {
- list( $indent, $arrowIndent ) = $this->getIndent( $start );
+ list( $indent, ) = $this->getIndent( $start );
$textToInsert = "$indent$value,";
} else {
list( $indent, $arrowIndent ) =
} else {
reset( $a );
reset( $b );
- while( ( list( $keyA, $valueA ) = each( $a ) ) && ( list( $keyB, $valueB ) = each( $b ) ) ) {
+ while( ( list( , $valueA ) = each( $a ) ) && ( list( , $valueB ) = each( $b ) ) ) {
$cmp = strcmp( $valueA, $valueB );
if ( $cmp !== 0 ) {
return $cmp;
$this->loadFile();
- $full_url = $this->displayImg->getURL();
$sizeSel = intval( $wgUser->getOption( 'imagesize' ) );
if ( !isset( $wgImageLimits[$sizeSel] ) ) {
$sizeSel = User::getDefaultOption( 'imagesize' );
continue;
}
if ( preg_match( $regex, $text, $m ) ) {
- list( $id, $param ) = $this->parseMatch( $m );
+ list( $id, ) = $this->parseMatch( $m );
if ( strlen( $m[0] ) >= strlen( $text ) ) {
$text = '';
} else {
$ret = call_user_func_array( $this->siteParamsCallback, array( $this, $wiki ) );
# Validate the returned value
- if( !is_array( $ret ) )
+ if( !is_array( $ret ) ) {
return $default;
+ }
foreach( $default as $name => $def ){
if( !isset( $ret[$name] ) || ( is_array( $default[$name] ) && !is_array( $ret[$name] ) ) )
$this->markDown();
return;
}
- list( $all, $major, $minor, $status, $reason ) = $m;
+ list( , , , $status, $reason ) = $m;
$status = intval( $status );
if ( $status !== 200 && $status !== 404 ) {
$this->log( "unexpected status code: $status $reason" );
}
foreach ( $readSockets as $key => $socket ) {
- list( $clientIndex, $i ) = explode( '/', $key );
+ list( $clientIndex, ) = explode( '/', $key );
$client = $this->clients[$clientIndex];
$client->doReads();
}
foreach ( $writeSockets as $key => $socket ) {
- list( $clientIndex, $i ) = explode( '/', $key );
+ list( $clientIndex, ) = explode( '/', $key );
$client = $this->clients[$clientIndex];
$client->doWrites();
}
throw new MWException( "Unstub loop detected on call of \${$this->mGlobal}->$name from $caller\n" );
}
wfDebug( "Unstubbing \${$this->mGlobal} on call of \${$this->mGlobal}::$name from $caller\n" );
- $obj = $GLOBALS[$this->mGlobal] = $this->_newObject();
+ $GLOBALS[$this->mGlobal] = $this->_newObject();
--$recursionLevel;
wfProfileOut( $fname );
}
if( $wgRequest->getVal( 'printable' ) === 'yes' ) {
$wgOut->setPrintable();
}
- $ret = null;
+
$curid = $wgRequest->getInt( 'curid' );
if( $curid ) {
// URLs like this are generated by RC, because rc_title isn't always accurate
wfDebug( "DB connection error\n" );
wfDebug( "Server: $server, User: $user, Password: " .
substr( $password, 0, 3 ) . "..., error: " . mysql_error() . "\n" );
- $success = false;
}
wfProfileOut("dbconnect-$server");
}
function newMainLB( $wiki = false ) {
- list( $dbName, $prefix ) = $this->getDBNameAndPrefix( $wiki );
+ list( $dbName, ) = $this->getDBNameAndPrefix( $wiki );
$section = $this->getSectionForWiki( $wiki );
$groupLoads = array();
if ( isset( $this->groupLoadsByDB[$dbName] ) ) {
$keepReading = $this->reader->read();
while( $keepReading ) {
if( $this->reader->name == $name && $this->reader->nodeType == XmlReader::END_ELEMENT ) {
- $keepReading = false;
break;
} elseif( $this->reader->nodeType == XmlReader::TEXT ){
$this->metadata[$metafield] = $this->reader->value;
while( $keepReading ) {
if( $this->reader->name == $name && $this->reader->depth <= $exitDepth
&& $this->reader->nodeType == XmlReader::END_ELEMENT ) {
- $keepReading = false;
break;
- } elseif( $this->reader->nodeType == XmlReader::ELEMENT ){
+ } elseif ( $this->reader->nodeType == XmlReader::ELEMENT ) {
switch( $this->reader->name ) {
case 'animate':
case 'set':
$namespace = NS_MAIN;
} else {
list( $namespace, $fromKey, $from ) = $fromList;
- list( $namespace2, $toKey, $to ) = $toList;
+ list( , $toKey, $to ) = $toList;
$dbr = wfGetDB( DB_SLAVE );
$conds = array(
*/
function doQuery( $offset, $limit, $shownavigation=true ) {
global $wgOut;
- list( $this->mMungedQuery, $clause ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt );
+ list( $this->mMungedQuery, ) = LinkSearchPage::mungeQuery( $this->mQuery, $this->mProt );
if( $this->mMungedQuery === false ) {
$wgOut->addWikiMsg( 'linksearch-error' );
} else {
protected function setupPage( $term ) {
global $wgOut;
// Figure out the active search profile header
- $nsAllSet = array_keys( SearchEngine::searchableNamespaces() );
if( $this->searchAdvanced ) {
$this->active = 'advanced';
} else {
# Possible where conditions
$conds = array();
- if( $days <= 0 ) {
- $andcutoff = '';
- } else {
+ if( $days > 0 ) {
$conds[] = "rc_timestamp > '".$dbr->timestamp( time() - intval( $days * 86400 ) )."'";
}
$localFile = $this->getLocalFile();
$filename = $localFile->getName();
$n = strrpos( $filename, '.' );
- $partname = $n ? substr( $filename, 0, $n ) : $filename;
/**
* Check whether the resulting filename is different from the desired one,
return null;
}
$extension = $this->getExtension();
- list( $thumbExt, $thumbMime ) = $this->handler->getThumbType( $extension, $this->getMimeType(), $params );
+ list( $thumbExt, ) = $this->handler->getThumbType( $extension, $this->getMimeType(), $params );
$thumbName = $this->getHandler()->makeParamString( $params ) . '-' . $urlName;
if ( $thumbExt != $extension ) {
$thumbName .= ".$thumbExt";
if ( $this->hasArg() ) {
$this->desyncFixPage( $this->getArg() );
} else {
- $dbw = wfGetDB( DB_MASTER );
- $maxPage = $dbw->selectField( 'page', 'MAX(page_id)', false, __METHOD__ );
$corrupt = $this->findPageLatestCorruption();
foreach ( $corrupt as $id => $dummy ) {
$this->desyncFixPage( $id );
if ( $to->getId() || $this->hasOption( 'force' ) ) {
# Reassign the edits
$report = $this->hasOption( 'report' );
- $count = $this->doReassignEdits( $from, $to, !$this->hasOption( 'norc' ), $report );
+ $this->doReassignEdits( $from, $to, !$this->hasOption( 'norc' ), $report );
# If reporting, and there were items, advise the user to run without --report
if ( $report ) {
$this->output( "Run the script again without --report to update.\n" );
$this->error( 'restore text', "Error: invalid URL \"{$row->old_text}\"", $row->old_id );
continue;
}
- list( $proto, $path ) = $urlParts;
+ list( $proto, ) = $urlParts;
if ( $proto != 'DB' ) {
$this->error( 'restore text', "Error: invalid external protocol \"$proto\"", $row->old_id );
continue;
$titleText = 'Parser test';
}
- $noxml = isset( $opts['noxml'] );
$local = isset( $opts['local'] );
$preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null;
$parser = $this->getParser( $preprocessor );
'lgname' => $user->username,
'lgpassword' => $user->password
);
- list( $result, $request, $session ) = $this->doApiRequest( $params );
+ list( $result, , ) = $this->doApiRequest( $params );
$this->assertArrayHasKey( "login", $result );
$this->assertArrayHasKey( "result", $result['login'] );
$this->assertEquals( "NeedToken", $result['login']['result'] );
'lgname' => $user->username,
'lgpassword' => $user->password
);
- list( $result, $request, $session ) = $this->doApiRequest( $params );
+ list( $result, , $session ) = $this->doApiRequest( $params );
$this->assertArrayHasKey( "login", $result );
$this->assertArrayHasKey( "result", $result['login'] );
$this->assertEquals( "Success", $result['login']['result'] );
$exception = false;
try {
- list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session );
+ list( $result, , ) = $this->doApiRequestWithToken( $params, $session );
} catch ( UsageException $e ) {
$exception = true;
}
$exception = false;
try {
- list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session );
+ $this->doApiRequestWithToken( $params, $session );
} catch ( UsageException $e ) {
$this->assertContains( 'The file you submitted was empty', $e->getMessage() );
$exception = true;
$exception = false;
try {
- list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session );
+ list( $result, , $session ) = $this->doApiRequestWithToken( $params, $session );
} catch ( UsageException $e ) {
$exception = true;
}
$exception = false;
try {
- list( $result, $request, $session ) = $this->doApiRequestWithToken( $params, $session );
+ list( $result, , ) = $this->doApiRequestWithToken( $params, $session );
} catch ( UsageException $e ) {
$exception = true;
}
$command = wfEscapeShellArg( $wgImageMagickConvertCommand ) . " " . implode( " ", $args );
$retval = null;
- $output = wfShellExec( $command, $retval );
+ wfShellExec( $command, $retval );
return ( $retval === 0 );
}
-
-
/**
* Generate a string of random colors for ImageMagick, like "rgb(12, 37, 98)"
*