Update formatting in maintenance/ (3/4)
Change-Id: I4390c4ea12a6a626b0e6817b6446635116ca9fe3
This commit is contained in:
parent
f2f31fadc7
commit
5a77286a1e
40 changed files with 227 additions and 163 deletions
|
|
@ -50,6 +50,7 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
|
|||
$db = wfGetDB( DB_MASTER );
|
||||
if ( !$db->tableExists( 'externallinks' ) ) {
|
||||
$this->error( "externallinks table does not exist" );
|
||||
|
||||
return false;
|
||||
}
|
||||
$this->output( "Fixing protocol-relative entries in the externallinks table...\n" );
|
||||
|
|
@ -91,6 +92,7 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
|
|||
);
|
||||
}
|
||||
$this->output( "Done, $count rows updated.\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ class FixSlaveDesync extends Maintenance {
|
|||
}
|
||||
}
|
||||
$this->output( "\n" );
|
||||
|
||||
return $desync;
|
||||
}
|
||||
|
||||
|
|
@ -136,6 +137,7 @@ class FixSlaveDesync extends Maintenance {
|
|||
if ( !$found ) {
|
||||
$this->output( "page_id $pageID seems fine\n" );
|
||||
$dbw->commit( __METHOD__ );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,11 +85,11 @@ class FixTimestamps extends Maintenance {
|
|||
if ( $sign == 0 || $sign == $expectedSign ) {
|
||||
// Monotonic change
|
||||
$lastNormal = $timestamp;
|
||||
++ $numGoodRevs;
|
||||
++$numGoodRevs;
|
||||
continue;
|
||||
} elseif ( abs( $delta ) <= $grace ) {
|
||||
// Non-monotonic change within grace interval
|
||||
++ $numGoodRevs;
|
||||
++$numGoodRevs;
|
||||
continue;
|
||||
} else {
|
||||
// Non-monotonic change larger than grace interval
|
||||
|
|
@ -100,7 +100,7 @@ class FixTimestamps extends Maintenance {
|
|||
$numBadRevs = count( $badRevs );
|
||||
if ( $numBadRevs > $numGoodRevs ) {
|
||||
$this->error(
|
||||
"The majority of revisions in the search interval are marked as bad.
|
||||
"The majority of revisions in the search interval are marked as bad.
|
||||
|
||||
Are you sure the offset ($offset) has the right sign? Positive means the clock
|
||||
was incorrectly set forward, negative means the clock was incorrectly set back.
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class GenerateJsonI18n extends Maintenance {
|
|||
|
||||
if ( $this->hasOption( 'shim-only' ) ) {
|
||||
$this->shimOnly( $phpfile, $jsondir );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -184,6 +185,7 @@ PHP;
|
|||
$jsondir = str_replace( '\\', '/', $jsondir );
|
||||
$shim = str_replace( '{{OUT}}', $jsondir, $shim );
|
||||
$shim = str_replace( '{{FUNC}}', 'wfJsonI18nShim' . wfRandomString( 16 ), $shim );
|
||||
|
||||
return $shim;
|
||||
}
|
||||
|
||||
|
|
@ -216,6 +218,7 @@ PHP;
|
|||
protected function getAuthorsFromComment( $comment ) {
|
||||
$matches = null;
|
||||
preg_match_all( '/@author (.*?)$/m', $comment, $matches );
|
||||
|
||||
return $matches && $matches[1] ? $matches[1] : array();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,6 +263,7 @@ class GenerateSitemap extends Maintenance {
|
|||
global $wgSitemapNamespaces;
|
||||
if ( is_array( $wgSitemapNamespaces ) ) {
|
||||
$this->namespaces = $wgSitemapNamespaces;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -343,7 +344,7 @@ class GenerateSitemap extends Maintenance {
|
|||
|
||||
$fns = $wgContLang->getFormattedNsText( $namespace );
|
||||
$this->output( "$namespace ($fns)\n" );
|
||||
$skippedRedirects = 0; // Number of redirects skipped for that namespace
|
||||
$skippedRedirects = 0; // Number of redirects skipped for that namespace
|
||||
foreach ( $res as $row ) {
|
||||
if ( $this->skipRedirects && $row->page_is_redirect ) {
|
||||
$skippedRedirects++;
|
||||
|
|
@ -415,6 +416,7 @@ class GenerateSitemap extends Maintenance {
|
|||
throw new MWException( __METHOD__
|
||||
. " error opening file $file with flags $flags. Check permissions?" );
|
||||
}
|
||||
|
||||
return $resource;
|
||||
}
|
||||
|
||||
|
|
@ -457,6 +459,7 @@ class GenerateSitemap extends Maintenance {
|
|||
*/
|
||||
function sitemapFilename( $namespace, $count ) {
|
||||
$ext = $this->compress ? '.gz' : '';
|
||||
|
||||
return "sitemap-{$this->identifier}-NS_$namespace-$count.xml$ext";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class GetConfiguration extends Maintenance {
|
|||
$format = strtolower( $this->getOption( 'format', 'PHP' ) );
|
||||
|
||||
$validFormat = in_array( $format, self::$outFormats );
|
||||
if ( ! $validFormat ) {
|
||||
if ( !$validFormat ) {
|
||||
$this->error( "--format set to an unrecognized format", 0 );
|
||||
$error_out = true;
|
||||
}
|
||||
|
|
@ -87,11 +87,11 @@ class GetConfiguration extends Maintenance {
|
|||
public function finalSetup() {
|
||||
parent::finalSetup();
|
||||
|
||||
$this->regex = $this->getOption( 'regex' ) ?: $this->getOption( 'iregex' );
|
||||
$this->regex = $this->getOption( 'regex' ) ? : $this->getOption( 'iregex' );
|
||||
if ( $this->regex ) {
|
||||
$this->regex = '/' . $this->regex . '/';
|
||||
if ( $this->hasOption( 'iregex' ) ) {
|
||||
$this->regex .= 'i'; # case insensitive regex
|
||||
$this->regex .= 'i'; # case insensitive regex
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ class GetConfiguration extends Maintenance {
|
|||
$res = array();
|
||||
|
||||
# Sane default: dump any wg / wmg variable
|
||||
if ( ! $this->regex && ! $this->getOption( 'settings' ) ) {
|
||||
if ( !$this->regex && !$this->getOption( 'settings' ) ) {
|
||||
$this->regex = '/^wm?g/';
|
||||
}
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ class GetConfiguration extends Maintenance {
|
|||
protected function formatVarDump( $res ) {
|
||||
$ret = '';
|
||||
foreach ( $res as $key => $value ) {
|
||||
ob_start(); # intercept var_dump() output
|
||||
ob_start(); # intercept var_dump() output
|
||||
print "\${$key} = ";
|
||||
var_dump( $value );
|
||||
# grab var_dump() output and discard it from the output buffer
|
||||
|
|
@ -182,10 +182,12 @@ class GetConfiguration extends Maintenance {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} elseif ( is_scalar( $value ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class GetSlaveServer extends Maintenance {
|
|||
$this->addOption( "group", "Query group to check specifically" );
|
||||
$this->mDescription = "Report the hostname of a slave server";
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
global $wgAllDBsAreLocalhost;
|
||||
if ( $wgAllDBsAreLocalhost ) {
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ TEXT;
|
|||
function setNsfilter( array $namespaces ) {
|
||||
if ( count( $namespaces ) == 0 ) {
|
||||
$this->nsFilter = false;
|
||||
|
||||
return;
|
||||
}
|
||||
$this->nsFilter = array_unique( array_map( array( $this, 'getNsIndex' ), $namespaces ) );
|
||||
|
|
@ -143,6 +144,7 @@ TEXT;
|
|||
echo wfBacktrace();
|
||||
$this->error( "Cannot get namespace of object in " . __METHOD__, true );
|
||||
}
|
||||
|
||||
return is_array( $this->nsFilter ) && !in_array( $ns, $this->nsFilter );
|
||||
}
|
||||
|
||||
|
|
@ -157,6 +159,7 @@ TEXT;
|
|||
$title = $rev->getTitle();
|
||||
if ( !$title ) {
|
||||
$this->progress( "Got bogus revision with null title!" );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -189,6 +192,7 @@ TEXT;
|
|||
// bluuuh hack
|
||||
// call_user_func( $this->uploadCallback, $revision );
|
||||
$dbw = wfGetDB( DB_MASTER );
|
||||
|
||||
return $dbw->deadlockLoop( array( $revision, 'importUpload' ) );
|
||||
}
|
||||
}
|
||||
|
|
@ -248,6 +252,7 @@ TEXT;
|
|||
}
|
||||
|
||||
$file = fopen( $filename, 'rt' );
|
||||
|
||||
return $this->importFromHandle( $file );
|
||||
}
|
||||
|
||||
|
|
@ -256,6 +261,7 @@ TEXT;
|
|||
if ( self::posix_isatty( $file ) ) {
|
||||
$this->maybeHelp( true );
|
||||
}
|
||||
|
||||
return $this->importFromHandle( $file );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ function findFiles( $dir, $exts, $recurse = false ) {
|
|||
$files = array_merge( $files, findFiles( $dir . '/' . $file, $exts, true ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $files;
|
||||
} else {
|
||||
return array();
|
||||
|
|
@ -63,9 +64,10 @@ function findFiles( $dir, $exts, $recurse = false ) {
|
|||
*/
|
||||
function splitFilename( $filename ) {
|
||||
$parts = explode( '.', $filename );
|
||||
$ext = $parts[ count( $parts ) - 1 ];
|
||||
unset( $parts[ count( $parts ) - 1 ] );
|
||||
$ext = $parts[count( $parts ) - 1];
|
||||
unset( $parts[count( $parts ) - 1] );
|
||||
$fname = implode( '.', $parts );
|
||||
|
||||
return array( $fname, $ext );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -290,25 +290,24 @@ if ( $count > 0 ) {
|
|||
}
|
||||
|
||||
if ( $doProtect ) {
|
||||
# Protect the file
|
||||
echo "\nWaiting for slaves...\n";
|
||||
// Wait for slaves.
|
||||
sleep( 2.0 ); # Why this sleep?
|
||||
wfWaitForSlaves();
|
||||
# Protect the file
|
||||
echo "\nWaiting for slaves...\n";
|
||||
// Wait for slaves.
|
||||
sleep( 2.0 ); # Why this sleep?
|
||||
wfWaitForSlaves();
|
||||
|
||||
echo "\nSetting image restrictions ... ";
|
||||
echo "\nSetting image restrictions ... ";
|
||||
|
||||
$cascade = false;
|
||||
$restrictions = array();
|
||||
foreach ( $title->getRestrictionTypes() as $type ) {
|
||||
$restrictions[$type] = $protectLevel;
|
||||
}
|
||||
$cascade = false;
|
||||
$restrictions = array();
|
||||
foreach ( $title->getRestrictionTypes() as $type ) {
|
||||
$restrictions[$type] = $protectLevel;
|
||||
}
|
||||
|
||||
$page = WikiPage::factory( $title );
|
||||
$status = $page->doUpdateRestrictions( $restrictions, array(), $cascade, '', $user );
|
||||
echo ( $status->isOK() ? 'done' : 'failed' ) . "\n";
|
||||
$page = WikiPage::factory( $title );
|
||||
$status = $page->doUpdateRestrictions( $restrictions, array(), $cascade, '', $user );
|
||||
echo ( $status->isOK() ? 'done' : 'failed' ) . "\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "failed. (at recordUpload stage)\n";
|
||||
$svar = 'failed';
|
||||
|
|
@ -328,14 +327,21 @@ if ( $count > 0 ) {
|
|||
|
||||
# Print out some statistics
|
||||
echo "\n";
|
||||
foreach ( array( 'count' => 'Found', 'limit' => 'Limit', 'ignored' => 'Ignored',
|
||||
'added' => 'Added', 'skipped' => 'Skipped', 'overwritten' => 'Overwritten',
|
||||
'failed' => 'Failed' ) as $var => $desc ) {
|
||||
foreach (
|
||||
array(
|
||||
'count' => 'Found',
|
||||
'limit' => 'Limit',
|
||||
'ignored' => 'Ignored',
|
||||
'added' => 'Added',
|
||||
'skipped' => 'Skipped',
|
||||
'overwritten' => 'Overwritten',
|
||||
'failed' => 'Failed'
|
||||
) as $var => $desc
|
||||
) {
|
||||
if ( $$var > 0 ) {
|
||||
echo "{$desc}: {$$var}\n";
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "No suitable files could be found for import.\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,13 +65,12 @@ class ImportSiteScripts extends Maintenance {
|
|||
$content = ContentHandler::makeContent( $text, $wikiPage->getTitle() );
|
||||
$wikiPage->doEditContent( $content, "Importing from $url", 0, false, $user );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function fetchScriptList() {
|
||||
$data = array(
|
||||
'action' => 'query',
|
||||
'format' => 'php',//'json',
|
||||
'format' => 'php', //'json',
|
||||
'list' => 'allpages',
|
||||
'apnamespace' => '8',
|
||||
'aplimit' => '500',
|
||||
|
|
@ -100,7 +99,6 @@ class ImportSiteScripts extends Maintenance {
|
|||
} while ( isset( $result['query-continue'] ) );
|
||||
|
||||
return $pages;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,33 +60,29 @@ if ( count( $args ) < 1 || isset( $options['help'] ) ) {
|
|||
$content = ContentHandler::makeContent( $text, $title );
|
||||
$page->doEditContent( $content, $comment, $flags, false, $user );
|
||||
echo "done.\n";
|
||||
|
||||
} else {
|
||||
echo "invalid username.\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "page exists.\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "invalid title.\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "does not exist.\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function titleFromFilename( $filename ) {
|
||||
$parts = explode( '/', $filename );
|
||||
$parts = explode( '.', $parts[ count( $parts ) - 1 ] );
|
||||
$parts = explode( '.', $parts[count( $parts ) - 1] );
|
||||
|
||||
return $parts[0];
|
||||
}
|
||||
|
||||
function showHelp() {
|
||||
print <<<EOF
|
||||
print <<<EOF
|
||||
USAGE: php importTextFile.php <options> <filename>
|
||||
|
||||
<filename> : Path to the file containing page content to import
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ class CommandLineInstaller extends Maintenance {
|
|||
$installer->showMessage( 'config-env-good' );
|
||||
} else {
|
||||
$installer->showStatusMessage( $status );
|
||||
|
||||
return;
|
||||
}
|
||||
if ( !$this->hasOption( 'env-checks' ) ) {
|
||||
|
|
|
|||
|
|
@ -1,88 +1,88 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>MediaWiki Code Example</title>
|
||||
<script src="modules/startup.js"></script>
|
||||
<script>
|
||||
function startUp() {
|
||||
mw.config = new mw.Map();
|
||||
}
|
||||
</script>
|
||||
<script src="modules/jquery/jquery.js"></script>
|
||||
<script src="modules/mediawiki/mediawiki.js"></script>
|
||||
<style>
|
||||
.mw-jsduck-log {
|
||||
position: relative;
|
||||
min-height: 3em;
|
||||
margin-top: 2em;
|
||||
background: #f7f7f7;
|
||||
border: 1px solid #e4e4e4;
|
||||
}
|
||||
<meta charset="utf-8">
|
||||
<title>MediaWiki Code Example</title>
|
||||
<script src="modules/startup.js"></script>
|
||||
<script>
|
||||
function startUp() {
|
||||
mw.config = new mw.Map();
|
||||
}
|
||||
</script>
|
||||
<script src="modules/jquery/jquery.js"></script>
|
||||
<script src="modules/mediawiki/mediawiki.js"></script>
|
||||
<style>
|
||||
.mw-jsduck-log {
|
||||
position: relative;
|
||||
min-height: 3em;
|
||||
margin-top: 2em;
|
||||
background: #f7f7f7;
|
||||
border: 1px solid #e4e4e4;
|
||||
}
|
||||
|
||||
.mw-jsduck-log::after {
|
||||
position: absolute;
|
||||
bottom: 100%;
|
||||
right: -1px;
|
||||
padding: 0.5em;
|
||||
background: #fff;
|
||||
border: 1px solid #e4e4e4;
|
||||
border-bottom: 0;
|
||||
border-radius: 0.5em 0.5em 0 0;
|
||||
font: normal 0.5em sans-serif;
|
||||
content: 'console';
|
||||
}
|
||||
.mw-jsduck-log::after {
|
||||
position: absolute;
|
||||
bottom: 100%;
|
||||
right: -1px;
|
||||
padding: 0.5em;
|
||||
background: #fff;
|
||||
border: 1px solid #e4e4e4;
|
||||
border-bottom: 0;
|
||||
border-radius: 0.5em 0.5em 0 0;
|
||||
font: normal 0.5em sans-serif;
|
||||
content: 'console';
|
||||
}
|
||||
|
||||
.mw-jsduck-log-line {
|
||||
padding: 0.2em 0.5em;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.mw-jsduck-log-line {
|
||||
padding: 0.2em 0.5em;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.mw-jsduck-log-line:nth-child(odd) {
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
.mw-jsduck-log-line:nth-child(odd) {
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
/**
|
||||
* Basic log console for the example iframe in documentation pages.
|
||||
*/
|
||||
( function () {
|
||||
var pre;
|
||||
mw.log = function () {
|
||||
var str, i, len, line;
|
||||
if ( !pre ) {
|
||||
pre = document.createElement( 'pre' );
|
||||
pre.className = 'mw-jsduck-log';
|
||||
document.body.appendChild( pre );
|
||||
}
|
||||
str = [];
|
||||
for ( i = 0, len = arguments.length; i < len; i++ ) {
|
||||
str.push( String( arguments[ i ] ) );
|
||||
}
|
||||
line = document.createElement( 'div' );
|
||||
line.className = 'mw-jsduck-log-line';
|
||||
line.appendChild(
|
||||
document.createTextNode( str.join( ' , ' ) + '\n' )
|
||||
);
|
||||
pre.appendChild( line );
|
||||
};
|
||||
}() );
|
||||
<script>
|
||||
/**
|
||||
* Basic log console for the example iframe in documentation pages.
|
||||
*/
|
||||
( function () {
|
||||
var pre;
|
||||
mw.log = function () {
|
||||
var str, i, len, line;
|
||||
if ( !pre ) {
|
||||
pre = document.createElement( 'pre' );
|
||||
pre.className = 'mw-jsduck-log';
|
||||
document.body.appendChild( pre );
|
||||
}
|
||||
str = [];
|
||||
for ( i = 0, len = arguments.length; i < len; i++ ) {
|
||||
str.push( String( arguments[ i ] ) );
|
||||
}
|
||||
line = document.createElement( 'div' );
|
||||
line.className = 'mw-jsduck-log-line';
|
||||
line.appendChild(
|
||||
document.createTextNode( str.join( ' , ' ) + '\n' )
|
||||
);
|
||||
pre.appendChild( line );
|
||||
};
|
||||
}() );
|
||||
|
||||
/**
|
||||
* Method called by jsduck to execute the example code.
|
||||
*/
|
||||
function loadInlineExample( code, options, callback ) {
|
||||
try {
|
||||
eval( code );
|
||||
callback && callback( true );
|
||||
} catch (e) {
|
||||
mw.log( 'Uncaught exception: ' + e );
|
||||
callback && callback( false, e );
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
/**
|
||||
* Method called by jsduck to execute the example code.
|
||||
*/
|
||||
function loadInlineExample( code, options, callback ) {
|
||||
try {
|
||||
eval( code );
|
||||
callback && callback( true );
|
||||
} catch ( e ) {
|
||||
mw.log( 'Uncaught exception: ' + e );
|
||||
callback && callback( false, e );
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class StatsOutput {
|
|||
wfSuppressWarnings();
|
||||
$return = sprintf( '%.' . $accuracy . 'f%%', 100 * $subset / $total );
|
||||
wfRestoreWarnings();
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ class UcdXmlReader {
|
|||
$xml = $this->open();
|
||||
$this->callback = $callback;
|
||||
|
||||
while ( $xml->name !== 'repertoire' && $xml->next() );
|
||||
while ( $xml->name !== 'repertoire' && $xml->next() ) ;
|
||||
|
||||
while ( $xml->read() ) {
|
||||
if ( $xml->nodeType == XMLReader::ELEMENT ) {
|
||||
|
|
@ -389,7 +389,7 @@ class UcdXmlReader {
|
|||
if ( !$this->xml ) {
|
||||
throw new MWException( __METHOD__ . ": unable to open {$this->fileName}" );
|
||||
}
|
||||
while ( $this->xml->name !== 'ucd' && $this->xml->read() );
|
||||
while ( $this->xml->name !== 'ucd' && $this->xml->read() ) ;
|
||||
$this->xml->read();
|
||||
|
||||
return $this->xml;
|
||||
|
|
@ -450,7 +450,7 @@ class UcdXmlReader {
|
|||
}
|
||||
|
||||
$xml = $this->open();
|
||||
while ( $xml->name !== 'blocks' && $xml->read() );
|
||||
while ( $xml->name !== 'blocks' && $xml->read() ) ;
|
||||
|
||||
while ( $xml->read() ) {
|
||||
if ( $xml->nodeType == XMLReader::ELEMENT ) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class Languages {
|
|||
/** @var array List of languages */
|
||||
protected $mLanguages;
|
||||
|
||||
/** @var array Raw list of the messages in each language */
|
||||
/** @var array Raw list of the messages in each language */
|
||||
protected $mRawMessages;
|
||||
|
||||
/** @var array Messages in each language (except for English), divided to groups */
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class McTest extends Maintenance {
|
|||
foreach ( $servers as $server ) {
|
||||
$this->output(
|
||||
str_pad( $server, $maxSrvLen ),
|
||||
$server # output channel
|
||||
$server # output channel
|
||||
);
|
||||
|
||||
$mcc = new MemCachedClientforWiki( array(
|
||||
|
|
@ -107,6 +107,7 @@ class McTest extends Maintenance {
|
|||
*/
|
||||
private function microtime_float() {
|
||||
list( $usec, $sec ) = explode( " ", microtime() );
|
||||
|
||||
return ( (float)$usec + (float)$sec );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ class MergeMessageFileList extends Maintenance {
|
|||
if ( $fileLines === false ) {
|
||||
$this->hasError = true;
|
||||
$this->error( "Unable to open list file $fileName." );
|
||||
|
||||
return $files;
|
||||
}
|
||||
# Strip comments, discard empty lines, and trim leading and trailing
|
||||
|
|
@ -142,6 +143,7 @@ class MergeMessageFileList extends Maintenance {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ class MinifyScript extends Maintenance {
|
|||
$this->mDescription = "Minify a file or set of files.\n\n" .
|
||||
"If --outfile is not specified, then the output file names will have a .min extension\n" .
|
||||
"added, e.g. jquery.js -> jquery.min.js.";
|
||||
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
|
|
@ -66,6 +65,7 @@ class MinifyScript extends Maintenance {
|
|||
|
||||
// Minify one file
|
||||
$this->minify( $this->getArg( 0 ), $this->getOption( 'outfile' ) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -103,6 +103,7 @@ class MinifyScript extends Maintenance {
|
|||
$this->error( "No file extension, cannot determine type: $fileName" );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
return substr( $fileName, $dotPos + 1 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -152,15 +152,13 @@ You might want to delete the temporary file:
|
|||
---------------------------------------------------
|
||||
|
||||
TEXT
|
||||
);
|
||||
);
|
||||
|
||||
if ( $exitcode !== 0 ) {
|
||||
$this->error( "Something went wrong (exit: $exitcode)\n",
|
||||
$exitcode );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$maintClass = 'MWDocGen';
|
||||
|
|
|
|||
|
|
@ -44,9 +44,9 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
$this->mDescription = "";
|
||||
$this->addOption( 'fix', 'Attempt to automatically fix errors' );
|
||||
$this->addOption( 'suffix', "Dupes will be renamed with correct namespace with " .
|
||||
"<text> appended after the article name", false, true );
|
||||
"<text> appended after the article name", false, true );
|
||||
$this->addOption( 'prefix', "Do an explicit check for the given title prefix " .
|
||||
"appended after the article name", false, true );
|
||||
"appended after the article name", false, true );
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
|
|
@ -138,6 +138,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
foreach ( $spaces as $name => $ns ) {
|
||||
$ok = $this->checkNamespace( $ns, $name, $fix, $suffix ) && $ok;
|
||||
}
|
||||
|
||||
return $ok;
|
||||
}
|
||||
|
||||
|
|
@ -152,6 +153,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
foreach ( $result as $row ) {
|
||||
$prefixes[] = $row['iw_prefix'];
|
||||
}
|
||||
|
||||
return $prefixes;
|
||||
}
|
||||
|
||||
|
|
@ -178,6 +180,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
$ok = $this->resolveConflict( $row, $resolvable, $suffix ) && $ok;
|
||||
}
|
||||
}
|
||||
|
||||
return $ok;
|
||||
}
|
||||
|
||||
|
|
@ -191,6 +194,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
*/
|
||||
private function checkPrefix( $key, $prefix, $fix, $suffix = '' ) {
|
||||
$this->output( "Checking prefix \"$prefix\" vs namespace $key\n" );
|
||||
|
||||
return $this->checkNamespace( $key, $prefix, $fix, $suffix );
|
||||
}
|
||||
|
||||
|
|
@ -231,6 +235,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
foreach ( $result as $row ) {
|
||||
$set[] = $row;
|
||||
}
|
||||
|
||||
return $set;
|
||||
}
|
||||
|
||||
|
|
@ -251,6 +256,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
$row->oldnamespace,
|
||||
$row->oldtitle ) );
|
||||
$this->output( "... *** cannot resolve automatically; illegal title ***\n" );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -265,6 +271,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
$id = $newTitle->getArticleID();
|
||||
if ( $id ) {
|
||||
$this->output( "... *** cannot resolve automatically; page exists with ID $id ***\n" );
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
|
@ -288,6 +295,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
$title = Title::makeTitleSafe( $row->namespace, $row->title );
|
||||
if ( !$title ) {
|
||||
$this->output( "... !!! invalid title\n" );
|
||||
|
||||
return false;
|
||||
}
|
||||
$id = $title->getArticleID();
|
||||
|
|
@ -300,6 +308,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
$this->output( "... *** using suffixed form [[" . $title->getPrefixedText() . "]] ***\n" );
|
||||
}
|
||||
$this->resolveConflictOn( $row, 'page', 'page' );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -326,6 +335,7 @@ class NamespaceConflictChecker extends Maintenance {
|
|||
),
|
||||
__METHOD__ );
|
||||
$this->output( "ok.\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class NukeNS extends Maintenance {
|
|||
$child = $this->runChild( 'NukePage', 'nukePage.php' );
|
||||
$child->deleteRevisions( $revs );
|
||||
$this->purgeRedundantText( true );
|
||||
$n_deleted ++;
|
||||
$n_deleted++;
|
||||
}
|
||||
} else {
|
||||
$this->output( "skip: " . $title->getPrefixedText() . "\n" );
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class AlterSharedConstraints extends Maintenance {
|
|||
|
||||
if ( $wgSharedDB == null ) {
|
||||
$this->output( "Database sharing is not enabled\n" );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -66,29 +67,28 @@ class AlterSharedConstraints extends Maintenance {
|
|||
AND uccpk.table_name = '$ltable'" );
|
||||
while ( ( $row = $result->fetchRow() ) !== false ) {
|
||||
|
||||
$this->output( "Altering {$row['constraint_name']} ..." );
|
||||
$this->output( "Altering {$row['constraint_name']} ..." );
|
||||
|
||||
try {
|
||||
$dbw->query( "ALTER TABLE {$row['table_name']}
|
||||
DROP CONSTRAINT {$wgDBprefix}{$row['constraint_name']}" );
|
||||
} catch ( DBQueryError $exdb ) {
|
||||
if ( $exdb->errno != 2443 ) {
|
||||
throw $exdb;
|
||||
}
|
||||
}
|
||||
|
||||
$deleteRule = $row['delete_rule'] == 'NO ACTION' ? '' : "ON DELETE {$row['delete_rule']}";
|
||||
try {
|
||||
$dbw->query( "ALTER TABLE {$row['table_name']}
|
||||
DROP CONSTRAINT {$wgDBprefix}{$row['constraint_name']}" );
|
||||
} catch ( DBQueryError $exdb ) {
|
||||
if ( $exdb->errno != 2443 ) {
|
||||
throw $exdb;
|
||||
}
|
||||
}
|
||||
|
||||
$deleteRule = $row['delete_rule'] == 'NO ACTION' ? '' : "ON DELETE {$row['delete_rule']}";
|
||||
$dbw->query( "ALTER TABLE {$row['table_name']}
|
||||
ADD CONSTRAINT {$wgDBprefix}{$row['constraint_name']}
|
||||
FOREIGN KEY ({$row['column_name']})
|
||||
REFERENCES {$wgSharedDB}.$stable({$row['pk_column_name']})
|
||||
{$deleteRule} {$row['deferrable']} INITIALLY {$row['deferred']}" );
|
||||
|
||||
$this->output( "DONE\n" );
|
||||
$this->output( "DONE\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$maintClass = "AlterSharedConstraints";
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ class Orphans extends Maintenance {
|
|||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->mDescription = "Look for 'orphan' revisions hooked to pages which don't exist\n" .
|
||||
"and 'childless' pages with no revisions\n" .
|
||||
"Then, kill the poor widows and orphans\n" .
|
||||
"Man this is depressing";
|
||||
"and 'childless' pages with no revisions\n" .
|
||||
"Then, kill the poor widows and orphans\n" .
|
||||
"Man this is depressing";
|
||||
$this->addOption( 'fix', 'Actually fix broken entries' );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,10 +116,10 @@ class CLIParser extends Maintenance {
|
|||
* @return Title object
|
||||
*/
|
||||
protected function getTitle() {
|
||||
$title =
|
||||
$this->getOption( 'title' )
|
||||
$title = $this->getOption( 'title' )
|
||||
? $this->getOption( 'title' )
|
||||
: 'CLIParser';
|
||||
|
||||
return Title::newFromText( $title );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,8 +92,9 @@ TEXT;
|
|||
);
|
||||
if ( $row ) {
|
||||
$this->output( "Category table already populated. Use php " .
|
||||
"maintenance/populateCategory.php\n--force from the command line " .
|
||||
"to override.\n" );
|
||||
"maintenance/populateCategory.php\n--force from the command line " .
|
||||
"to override.\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -141,16 +142,17 @@ TEXT;
|
|||
}
|
||||
|
||||
if ( $dbw->insert(
|
||||
'updatelog',
|
||||
array( 'ul_key' => 'populate category' ),
|
||||
__METHOD__,
|
||||
'IGNORE'
|
||||
)
|
||||
) {
|
||||
'updatelog',
|
||||
array( 'ul_key' => 'populate category' ),
|
||||
__METHOD__,
|
||||
'IGNORE'
|
||||
) ) {
|
||||
$this->output( "Category population complete.\n" );
|
||||
|
||||
return true;
|
||||
} else {
|
||||
$this->output( "Could not insert category population row.\n" );
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ class PopulateFilearchiveSha1 extends LoggedUpdateMaintenance {
|
|||
|
||||
if ( !$dbw->fieldExists( $table, 'fa_sha1', __METHOD__ ) ) {
|
||||
$this->output( "fa_sha1 column does not exist\n\n", true );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ class PopulateImageSha1 extends LoggedUpdateMaintenance {
|
|||
);
|
||||
if ( !$res ) {
|
||||
$this->error( "No such file: $file", true );
|
||||
|
||||
return false;
|
||||
}
|
||||
$this->output( "Populating img_sha1 field for specified files\n" );
|
||||
|
|
|
|||
|
|
@ -56,11 +56,13 @@ class PopulateLogSearch extends LoggedUpdateMaintenance {
|
|||
$db = $this->getDB( DB_MASTER );
|
||||
if ( !$db->tableExists( 'log_search' ) ) {
|
||||
$this->error( "log_search does not exist" );
|
||||
|
||||
return false;
|
||||
}
|
||||
$start = $db->selectField( 'logging', 'MIN(log_id)', false, __FUNCTION__ );
|
||||
if ( !$start ) {
|
||||
$this->output( "Nothing to do.\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
$end = $db->selectField( 'logging', 'MAX(log_id)', false, __FUNCTION__ );
|
||||
|
|
@ -126,8 +128,8 @@ class PopulateLogSearch extends LoggedUpdateMaintenance {
|
|||
// Add item author relations...
|
||||
$log->addRelations( 'target_author_id', $userIds, $row->log_id );
|
||||
$log->addRelations( 'target_author_ip', $userIPs, $row->log_id );
|
||||
// RevisionDelete logs - log events
|
||||
} elseif ( LogEventsList::typeAction( $row, $delTypes, 'event' ) ) {
|
||||
// RevisionDelete logs - log events
|
||||
$params = LogPage::extractParams( $row->log_params );
|
||||
// Param format: <item CSV> [<ofield> <nfield>]
|
||||
if ( count( $params ) < 1 ) {
|
||||
|
|
@ -159,6 +161,7 @@ class PopulateLogSearch extends LoggedUpdateMaintenance {
|
|||
wfWaitForSlaves();
|
||||
}
|
||||
$this->output( "Done populating log_search table.\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ class PopulateLogUsertext extends LoggedUpdateMaintenance {
|
|||
$start = $db->selectField( 'logging', 'MIN(log_id)', false, __METHOD__ );
|
||||
if ( !$start ) {
|
||||
$this->output( "Nothing to do.\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
$end = $db->selectField( 'logging', 'MAX(log_id)', false, __METHOD__ );
|
||||
|
|
@ -77,6 +78,7 @@ class PopulateLogUsertext extends LoggedUpdateMaintenance {
|
|||
wfWaitForSlaves();
|
||||
}
|
||||
$this->output( "Done populating log_user_text field.\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class PopulateParentId extends LoggedUpdateMaintenance {
|
|||
$db = wfGetDB( DB_MASTER );
|
||||
if ( !$db->tableExists( 'revision' ) ) {
|
||||
$this->error( "revision table does not exist" );
|
||||
|
||||
return false;
|
||||
}
|
||||
$this->output( "Populating rev_parent_id column\n" );
|
||||
|
|
@ -56,6 +57,7 @@ class PopulateParentId extends LoggedUpdateMaintenance {
|
|||
$end = $db->selectField( 'revision', 'MAX(rev_id)', false, __FUNCTION__ );
|
||||
if ( is_null( $start ) || is_null( $end ) ) {
|
||||
$this->output( "...revision table seems to be empty, nothing to do.\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
# Do remaining chunk
|
||||
|
|
@ -119,6 +121,7 @@ class PopulateParentId extends LoggedUpdateMaintenance {
|
|||
wfWaitForSlaves();
|
||||
}
|
||||
$this->output( "rev_parent_id population complete ... {$count} rows [{$changed} changed]\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ class PopulateRecentChangesSource extends LoggedUpdateMaintenance {
|
|||
$start = $dbw->selectField( 'recentchanges', 'MIN(rc_id)', false, __METHOD__ );
|
||||
if ( !$start ) {
|
||||
$this->output( "Nothing to do.\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
$end = $dbw->selectField( 'recentchanges', 'MAX(rc_id)', false, __METHOD__ );
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance {
|
|||
$this->error( "archive table does not exist", true );
|
||||
} elseif ( !$db->fieldExists( 'revision', 'rev_len', __METHOD__ ) ) {
|
||||
$this->output( "rev_len column does not exist\n\n", true );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -60,6 +61,7 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance {
|
|||
|
||||
$this->output( "rev_len and ar_len population complete "
|
||||
. "[$rev revision rows, $ar archive rows].\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -76,6 +78,7 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance {
|
|||
$end = $db->selectField( $table, "MAX($idCol)", false, __METHOD__ );
|
||||
if ( !$start || !$end ) {
|
||||
$this->output( "...$table table seems to be empty.\n" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -133,6 +136,7 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance {
|
|||
# This should not happen, but sometimes does (bug 20757)
|
||||
$id = $row->$idCol;
|
||||
$this->output( "Content of $table $id unavailable!\n" );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
|
|||
$this->error( "archive table does not exist", true );
|
||||
} elseif ( !$db->fieldExists( 'revision', 'rev_sha1', __METHOD__ ) ) {
|
||||
$this->output( "rev_sha1 column does not exist\n\n", true );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -63,6 +64,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
|
|||
|
||||
$this->output( "rev_sha1 and ar_sha1 population complete "
|
||||
. "[$rc revision rows, $ac archive rows].\n" );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -78,6 +80,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
|
|||
$end = $db->selectField( $table, "MAX($idCol)", false, __METHOD__ );
|
||||
if ( !$start || !$end ) {
|
||||
$this->output( "...$table table seems to be empty.\n" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -104,6 +107,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
|
|||
$blockEnd += $this->mBatchSize;
|
||||
wfWaitForSlaves();
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
|
@ -131,6 +135,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
|
|||
}
|
||||
}
|
||||
$db->commit( __METHOD__ );
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
|
@ -150,11 +155,13 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
|
|||
$text = $rev->getSerializedData();
|
||||
} catch ( MWException $e ) {
|
||||
$this->output( "Data of revision with {$idCol}={$row->$idCol} unavailable!\n" );
|
||||
|
||||
return false; // bug 22624?
|
||||
}
|
||||
if ( !is_string( $text ) ) {
|
||||
# This should not happen, but sometimes does (bug 20757)
|
||||
$this->output( "Data of revision with {$idCol}={$row->$idCol} unavailable!\n" );
|
||||
|
||||
return false;
|
||||
} else {
|
||||
$db->update( $table,
|
||||
|
|
@ -162,6 +169,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
|
|||
array( $idCol => $row->$idCol ),
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -176,12 +184,14 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
|
|||
$rev = Revision::newFromArchiveRow( $row );
|
||||
} catch ( MWException $e ) {
|
||||
$this->output( "Text of revision with timestamp {$row->ar_timestamp} unavailable!\n" );
|
||||
|
||||
return false; // bug 22624?
|
||||
}
|
||||
$text = $rev->getSerializedData();
|
||||
if ( !is_string( $text ) ) {
|
||||
# This should not happen, but sometimes does (bug 20757)
|
||||
$this->output( "Data of revision with timestamp {$row->ar_timestamp} unavailable!\n" );
|
||||
|
||||
return false;
|
||||
} else {
|
||||
# Archive table as no PK, but (NS,title,time) should be near unique.
|
||||
|
|
@ -196,6 +206,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance {
|
|||
),
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ class PreprocessDump extends DumpIterator {
|
|||
|
||||
public function getStripList() {
|
||||
global $wgParser;
|
||||
|
||||
return $wgParser->getStripList();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ class PPFuzzTester {
|
|||
// It's done by the MW UI, so it's a reasonably legitimate thing to do.
|
||||
global $wgContLang;
|
||||
$s = $wgContLang->normalize( $s );
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +137,8 @@ class PPFuzzTester {
|
|||
|
||||
function pickEntryPoint() {
|
||||
$count = count( $this->entryPoints );
|
||||
return $this->entryPoints[ mt_rand( 0, $count - 1 ) ];
|
||||
|
||||
return $this->entryPoints[mt_rand( 0, $count - 1 )];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -182,6 +184,7 @@ class PPFuzzTest {
|
|||
'text' => $text,
|
||||
'finalTitle' => $finalTitle );
|
||||
}
|
||||
|
||||
return $this->templates[$titleText];
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +214,7 @@ class PPFuzzTest {
|
|||
// "Output type: {$this->outputType}\n" .
|
||||
"Entry point: {$this->entryPoint}\n" .
|
||||
"User: " . ( $this->fancySig ? 'fancy' : 'no-fancy' ) .
|
||||
' ' . var_export( $this->nickname, true ) . "\n" .
|
||||
' ' . var_export( $this->nickname, true ) . "\n" .
|
||||
"Main text: " . var_export( $this->mainText, true ) . "\n";
|
||||
foreach ( $this->templates as $titleText => $template ) {
|
||||
$finalTitle = $template['finalTitle'];
|
||||
|
|
|
|||
|
|
@ -177,7 +177,6 @@ class PurgeChangedFiles extends Maintenance {
|
|||
// Sanity check to avoid data loss
|
||||
$repo->getBackend()->delete( array( 'src' => $file->getPath() ) );
|
||||
$this->verbose( "Deleted orphan file: {$file->getPath()}.\n" );
|
||||
|
||||
} else {
|
||||
$this->error( "File was not deleted: {$file->getPath()}.\n" );
|
||||
}
|
||||
|
|
@ -185,7 +184,6 @@ class PurgeChangedFiles extends Maintenance {
|
|||
|
||||
// Purge items from fileachive table (rows are likely here)
|
||||
$this->purgeFromArchiveTable( $repo, $file );
|
||||
|
||||
} elseif ( $logType === 'move' ) {
|
||||
// Purge the target file as well
|
||||
|
||||
|
|
@ -232,7 +230,6 @@ class PurgeChangedFiles extends Maintenance {
|
|||
// Sanity check to avoid data loss
|
||||
$repo->getBackend()->delete( array( 'src' => $ofile->getPath() ) );
|
||||
$this->output( "Deleted orphan file: {$ofile->getPath()}.\n" );
|
||||
|
||||
} else {
|
||||
$this->error( "File was not deleted: {$ofile->getPath()}.\n" );
|
||||
}
|
||||
|
|
@ -244,6 +241,7 @@ class PurgeChangedFiles extends Maintenance {
|
|||
protected function getDeletedPath( LocalRepo $repo, LocalFile $file ) {
|
||||
$hash = $repo->getFileSha1( $file->getPath() );
|
||||
$key = "{$hash}.{$file->getExtension()}";
|
||||
|
||||
return $repo->getDeletedHashPath( $key ) . $key;
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +255,6 @@ class PurgeChangedFiles extends Maintenance {
|
|||
$this->output( $msg );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$maintClass = "PurgeChangedFiles";
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ class PurgeChangedPages extends Maintenance {
|
|||
}
|
||||
}
|
||||
$lastValueLeft = count( $rows ) ? $rows[count( $rows ) - 1]->$column : null;
|
||||
|
||||
return array( $rows, $lastValueLeft );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,6 @@ class PurgeList extends Maintenance {
|
|||
$u->doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$maintClass = "PurgeList";
|
||||
|
|
|
|||
Loading…
Reference in a new issue