fix some spacing

Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
This commit is contained in:
umherirrender 2013-03-07 17:50:43 +01:00
parent 1950c39012
commit d63121016d
169 changed files with 283 additions and 434 deletions

View file

@ -393,7 +393,6 @@ class Article implements Page {
return $this->mContent;
}
/**
* Get text content object
* Does *NOT* follow redirects.

View file

@ -182,7 +182,7 @@ $wgAutoloadLocalClasses = array(
'MWNamespace' => 'includes/Namespace.php',
'OldChangesList' => 'includes/ChangesList.php',
'OutputPage' => 'includes/OutputPage.php',
'Page' => 'includes/WikiPage.php',
'Page' => 'includes/WikiPage.php',
'PageQueryPage' => 'includes/PageQueryPage.php',
'Pager' => 'includes/Pager.php',
'PasswordError' => 'includes/User.php',
@ -276,9 +276,9 @@ $wgAutoloadLocalClasses = array(
'WikiError' => 'includes/WikiError.php',
'WikiErrorMsg' => 'includes/WikiError.php',
'WikiExporter' => 'includes/Export.php',
'WikiFilePage' => 'includes/WikiFilePage.php',
'WikiFilePage' => 'includes/WikiFilePage.php',
'WikiImporter' => 'includes/Import.php',
'WikiPage' => 'includes/WikiPage.php',
'WikiPage' => 'includes/WikiPage.php',
'WikiRevision' => 'includes/Import.php',
'WikiMap' => 'includes/WikiMap.php',
'WikiReference' => 'includes/WikiMap.php',
@ -578,8 +578,8 @@ $wgAutoloadLocalClasses = array(
'LSLockManager' => 'includes/filebackend/lockmanager/LSLockManager.php',
'MemcLockManager' => 'includes/filebackend/lockmanager/MemcLockManager.php',
'QuorumLockManager' => 'includes/filebackend/lockmanager/QuorumLockManager.php',
'MySqlLockManager'=> 'includes/filebackend/lockmanager/DBLockManager.php',
'PostgreSqlLockManager'=> 'includes/filebackend/lockmanager/DBLockManager.php',
'MySqlLockManager' => 'includes/filebackend/lockmanager/DBLockManager.php',
'PostgreSqlLockManager' => 'includes/filebackend/lockmanager/DBLockManager.php',
'NullLockManager' => 'includes/filebackend/lockmanager/LockManager.php',
'FileOp' => 'includes/filebackend/FileOp.php',
'FileOpBatch' => 'includes/filebackend/FileOpBatch.php',

View file

@ -307,7 +307,7 @@ class Block {
# This has the nice property that a /32 block is ranked equally with a
# single-IP block, which is exactly what it is...
$score = self::TYPE_RANGE - 1 + ( $size / 128 );
$score = self::TYPE_RANGE - 1 + ( $size / 128 );
} else {
$score = $block->getType();

View file

@ -144,7 +144,6 @@ class CdbReader_DBA {
}
}
/**
* Writer class which uses the DBA extension
*/

View file

@ -579,7 +579,6 @@ class ChangesList extends ContextSource {
}
}
/**
* Generate a list of changes using the good old system (no javascript)
*/
@ -692,7 +691,6 @@ class OldChangesList extends ChangesList {
}
}
/**
* Generate a list of changes using an Enhanced system (uses javascript).
*/

View file

@ -148,7 +148,6 @@ class IdentityCollation extends Collation {
}
}
class IcuCollation extends Collation {
var $primaryCollator, $mainCollator, $locale;
var $firstLetterData;

View file

@ -66,7 +66,6 @@ class ConfEditor {
*/
var $stateStack;
/**
* The path stack is a stack of associative arrays with the following elements:
* name The name of top level of the path

View file

@ -135,7 +135,6 @@ $wgUsePathInfo = ( strpos( PHP_SAPI, 'cgi' ) === false ) &&
*/
$wgScriptExtension = '.php';
/**@}*/
/************************************************************************//**
@ -1022,7 +1021,6 @@ $wgAntivirusSetup = array(
),
);
/** Determines if a failed virus scan (AV_SCAN_FAILED) will cause the file to be rejected. */
$wgAntivirusRequired = true;
@ -1599,7 +1597,6 @@ $wgOldChangeTagsIndex = false;
/**@}*/ # End of DB settings }
/************************************************************************//**
* @name Text storage
* @{
@ -2853,7 +2850,6 @@ $wgBetterDirectionality = true;
*/
$wgSend404Code = true;
/**
* The $wgShowRollbackEditCount variable is used to show how many edits will be
* rollback. The numeric value of the varible are the limit up to are counted.
@ -3058,7 +3054,6 @@ $wgResourceLoaderExperimentalAsyncLoading = false;
/** @} */ # End of resource loader settings }
/*************************************************************************//**
* @name Page title and interwiki link settings
* @{
@ -3345,7 +3340,6 @@ $wgMaxPPNodeCount = 1000000;
*/
$wgMaxGeneratedPPNodeCount = 1000000;
/**
* Maximum recursion depth for templates within templates.
* The current parser adds two levels to the PHP call stack for each template,
@ -3927,7 +3921,7 @@ $wgGroupPermissions['*']['edit'] = true;
$wgGroupPermissions['*']['createpage'] = true;
$wgGroupPermissions['*']['createtalk'] = true;
$wgGroupPermissions['*']['writeapi'] = true;
//$wgGroupPermissions['*']['patrolmarks'] = false; // let anons see what was patrolled
#$wgGroupPermissions['*']['patrolmarks'] = false; // let anons see what was patrolled
// Implicit group for all logged-in accounts
$wgGroupPermissions['user']['move'] = true;
@ -3958,7 +3952,7 @@ $wgGroupPermissions['bot']['autopatrol'] = true;
$wgGroupPermissions['bot']['suppressredirect'] = true;
$wgGroupPermissions['bot']['apihighlimits'] = true;
$wgGroupPermissions['bot']['writeapi'] = true;
#$wgGroupPermissions['bot']['editprotected'] = true; // can edit all protected pages without cascade protection enabled
#$wgGroupPermissions['bot']['editprotected'] = true; // can edit all protected pages without cascade protection enabled
// Most extra permission abilities go to this group
$wgGroupPermissions['sysop']['block'] = true;
@ -3995,8 +3989,8 @@ $wgGroupPermissions['sysop']['noratelimit'] = true;
$wgGroupPermissions['sysop']['movefile'] = true;
$wgGroupPermissions['sysop']['unblockself'] = true;
$wgGroupPermissions['sysop']['suppressredirect'] = true;
#$wgGroupPermissions['sysop']['upload_by_url'] = true;
#$wgGroupPermissions['sysop']['mergehistory'] = true;
#$wgGroupPermissions['sysop']['upload_by_url'] = true;
#$wgGroupPermissions['sysop']['mergehistory'] = true;
// Permission to change users' group assignments
$wgGroupPermissions['bureaucrat']['userrights'] = true;
@ -4006,8 +4000,8 @@ $wgGroupPermissions['bureaucrat']['noratelimit'] = true;
// Permission to export pages including linked pages regardless of $wgExportMaxLinkDepth
#$wgGroupPermissions['bureaucrat']['override-export-depth'] = true;
#$wgGroupPermissions['sysop']['deletelogentry'] = true;
#$wgGroupPermissions['sysop']['deleterevision'] = true;
#$wgGroupPermissions['sysop']['deletelogentry'] = true;
#$wgGroupPermissions['sysop']['deleterevision'] = true;
// To hide usernames from users and Sysops
#$wgGroupPermissions['suppress']['hideuser'] = true;
// To hide revisions/log items from users and Sysops
@ -4446,7 +4440,6 @@ $wgCookieExpiration = 180 * 86400;
*/
$wgCookieDomain = '';
/**
* Set this variable if you want to restrict cookies to a certain path within
* the domain specified by $wgCookieDomain.
@ -4787,7 +4780,6 @@ $wgJavaScriptTestConfig = array(
),
);
/**
* Overwrite the caching key prefix with custom value.
* @since 1.19

View file

@ -61,7 +61,6 @@ define( 'DB_READ', -1 );
define( 'DB_WRITE', -2 );
define( 'DB_LAST', -3 ); # deprecated since 2008, usage throws exception
/**@{
* Virtual namespaces; don't appear in the page database
*/

View file

@ -40,90 +40,90 @@ class EditPage {
/**
* Status: Article successfully updated
*/
const AS_SUCCESS_UPDATE = 200;
const AS_SUCCESS_UPDATE = 200;
/**
* Status: Article successfully created
*/
const AS_SUCCESS_NEW_ARTICLE = 201;
const AS_SUCCESS_NEW_ARTICLE = 201;
/**
* Status: Article update aborted by a hook function
*/
const AS_HOOK_ERROR = 210;
const AS_HOOK_ERROR = 210;
/**
* Status: A hook function returned an error
*/
const AS_HOOK_ERROR_EXPECTED = 212;
const AS_HOOK_ERROR_EXPECTED = 212;
/**
* Status: User is blocked from editting this page
*/
const AS_BLOCKED_PAGE_FOR_USER = 215;
const AS_BLOCKED_PAGE_FOR_USER = 215;
/**
* Status: Content too big (> $wgMaxArticleSize)
*/
const AS_CONTENT_TOO_BIG = 216;
const AS_CONTENT_TOO_BIG = 216;
/**
* Status: User cannot edit? (not used)
*/
const AS_USER_CANNOT_EDIT = 217;
const AS_USER_CANNOT_EDIT = 217;
/**
* Status: this anonymous user is not allowed to edit this page
*/
const AS_READ_ONLY_PAGE_ANON = 218;
const AS_READ_ONLY_PAGE_ANON = 218;
/**
* Status: this logged in user is not allowed to edit this page
*/
const AS_READ_ONLY_PAGE_LOGGED = 219;
const AS_READ_ONLY_PAGE_LOGGED = 219;
/**
* Status: wiki is in readonly mode (wfReadOnly() == true)
*/
const AS_READ_ONLY_PAGE = 220;
const AS_READ_ONLY_PAGE = 220;
/**
* Status: rate limiter for action 'edit' was tripped
*/
const AS_RATE_LIMITED = 221;
const AS_RATE_LIMITED = 221;
/**
* Status: article was deleted while editting and param wpRecreate == false or form
* was not posted
*/
const AS_ARTICLE_WAS_DELETED = 222;
const AS_ARTICLE_WAS_DELETED = 222;
/**
* Status: user tried to create this page, but is not allowed to do that
* ( Title->usercan('create') == false )
*/
const AS_NO_CREATE_PERMISSION = 223;
const AS_NO_CREATE_PERMISSION = 223;
/**
* Status: user tried to create a blank page
*/
const AS_BLANK_ARTICLE = 224;
const AS_BLANK_ARTICLE = 224;
/**
* Status: (non-resolvable) edit conflict
*/
const AS_CONFLICT_DETECTED = 225;
const AS_CONFLICT_DETECTED = 225;
/**
* Status: no edit summary given and the user has forceeditsummary set and the user is not
* editting in his own userspace or talkspace and wpIgnoreBlankSummary == false
*/
const AS_SUMMARY_NEEDED = 226;
const AS_SUMMARY_NEEDED = 226;
/**
* Status: user tried to create a new section without content
*/
const AS_TEXTBOX_EMPTY = 228;
const AS_TEXTBOX_EMPTY = 228;
/**
* Status: article is too big (> $wgMaxArticleSize), after merging in the new section
@ -133,37 +133,37 @@ class EditPage {
/**
* not used
*/
const AS_OK = 230;
const AS_OK = 230;
/**
* Status: WikiPage::doEdit() was unsuccessfull
*/
const AS_END = 231;
const AS_END = 231;
/**
* Status: summary contained spam according to one of the regexes in $wgSummarySpamRegex
*/
const AS_SPAM_ERROR = 232;
const AS_SPAM_ERROR = 232;
/**
* Status: anonymous user is not allowed to upload (User::isAllowed('upload') == false)
*/
const AS_IMAGE_REDIRECT_ANON = 233;
const AS_IMAGE_REDIRECT_ANON = 233;
/**
* Status: logged in user is not allowed to upload (User::isAllowed('upload') == false)
*/
const AS_IMAGE_REDIRECT_LOGGED = 234;
const AS_IMAGE_REDIRECT_LOGGED = 234;
/**
* Status: can't parse content
*/
const AS_PARSE_ERROR = 240;
const AS_PARSE_ERROR = 240;
/**
* HTML id and name for the beginning of the edit form.
*/
const EDITFORM_ID = 'editform';
const EDITFORM_ID = 'editform';
/**
* Prefix of key for cookie used to pass post-edit state.
@ -397,9 +397,9 @@ class EditPage {
$this->isConflict = false;
// css / js subpages of user pages get a special treatment
$this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
$this->isCssSubpage = $this->mTitle->isCssSubpage();
$this->isJsSubpage = $this->mTitle->isJsSubpage();
$this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
$this->isCssSubpage = $this->mTitle->isCssSubpage();
$this->isJsSubpage = $this->mTitle->isJsSubpage();
$this->isWrongCaseCssJsPage = $this->isWrongCaseCssJsPage();
# Show applicable editing introductions
@ -714,7 +714,7 @@ class EditPage {
$this->starttime = null;
}
$this->recreate = $request->getCheck( 'wpRecreate' );
$this->recreate = $request->getCheck( 'wpRecreate' );
$this->minoredit = $request->getCheck( 'wpMinoredit' );
$this->watchthis = $request->getCheck( 'wpWatchthis' );
@ -732,18 +732,18 @@ class EditPage {
} else {
# Not a posted form? Start with nothing.
wfDebug( __METHOD__ . ": Not a posted form.\n" );
$this->textbox1 = '';
$this->summary = '';
$this->textbox1 = '';
$this->summary = '';
$this->sectiontitle = '';
$this->edittime = '';
$this->starttime = wfTimestampNow();
$this->edit = false;
$this->preview = false;
$this->save = false;
$this->diff = false;
$this->minoredit = false;
$this->watchthis = $request->getBool( 'watchthis', false ); // Watch may be overriden by request parameters
$this->recreate = false;
$this->edittime = '';
$this->starttime = wfTimestampNow();
$this->edit = false;
$this->preview = false;
$this->save = false;
$this->diff = false;
$this->minoredit = false;
$this->watchthis = $request->getBool( 'watchthis', false ); // Watch may be overriden by request parameters
$this->recreate = false;
// When creating a new section, we can preload a section title by passing it as the
// preloadtitle parameter in the URL (Bug 13100)
@ -1006,7 +1006,7 @@ class EditPage {
$rev = $this->mArticle->getRevision();
$content = $rev ? $rev->getContent( Revision::RAW ) : null;
if ( $content === false || $content === null ) {
if ( $content === false || $content === null ) {
if ( !$this->contentModel ) $this->contentModel = $this->getTitle()->getContentModel();
$handler = ContentHandler::getForModelID( $this->contentModel );
@ -1020,7 +1020,6 @@ class EditPage {
}
}
/**
* Use this method before edit() to preload some text into the edit box
*
@ -2427,7 +2426,6 @@ class EditPage {
$this->showHeaderCopyrightWarning();
}
/**
* Standard summary input and label (wgSummary), abstracted so EditPage
* subclasses may reorganize the form.

View file

@ -83,7 +83,7 @@ class MWException extends Exception {
$callargs = array_merge( array( $this ), $args );
foreach ( $hooks as $hook ) {
if ( is_string( $hook ) || ( is_array( $hook ) && count( $hook ) >= 2 && is_string( $hook[0] ) ) ) { // 'function' or array( 'class', hook' )
if ( is_string( $hook ) || ( is_array( $hook ) && count( $hook ) >= 2 && is_string( $hook[0] ) ) ) { // 'function' or array( 'class', hook' )
$result = call_user_func_array( $hook, $callargs );
} else {
$result = null;

View file

@ -429,7 +429,7 @@ class WikiExporter {
foreach ( $resultset as $row ) {
if ( $last === null ||
$last->page_namespace != $row->page_namespace ||
$last->page_title != $row->page_title ) {
$last->page_title != $row->page_title ) {
if ( $last !== null ) {
$output = '';
if ( $this->dumpUploads ) {
@ -649,7 +649,7 @@ class XmlDumpWriter {
}
if ( isset( $row->rev_minor_edit ) && $row->rev_minor_edit ) {
$out .= " <minor/>\n";
$out .= " <minor/>\n";
}
if ( isset( $row->rev_deleted ) && ( $row->rev_deleted & Revision::DELETED_COMMENT ) ) {
$out .= " " . Xml::element( 'comment', array( 'deleted' => 'deleted' ) ) . "\n";
@ -871,7 +871,6 @@ class XmlDumpWriter {
}
}
/**
* Base class for output stream; prints to stdout or buffer or whereever.
* @ingroup Dump
@ -1399,7 +1398,6 @@ class DumpNamespaceFilter extends DumpFilter {
}
}
/**
* Dump output filter to include only the last revision in each page sequence.
* @ingroup Dump

View file

@ -149,7 +149,6 @@ class Fallback {
return $total;
}
/**
* Fallback implementation of mb_strpos, hardcoded to UTF-8.
* @param $haystack String

View file

@ -94,7 +94,6 @@ if( !function_exists( 'mb_strrpos' ) ) {
}
}
// Support for Wietse Venema's taint feature
if ( !function_exists( 'istainted' ) ) {
/**
@ -851,8 +850,6 @@ function wfExpandIRI_callback( $matches ) {
return urldecode( $matches[1] );
}
/**
* Make URL indexes, appropriate for the el_index field of externallinks.
*
@ -1965,10 +1962,8 @@ function wfFormatStackFrame( $frame ) {
$frame['function'];
}
/* Some generic result counters, pulled out of SearchEngine */
/**
* @todo document
*

View file

@ -2357,7 +2357,6 @@ class HTMLSelectAndOtherField extends HTMLSelectField {
*/
class HTMLRadioField extends HTMLFormField {
function validate( $value, $alldata ) {
$p = parent::validate( $value, $alldata );

View file

@ -183,7 +183,6 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob
}
}
/**
* Pointer object for an item within a CGZ blob stored in the text table.
*/
@ -285,7 +284,6 @@ class HistoryBlobStub {
}
}
/**
* To speed up conversion from 1.4 to 1.5 schema, text rows can refer to the
* leftover cur table as the backend. This avoids expensively copying hundreds

View file

@ -57,7 +57,6 @@ class Hooks {
unset( self::$handlers[$name] );
}
/**
* Attach an event handler to a given hook
*

View file

@ -506,7 +506,6 @@ class MWHttpRequest {
return (int)$this->respStatus;
}
/**
* Returns true if the last status code was a redirect.
*
@ -643,7 +642,7 @@ class MWHttpRequest {
if ( isset( $url['host'] ) ) {
$domain = $url[ 'scheme' ] . '://' . $url[ 'host' ];
break; //found correct URI (with host)
break; //found correct URI (with host)
} else {
$foundRelativeURI = true;
}

View file

@ -742,7 +742,7 @@ class IP {
return long2ip( ( hexdec( $m[1] ) << 16 ) + hexdec( $m[2] ) );
}
return null; // give up
return null; // give up
}
/**

View file

@ -20,7 +20,6 @@
* @file
*/
/**
* Some functions to help implement an external link filter for spam control.
*

View file

@ -1166,7 +1166,6 @@ class Linker {
return self::userToolLinks( $userId, $userText, true, 0, $edits );
}
/**
* @param $userId Integer: user id in database.
* @param $userText String: user name in database.

View file

@ -464,7 +464,6 @@ class MagicWord {
}
}
/**
* Returns true if the text matches the word, and alters the
* input string, removing all instances of the word

View file

@ -413,7 +413,6 @@ class MimeMagic {
return $m;
}
/**
* Tests if the extension matches the given mime type. Returns true if a
* match was found, null if the mime type is unknown, and false if the
@ -427,7 +426,7 @@ class MimeMagic {
$ext = $this->getExtensionsForType( $mime );
if ( !$ext ) {
return null; // Unknown mime type
return null; // Unknown mime type
}
$ext = explode( ' ', $ext );

View file

@ -1597,7 +1597,6 @@ class OutputPage extends ContextSource {
$this->addHTML( $text );
}
/**
* Add the output of a QuickTemplate to the output buffer
*
@ -2952,7 +2951,6 @@ $templates
$this->mJsConfigVars[$keys] = $value;
}
/**
* Get an array containing the variables to be set in mw.config in JavaScript.
*
@ -3223,7 +3221,6 @@ $templates
) );
}
# Language variants
if ( !$wgDisableLangConversion && $wgCanonicalLanguageLinks ) {
$lang = $this->getTitle()->getPageLanguage();

View file

@ -709,7 +709,6 @@ abstract class IndexPager extends ContextSource implements Pager {
protected function getDefaultDirections() { return false; }
}
/**
* IndexPager with an alphabetic list and a formatted navigation bar
* @ingroup Pager

View file

@ -42,15 +42,15 @@
abstract class PoolCounter {
/* Return codes */
const LOCKED = 1; /* Lock acquired */
const LOCKED = 1; /* Lock acquired */
const RELEASED = 2; /* Lock released */
const DONE = 3; /* Another worker did the work for you */
const DONE = 3; /* Another worker did the work for you */
const ERROR = -1; /* Indeterminate error */
const ERROR = -1; /* Indeterminate error */
const NOT_LOCKED = -2; /* Called release() with no lock held */
const QUEUE_FULL = -3; /* There are already maxqueue workers on this lock */
const TIMEOUT = -4; /* Timeout exceeded */
const LOCK_HELD = -5; /* Cannot acquire another lock while you have one lock held */
const TIMEOUT = -4; /* Timeout exceeded */
const LOCK_HELD = -5; /* Cannot acquire another lock while you have one lock held */
/**
* I want to do this task and I need to do it myself.
@ -107,9 +107,9 @@ abstract class PoolCounter {
protected function __construct( $conf, $type, $key ) {
$this->key = $key;
$this->workers = $conf['workers'];
$this->workers = $conf['workers'];
$this->maxqueue = $conf['maxqueue'];
$this->timeout = $conf['timeout'];
$this->timeout = $conf['timeout'];
}
}

View file

@ -202,7 +202,7 @@ class Preferences {
// Skip the default * group, seems useless here
continue;
}
$groupName = User::getGroupName( $ueg );
$groupName = User::getGroupName( $ueg );
$userGroups[] = User::makeGroupLinkHTML( $ueg, $groupName );
$memberName = User::getGroupMember( $ueg, $userName );
@ -397,7 +397,6 @@ class Preferences {
);
}
$defaultPreferences['emailaddress'] = array(
'type' => 'info',
'raw' => true,
@ -826,7 +825,6 @@ class Preferences {
'label-message' => 'tog-forceeditsummary',
);
$defaultPreferences['uselivepreview'] = array(
'type' => 'toggle',
'section' => 'editing/advancedediting',
@ -1009,7 +1007,6 @@ class Preferences {
'min' => 0,
);
if ( $wgVectorUseSimpleSearch ) {
$defaultPreferences['vector-simplesearch'] = array(
'type' => 'toggle',

View file

@ -482,7 +482,7 @@ class ProtectionForm {
# Add manual and custom reason field/selects as well as submit
if( !$this->disabled ) {
$out .= Xml::openElement( 'table', array( 'id' => 'mw-protect-table3' ) ) .
$out .= Xml::openElement( 'table', array( 'id' => 'mw-protect-table3' ) ) .
Xml::openElement( 'tbody' );
$out .= "
<tr>

View file

@ -72,7 +72,6 @@ global $wgDisableCounters;
if ( !$wgDisableCounters )
$wgQueryPages[] = array( 'PopularPagesPage', 'Popularpages' );
/**
* This is a class for doing query pages; since they're almost all the same,
* we factor out some of the functionality into a superclass, and let

View file

@ -459,7 +459,7 @@ class RecentChange {
'rc_params' => ''
);
$rc->mExtra = array(
$rc->mExtra = array(
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => $lastTimestamp,
'oldSize' => $oldSize,
@ -518,7 +518,7 @@ class RecentChange {
'rc_params' => ''
);
$rc->mExtra = array(
$rc->mExtra = array(
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => 0,
'oldSize' => 0,
@ -627,7 +627,7 @@ class RecentChange {
'rc_params' => $params
);
$rc->mExtra = array(
$rc->mExtra = array(
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => 0,
'actionComment' => $actionComment, // the comment appended to the action, passed from LogPage

View file

@ -558,7 +558,6 @@ class Revision implements IDBAccessObject {
// Build a new revision to be saved...
global $wgUser; // ugh
# if we have a content object, use it to set the model and type
if ( !empty( $row['content'] ) ) {
//@todo: when is that set? test with external store setup! check out insertOn() [dk]

View file

@ -1758,7 +1758,7 @@ class Sanitizer {
// Please note strings below are enclosed in brackets [], this make the
// hyphen "-" a range indicator. Hence it is double backslashed below.
// See bug 26948
$rfc5322_atext = "a-z0-9!#$%&'*+\\-\/=?^_`{|}~";
$rfc5322_atext = "a-z0-9!#$%&'*+\\-\/=?^_`{|}~";
$rfc1034_ldh_str = "a-z0-9\\-";
$HTML5_email_regexp = "/

View file

@ -70,7 +70,7 @@ if ( !empty( $wgActionPaths ) && !isset( $wgActionPaths['view'] ) ) {
if ( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins";
if ( $wgLocalStylePath === false ) $wgLocalStylePath = "$wgScriptPath/skins";
if ( $wgStyleDirectory === false ) $wgStyleDirectory = "$IP/skins";
if ( $wgStyleDirectory === false ) $wgStyleDirectory = "$IP/skins";
if ( $wgExtensionAssetsPath === false ) $wgExtensionAssetsPath = "$wgScriptPath/extensions";
if ( $wgLogo === false ) $wgLogo = "$wgStylePath/common/images/wiki.png";

View file

@ -613,7 +613,6 @@ abstract class Skin extends ContextSource {
( $this->getTitle()->getArticleID() == 0 || $action == 'history' ) ) {
$n = $this->getTitle()->isDeleted();
if ( $n ) {
if ( $this->getUser()->isAllowed( 'undelete' ) ) {
$msg = 'thisisdeleted';

View file

@ -273,7 +273,7 @@ class SkinTemplate extends Skin {
$userLang = $this->getLanguage();
$userLangCode = $userLang->getHtmlCode();
$userLangDir = $userLang->getDir();
$userLangDir = $userLang->getDir();
$tpl->set( 'lang', $userLangCode );
$tpl->set( 'dir', $userLangDir );

View file

@ -88,7 +88,6 @@ class Title {
var $mHasSubpage; // /< Whether a page has any subpages
// @}
/**
* Constructor
*/
@ -3212,10 +3211,10 @@ class Title {
strpos( $dbkey, '.' ) !== false &&
(
$dbkey === '.' || $dbkey === '..' ||
strpos( $dbkey, './' ) === 0 ||
strpos( $dbkey, './' ) === 0 ||
strpos( $dbkey, '../' ) === 0 ||
strpos( $dbkey, '/./' ) !== false ||
strpos( $dbkey, '/../' ) !== false ||
strpos( $dbkey, '/../' ) !== false ||
substr( $dbkey, -2 ) == '/.' ||
substr( $dbkey, -3 ) == '/..'
)
@ -3446,7 +3445,6 @@ class Title {
return $retVal;
}
/**
* Get a list of URLs to purge from the Squid cache when this
* page changes

View file

@ -574,7 +574,6 @@ class User {
return false;
}
// Ensure that the name can't be misresolved as a different title,
// such as with extra namespace keys at the start.
$parsed = Title::newFromText( $name );
@ -1265,7 +1264,6 @@ class User {
}
}
/**
* Get blocking information
* @param $bFromSlave Bool Whether to check the slave database first. To
@ -3309,7 +3307,7 @@ class User {
// since it disables the parser cache, its value will always
// be 0 when this function is called by parsercache.
$confstr = $this->getOption( 'math' );
$confstr = $this->getOption( 'math' );
$confstr .= '!' . $this->getStubThreshold();
$confstr .= '!' . ( $this->getOption( 'numberheadings' ) ? '1' : '' );
$confstr .= '!' . $wgLang->getCode();

View file

@ -24,7 +24,6 @@
* @author Luke Welling lwelling@wikimedia.org
*/
/**
* Stores a single person's name and email address.
* These are passed in via the constructor, and will be returned in SMTP
@ -78,7 +77,6 @@ class MailAddress {
}
}
/**
* Collection of static functions for sending mail
*/
@ -270,7 +268,7 @@ class UserMailer {
$mime = new Mail_mime( array( 'eol' => $endl ) );
$mime->setTXTBody( $body['text'] );
$mime->setHTMLBody( $body['html'] );
$body = $mime->get(); // must call get() before headers()
$body = $mime->get(); // must call get() before headers()
$headers = $mime->headers( $headers );
}
}

View file

@ -356,10 +356,10 @@ class MediaWiki {
// Check for redirects ...
$action = $request->getVal( 'action', 'view' );
$file = ( $title->getNamespace() == NS_FILE ) ? $article->getFile() : null;
if ( ( $action == 'view' || $action == 'render' ) // ... for actions that show content
&& !$request->getVal( 'oldid' ) && // ... and are not old revisions
!$request->getVal( 'diff' ) && // ... and not when showing diff
$request->getVal( 'redirect' ) != 'no' && // ... unless explicitly told not to
if ( ( $action == 'view' || $action == 'render' ) // ... for actions that show content
&& !$request->getVal( 'oldid' ) && // ... and are not old revisions
!$request->getVal( 'diff' ) && // ... and not when showing diff
$request->getVal( 'redirect' ) != 'no' && // ... unless explicitly told not to
// ... and the article is not a non-redirect image page with associated file
!( is_object( $file ) && $file->exists() && !$file->getRedirected() ) )
{

View file

@ -386,11 +386,11 @@ class WikiPage implements Page, IDBAccessObject {
// Old-fashioned restrictions
$this->mTitle->loadRestrictions( $data->page_restrictions );
$this->mId = intval( $data->page_id );
$this->mCounter = intval( $data->page_counter );
$this->mTouched = wfTimestamp( TS_MW, $data->page_touched );
$this->mIsRedirect = intval( $data->page_is_redirect );
$this->mLatest = intval( $data->page_latest );
$this->mId = intval( $data->page_id );
$this->mCounter = intval( $data->page_counter );
$this->mTouched = wfTimestamp( TS_MW, $data->page_touched );
$this->mIsRedirect = intval( $data->page_is_redirect );
$this->mLatest = intval( $data->page_latest );
// Bug 37225: $latest may no longer match the cached latest Revision object.
// Double-check the ID of any cached latest Revision object for consistency.
if ( $this->mLastRevision && $this->mLastRevision->getId() != $this->mLatest ) {
@ -1704,7 +1704,7 @@ class WikiPage implements Page, IDBAccessObject {
$editInfo = $this->prepareContentForEdit( $content, null, $user, $serialisation_format );
$serialized = $editInfo->pst;
$content = $editInfo->pstContent;
$newsize = $content->getSize();
$newsize = $content->getSize();
$dbw = wfGetDB( DB_MASTER );
$now = wfTimestampNow();
@ -3043,7 +3043,7 @@ class WikiPage implements Page, IDBAccessObject {
}
$dbw->insert( 'category', $insertRows, __METHOD__, 'IGNORE' );
$addFields = array( 'cat_pages = cat_pages + 1' );
$addFields = array( 'cat_pages = cat_pages + 1' );
$removeFields = array( 'cat_pages = cat_pages - 1' );
if ( $ns == NS_CATEGORY ) {

View file

@ -39,7 +39,7 @@ class Xml {
public static function element( $element, $attribs = null, $contents = '', $allowShortTag = true ) {
$out = '<' . $element;
if( !is_null( $attribs ) ) {
$out .= self::expandAttributes( $attribs );
$out .= self::expandAttributes( $attribs );
}
if( is_null( $contents ) ) {
$out .= '>';

View file

@ -145,9 +145,9 @@ class HistoryAction extends FormlessAction {
/**
* Add date selector to quickly get to a certain time
*/
$year = $request->getInt( 'year' );
$month = $request->getInt( 'month' );
$tagFilter = $request->getVal( 'tagfilter' );
$year = $request->getInt( 'year' );
$month = $request->getInt( 'month' );
$tagFilter = $request->getVal( 'tagfilter' );
$tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter );
/**

View file

@ -135,7 +135,6 @@ abstract class ApiBase extends ContextSource {
return $this->mModuleName;
}
/**
* Get the module manager, or null if this module has no sub-modules
* @since 1.21
@ -429,7 +428,7 @@ abstract class ApiBase extends ContextSource {
if ( $t === '' ) {
$nothingPrompt = 'Can be empty, or ';
} else {
$choices[] = $t;
$choices[] = $t;
}
}
$desc .= $paramPrefix . $nothingPrompt . $prompt;

View file

@ -257,7 +257,7 @@ class ApiEditPage extends ApiBase {
if ( !is_null( $params['starttimestamp'] ) && $params['starttimestamp'] != '' ) {
$requestArray['wpStarttime'] = wfTimestamp( TS_MW, $params['starttimestamp'] );
} else {
$requestArray['wpStarttime'] = wfTimestampNow(); // Fake wpStartime
$requestArray['wpStarttime'] = wfTimestampNow(); // Fake wpStartime
}
if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) ) {

View file

@ -147,7 +147,7 @@ class ApiLogin extends ApiBase {
case LoginForm::ABORTED:
$result['result'] = 'Aborted';
$result['reason'] = $loginForm->mAbortLoginErrorMsg;
$result['reason'] = $loginForm->mAbortLoginErrorMsg;
break;
default:

View file

@ -650,7 +650,7 @@ class ApiPageSet extends ApiBase {
$this->profileDBOut();
}
$this->initFromQueryResult( $res, $remaining, false ); // process PageIDs
$this->initFromQueryResult( $res, $remaining, false ); // process PageIDs
// Resolve any found redirects
$this->resolvePendingRedirects();
@ -911,7 +911,7 @@ class ApiPageSet extends ApiBase {
// Variants checking
global $wgContLang;
if ( $this->mConvertTitles &&
count( $wgContLang->getVariants() ) > 1 &&
count( $wgContLang->getVariants() ) > 1 &&
!$titleObj->exists() ) {
// Language::findVariantLink will modify titleText and titleObj into
// the canonical variant if possible

View file

@ -161,7 +161,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
$this->addFields( array( 'recentedits' => 'COUNT(*)' ) );
$this->addWhere( 'rc_log_type IS NULL OR rc_log_type != ' . $db->addQuotes( 'newusers' ) );
$timestamp = $db->timestamp( wfTimestamp( TS_UNIX ) - $wgActiveUserDays*24*3600 );
$timestamp = $db->timestamp( wfTimestamp( TS_UNIX ) - $wgActiveUserDays * 24 * 3600 );
$this->addWhere( 'rc_timestamp >= ' . $db->addQuotes( $timestamp ) );
$this->addOption( 'GROUP BY', $userFieldToSort );
@ -279,7 +279,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
if ( $fld_rights ) {
if ( !isset( $lastUserData['rights'] ) ) {
if ( $lastUserObj ) {
$lastUserData['rights'] = User::getGroupPermissions( $lastUserObj->getAutomaticGroups() );
$lastUserData['rights'] = User::getGroupPermissions( $lastUserObj->getAutomaticGroups() );
} else {
// This should not normally happen
$lastUserData['rights'] = array();

View file

@ -246,7 +246,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
$this->params = $this->extractRequestParams( false );
$this->redirect = isset( $this->params['redirect'] ) && $this->params['redirect'];
$userMax = ( $this->redirect ? ApiBase::LIMIT_BIG1 / 2 : ApiBase::LIMIT_BIG1 );
$botMax = ( $this->redirect ? ApiBase::LIMIT_BIG2 / 2 : ApiBase::LIMIT_BIG2 );
$botMax = ( $this->redirect ? ApiBase::LIMIT_BIG2 / 2 : ApiBase::LIMIT_BIG2 );
$result = $this->getResult();

View file

@ -53,7 +53,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
*/
private function run( $resultPageSet = null ) {
if ( $this->getPageSet()->getGoodTitleCount() == 0 ) {
return; // nothing to do
return; // nothing to do
}
$params = $this->extractRequestParams();

View file

@ -78,7 +78,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
$this->addFieldsIf( 'cl_timestamp', $fld_timestamp || $params['sort'] == 'timestamp' );
$this->addTables( array( 'page', 'categorylinks' ) ); // must be in this order for 'USE INDEX'
$this->addTables( array( 'page', 'categorylinks' ) ); // must be in this order for 'USE INDEX'
$this->addWhereFld( 'cl_to', $categoryTitle->getDBkey() );
$queryTypes = $params['type'];

View file

@ -116,7 +116,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
}
// Check limits
$userMax = $fld_content ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1;
$botMax = $fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2;
$botMax = $fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2;
$limit = $params['limit'];

View file

@ -55,7 +55,7 @@ class ApiQueryExtLinksUsage extends ApiQueryGeneratorBase {
$query = $params['query'];
$protocol = self::getProtocolPrefix( $params['protocol'] );
$this->addTables( array( 'page', 'externallinks' ) ); // must be in this order for 'USE INDEX'
$this->addTables( array( 'page', 'externallinks' ) ); // must be in this order for 'USE INDEX'
$this->addOption( 'USE INDEX', 'el_index' );
$this->addWhere( 'page_id=el_from' );

View file

@ -207,7 +207,6 @@ class ApiQueryFilearchive extends ApiQueryBase {
$file['suppressed'] = '';
}
$fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $file );
if ( !$fit ) {
$this->setContinueEnumParameter( 'continue', $row->fa_name );

View file

@ -49,7 +49,7 @@ class ApiQueryImages extends ApiQueryGeneratorBase {
*/
private function run( $resultPageSet = null ) {
if ( $this->getPageSet()->getGoodTitleCount() == 0 ) {
return; // nothing to do
return; // nothing to do
}
$params = $this->extractRequestParams();

View file

@ -79,7 +79,7 @@ class ApiQueryLinks extends ApiQueryGeneratorBase {
*/
private function run( $resultPageSet = null ) {
if ( $this->getPageSet()->getGoodTitleCount() == 0 ) {
return; // nothing to do
return; // nothing to do
}
$params = $this->extractRequestParams();

View file

@ -95,7 +95,6 @@ class ApiQueryRevisions extends ApiQueryBase {
!is_null( $params['endid'] ) || $params['dir'] === 'newer' ||
!is_null( $params['start'] ) || !is_null( $params['end'] ) );
$pageSet = $this->getPageSet();
$pageCount = $pageSet->getGoodTitleCount();
$revCount = $pageSet->getRevisionCount();
@ -168,7 +167,7 @@ class ApiQueryRevisions extends ApiQueryBase {
$index = array();
$userMax = ( $this->fld_content ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1 );
$botMax = ( $this->fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2 );
$botMax = ( $this->fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2 );
$limit = $params['limit'];
if ( $limit == 'max' ) {
$limit = $this->getMain()->canApiHighLimits() ? $botMax : $userMax;

View file

@ -77,18 +77,18 @@ class ApiQueryUserInfo extends ApiQueryBase {
if ( isset( $this->prop['groups'] ) ) {
$vals['groups'] = $user->getEffectiveGroups();
$result->setIndexedTagName( $vals['groups'], 'g' ); // even if empty
$result->setIndexedTagName( $vals['groups'], 'g' ); // even if empty
}
if ( isset( $this->prop['implicitgroups'] ) ) {
$vals['implicitgroups'] = $user->getAutomaticGroups();
$result->setIndexedTagName( $vals['implicitgroups'], 'g' ); // even if empty
$result->setIndexedTagName( $vals['implicitgroups'], 'g' ); // even if empty
}
if ( isset( $this->prop['rights'] ) ) {
// User::getRights() may return duplicate values, strip them
$vals['rights'] = array_values( array_unique( $user->getRights() ) );
$result->setIndexedTagName( $vals['rights'], 'r' ); // even if empty
$result->setIndexedTagName( $vals['rights'], 'r' ); // even if empty
}
if ( isset( $this->prop['changeablegroups'] ) ) {

View file

@ -515,7 +515,6 @@ class ApiUpload extends ApiBase {
}
}
/**
* Check warnings.
* Returns a suitable array for inclusion into API results if there were warnings
@ -553,7 +552,6 @@ class ApiUpload extends ApiBase {
return $warnings;
}
/**
* Perform the actual upload. Returns a suitable result array on success;
* dies on failure.

View file

@ -222,11 +222,11 @@ class BacklinkCache {
*/
protected function getPrefix( $table ) {
static $prefixes = array(
'pagelinks' => 'pl',
'imagelinks' => 'il',
'pagelinks' => 'pl',
'imagelinks' => 'il',
'categorylinks' => 'cl',
'templatelinks' => 'tl',
'redirect' => 'rd',
'redirect' => 'rd',
);
if ( isset( $prefixes[$table] ) ) {
@ -259,14 +259,14 @@ class BacklinkCache {
case 'templatelinks':
$conds = array(
"{$prefix}_namespace" => $this->title->getNamespace(),
"{$prefix}_title" => $this->title->getDBkey(),
"{$prefix}_title" => $this->title->getDBkey(),
"page_id={$prefix}_from"
);
break;
case 'redirect':
$conds = array(
"{$prefix}_namespace" => $this->title->getNamespace(),
"{$prefix}_title" => $this->title->getDBkey(),
"{$prefix}_title" => $this->title->getDBkey(),
$this->getDb()->makeList( array(
"{$prefix}_interwiki" => '',
"{$prefix}_interwiki IS NULL",
@ -394,7 +394,6 @@ class BacklinkCache {
return $cacheEntry['batches'];
}
// 4) ... finally fetch from the slow database :(
$this->getLinks( $table );
$cacheEntry = $this->partitionResult( $this->fullResultCache[$table], $batchSize );

View file

@ -538,7 +538,6 @@ class LocalisationCache {
}
}
/**
* Load a plural XML file with the given filename, compile the relevant
* rules, and save the compiled rules in a process-local cache.

View file

@ -61,7 +61,7 @@ class SquidUpdate {
array( 'page_namespace', 'page_title' ),
array(
'pl_namespace' => $title->getNamespace(),
'pl_title' => $title->getDBkey(),
'pl_title' => $title->getDBkey(),
'pl_from=page_id' ),
__METHOD__ );
$blurlArr = $title->getSquidURLs();

View file

@ -203,7 +203,6 @@ abstract class AbstractContent implements Content {
return $this->getNativeData() === $that->getNativeData();
}
/**
* Returns a list of DataUpdate objects for recording information about this
* Content in some secondary data store.
@ -243,7 +242,6 @@ abstract class AbstractContent implements Content {
return $parserOutput->getSecondaryDataUpdates( $title, $recursive );
}
/**
* @see Content::getRedirectChain
*

View file

@ -54,7 +54,6 @@ class CssContent extends TextContent {
return new CssContent( $pst );
}
protected function getHtml( ) {
$html = "";
$html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n";

View file

@ -55,7 +55,6 @@ class JavaScriptContent extends TextContent {
return new JavaScriptContent( $pst );
}
protected function getHtml( ) {
$html = "";
$html .= "<pre class=\"mw-code mw-js\" dir=\"ltr\">\n";

View file

@ -186,7 +186,6 @@ class TextContent extends AbstractContent {
return $diff;
}
/**
* Returns a generic ParserOutput object, wrapping the HTML returned by
* getHtml().

View file

@ -49,7 +49,6 @@ class WikitextContentHandler extends TextContentHandler {
return new WikitextContent( '' );
}
/**
* Returns a WikitextContent object representing a redirect to the given destination page.
*

View file

@ -46,7 +46,7 @@
*/
interface IDBAccessObject {
// Constants for object loading bitfield flags (higher => higher QoS)
const READ_LATEST = 1; // read from the master
const READ_LATEST = 1; // read from the master
const READ_LOCKING = 3; // READ_LATEST and "FOR UPDATE"
// Convenience constant for callers to explicitly request slave data

View file

@ -282,7 +282,6 @@ abstract class DatabaseBase implements DatabaseType {
*/
protected $fileHandle = null;
# ------------------------------------------------------------------------------
# Accessors
# ------------------------------------------------------------------------------
@ -2070,7 +2069,7 @@ abstract class DatabaseBase implements DatabaseType {
&& in_array( $table, $wgSharedTables ) # A shared table is selected
) {
$database = $wgSharedDB;
$prefix = $wgSharedPrefix === null ? $this->mTablePrefix : $wgSharedPrefix;
$prefix = $wgSharedPrefix === null ? $this->mTablePrefix : $wgSharedPrefix;
} else {
$database = null;
$prefix = $this->mTablePrefix; # Default prefix

View file

@ -153,7 +153,7 @@ class DBConnectionError extends DBError {
$sorry = htmlspecialchars( $this->msg( 'dberr-problems', 'Sorry! This site is experiencing technical difficulties.' ) );
$again = htmlspecialchars( $this->msg( 'dberr-again', 'Try waiting a few minutes and reloading.' ) );
$info = htmlspecialchars( $this->msg( 'dberr-info', '(Can\'t contact the database server: $1)' ) );
$info = htmlspecialchars( $this->msg( 'dberr-info', '(Can\'t contact the database server: $1)' ) );
# No database access
MessageCache::singleton()->disable();

View file

@ -813,8 +813,6 @@ class DatabaseMssql extends DatabaseBase {
TO $newUser
;
" );
}
function encodeBlob( $b ) {

View file

@ -482,7 +482,6 @@ class DatabasePostgres extends DatabaseBase {
parent::reportQueryError( $error, $errno, $sql, $fname, false );
}
function queryIgnore( $sql, $fname = 'DatabasePostgres::queryIgnore' ) {
return $this->query( $sql, $fname, true );
}
@ -703,7 +702,6 @@ __INDEXATTR__;
return $a;
}
function indexUnique( $table, $index, $fname = 'DatabasePostgres::indexUnique' ) {
$sql = "SELECT indexname FROM pg_indexes WHERE tablename='{$table}'".
" AND indexdef LIKE 'CREATE UNIQUE%(" .
@ -1062,7 +1060,6 @@ __INDEXATTR__;
return '[http://www.postgresql.org/ PostgreSQL]';
}
/**
* Return current schema (executes SELECT current_schema())
* Needs transaction
@ -1466,7 +1463,7 @@ SQL;
*/
public function lock( $lockName, $method, $timeout = 5 ) {
$key = $this->addQuotes( $this->bigintFromLockName( $lockName ) );
for ( $attempts=1; $attempts <= $timeout; ++$attempts ) {
for ( $attempts = 1; $attempts <= $timeout; ++$attempts ) {
$result = $this->query(
"SELECT pg_try_advisory_lock($key) AS lockstatus", $method );
$row = $this->fetchObject( $result );

View file

@ -597,7 +597,7 @@ class DatabaseSqlite extends DatabaseBase {
* @return bool
*/
function wasErrorReissuable() {
return $this->lastErrno() == 17; // SQLITE_SCHEMA;
return $this->lastErrno() == 17; // SQLITE_SCHEMA;
}
/**
@ -831,7 +831,6 @@ class DatabaseSqlite extends DatabaseBase {
return $this->query( $sql, $fname );
}
/**
* List all tables on the database
*

View file

@ -219,9 +219,9 @@ class ResultWrapper implements Iterator {
* doesn't go anywhere near an actual database.
*/
class FakeResultWrapper extends ResultWrapper {
var $result = array();
var $db = null; // And it's going to stay that way :D
var $pos = 0;
var $result = array();
var $db = null; // And it's going to stay that way :D
var $pos = 0;
var $currentRow = null;
function __construct( $array ) {

View file

@ -33,7 +33,6 @@
interface IORMRow {
/**
* Constructor.
*

View file

@ -311,7 +311,6 @@ interface IORMTable {
*/
public function setReadDb( $db );
/**
* Get the ID of the any foreign wiki to use as a target for database operations
*

View file

@ -21,7 +21,6 @@
* @ingroup Database
*/
/**
* A multi-wiki, multi-master factory for Wikimedia and similar installations.
* Ignores the old configuration globals

View file

@ -323,7 +323,7 @@ class LoadBalancer {
$this->mServers[$i]['slave pos'] = $conn->getSlavePos();
}
}
if ( $this->mReadIndex <=0 && $this->mLoads[$i]>0 && $i !== false ) {
if ( $this->mReadIndex <= 0 && $this->mLoads[$i] > 0 && $i !== false ) {
$this->mReadIndex = $i;
}
}

View file

@ -201,7 +201,7 @@ class ORMTable extends DBAccessBase implements IORMTable {
* @return ORMResult
*/
public function select( $fields = null, array $conditions = array(),
array $options = array(), $functionName = null ) {
array $options = array(), $functionName = null ) {
$res = $this->rawSelect( $fields, $conditions, $options, $functionName );
return new ORMResult( $this, $res );
}
@ -221,7 +221,7 @@ class ORMTable extends DBAccessBase implements IORMTable {
* @throws DBQueryError if the query failed (even if the database was in ignoreErrors mode).
*/
public function selectObjects( $fields = null, array $conditions = array(),
array $options = array(), $functionName = null ) {
array $options = array(), $functionName = null ) {
$result = $this->selectFields( $fields, $conditions, $options, false, $functionName );
$objects = array();
@ -247,7 +247,7 @@ class ORMTable extends DBAccessBase implements IORMTable {
* @throws DBQueryError if the quey failed (even if the database was in ignoreErrors mode).
*/
public function rawSelect( $fields = null, array $conditions = array(),
array $options = array(), $functionName = null ) {
array $options = array(), $functionName = null ) {
if ( is_null( $fields ) ) {
$fields = array_keys( $this->getFields() );
}
@ -313,7 +313,7 @@ class ORMTable extends DBAccessBase implements IORMTable {
* @return array of array
*/
public function selectFields( $fields = null, array $conditions = array(),
array $options = array(), $collapse = true, $functionName = null ) {
array $options = array(), $collapse = true, $functionName = null ) {
$objects = array();
$result = $this->rawSelect( $fields, $conditions, $options, $functionName );

View file

@ -780,7 +780,6 @@ class Diff {
trigger_error( "Reversed closing doesn't match", E_USER_ERROR );
}
$prevtype = 'none';
foreach ( $this->edits as $edit ) {
if ( $prevtype == $edit->type ) {

View file

@ -887,7 +887,6 @@ class DifferenceEngine extends ContextSource {
return $this->msg( 'lineno' )->numParams( $matches[1] )->escaped();
}
/**
* If there are revisions between the ones being compared, return a note saying so.
* @return string

View file

@ -490,7 +490,6 @@ class WikiDiff3 {
$temp = array( 0, 0, 0 );
$max_progress = array_fill( 0, ceil( max( $forward_end_diag - $forward_start_diag,
$backward_end_diag - $backward_start_diag ) / 2 ), $temp );
$num_progress = 0; // the 1st entry is current, it is initialized

View file

@ -70,7 +70,7 @@ class FSFileBackend extends FileBackendStore {
if ( isset( $config['containerPaths'] ) ) {
$this->containerPaths = (array)$config['containerPaths'];
foreach ( $this->containerPaths as &$path ) {
$path = rtrim( $path, '/' ); // remove trailing slash
$path = rtrim( $path, '/' ); // remove trailing slash
}
}

View file

@ -303,8 +303,8 @@ class FileBackendMultiWrite extends FileBackend {
$mBackend = $this->backends[$this->masterIndex];
foreach ( $paths as $path ) {
$mPath = $this->substPaths( $path, $mBackend );
$mSha1 = $mBackend->getFileSha1Base36( array( 'src' => $mPath ) );
$mPath = $this->substPaths( $path, $mBackend );
$mSha1 = $mBackend->getFileSha1Base36( array( 'src' => $mPath ) );
$mExist = $mBackend->fileExists( array( 'src' => $mPath ) );
// Check if the master backend is available...
if ( $mExist === null ) {

View file

@ -57,8 +57,8 @@ abstract class FileBackendStore extends FileBackend {
*/
public function __construct( array $config ) {
parent::__construct( $config );
$this->memCache = new EmptyBagOStuff(); // disabled by default
$this->cheapCache = new ProcessCacheLRU( 300 );
$this->memCache = new EmptyBagOStuff(); // disabled by default
$this->cheapCache = new ProcessCacheLRU( 300 );
$this->expensiveCache = new ProcessCacheLRU( 5 );
}

View file

@ -201,7 +201,7 @@ class SwiftFileBackend extends FileBackendStore {
$res = '';
foreach ( explode( ';', $disposition ) as $part ) {
$part = trim( $part );
$new = ( $res === '' ) ? $part : "{$res};{$part}";
$new = ( $res === '' ) ? $part : "{$res};{$part}";
if ( strlen( $new ) <= 255 ) {
$res = $new;
} else {

View file

@ -775,7 +775,7 @@ class FileRepo {
throw new MWException( 'Validation error in $dstRel' );
}
$dstPath = "$root/$dstRel";
$dstDir = dirname( $dstPath );
$dstDir = dirname( $dstPath );
// Create destination directories for this triplet
if ( !$this->initDirectory( $dstDir )->isOK() ) {
return $this->newFatal( 'directorycreateerror', $dstDir );
@ -965,10 +965,10 @@ class FileRepo {
public function storeTemp( $originalName, $srcPath ) {
$this->assertWritableRepo(); // fail out if read-only
$date = gmdate( "YmdHis" );
$hashPath = $this->getHashPath( $originalName );
$dstRel = "{$hashPath}{$date}!{$originalName}";
$dstUrlRel = $hashPath . $date . '!' . rawurlencode( $originalName );
$date = gmdate( "YmdHis" );
$hashPath = $this->getHashPath( $originalName );
$dstRel = "{$hashPath}{$date}!{$originalName}";
$dstUrlRel = $hashPath . $date . '!' . rawurlencode( $originalName );
$virtualUrl = $this->getVirtualUrl( 'temp' ) . '/' . $dstUrlRel;
$result = $this->quickImport( $srcPath, $virtualUrl );
@ -1622,7 +1622,7 @@ class FileRepo {
*/
public function nameForThumb( $name ) {
if ( strlen( $name ) > $this->abbrvThreshold ) {
$ext = FileBackend::extensionFromPath( $name );
$ext = FileBackend::extensionFromPath( $name );
$name = ( $ext == '' ) ? 'thumbnail' : "thumbnail.$ext";
}
return $name;

View file

@ -320,7 +320,6 @@ class ForeignAPIRepo extends FileRepo {
return false;
}
# @todo FIXME: Delete old thumbs that aren't being used. Maintenance script?
$backend->prepare( array( 'dir' => dirname( $localFilename ) ) );
$params = array( 'dst' => $localFilename, 'content' => $thumb );

View file

@ -168,7 +168,7 @@ class LocalRepo extends FileRepo {
$expiry = 86400; // has invalidation, 1 day
}
$cachedValue = $wgMemc->get( $memcKey );
if ( $cachedValue === ' ' || $cachedValue === '' ) {
if ( $cachedValue === ' ' || $cachedValue === '' ) {
// Does not exist
return false;
} elseif ( strval( $cachedValue ) !== '' ) {
@ -217,7 +217,7 @@ class LocalRepo extends FileRepo {
'page_namespace' => $title->getNamespace(),
'page_title' => $title->getDBkey(),
),
__METHOD__ //Function name
__METHOD__ //Function name
);
return $id;
}

View file

@ -266,7 +266,7 @@ class LocalFile extends File {
// If the cache value gets to large it will not fit in memcached and nothing will
// get cached at all, causing master queries for any file access.
foreach ( $this->getLazyCacheFields( '' ) as $field ) {
if ( isset( $cache[$field] ) && strlen( $cache[$field] ) > 100*1024 ) {
if ( isset( $cache[$field] ) && strlen( $cache[$field] ) > 100 * 1024 ) {
unset( $cache[$field] ); // don't let the value get too big
}
}
@ -2634,7 +2634,7 @@ class LocalFileMoveBatch {
*/
function getMoveTriplets() {
$moves = array_merge( array( $this->cur ), $this->olds );
$triplets = array(); // The format is: (srcUrl, destZone, destUrl)
$triplets = array(); // The format is: (srcUrl, destZone, destUrl)
foreach ( $moves as $move ) {
// $move: (oldRelativePath, newRelativePath)

View file

@ -1089,7 +1089,6 @@ abstract class Installer {
}
}
/**
* Check the libicu version
*/

View file

@ -255,59 +255,59 @@ if ( !defined( 'MEDIAWIKI' ) ) {
## Uncomment this to disable output compression
# \$wgDisableOutputCompression = true;
\$wgSitename = \"{$this->values['wgSitename']}\";
\$wgSitename = \"{$this->values['wgSitename']}\";
{$metaNamespace}
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## http://www.mediawiki.org/wiki/Manual:Short_URL
\$wgScriptPath = \"{$this->values['wgScriptPath']}\";
\$wgScriptExtension = \"{$this->values['wgScriptExtension']}\";
\$wgScriptPath = \"{$this->values['wgScriptPath']}\";
\$wgScriptExtension = \"{$this->values['wgScriptExtension']}\";
## The protocol and server name to use in fully-qualified URLs
\$wgServer = \"{$this->values['wgServer']}\";
\$wgServer = \"{$this->values['wgServer']}\";
## The relative URL path to the skins directory
\$wgStylePath = \"\$wgScriptPath/skins\";
\$wgStylePath = \"\$wgScriptPath/skins\";
## The relative URL path to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
\$wgLogo = \"\$wgStylePath/common/images/wiki.png\";
\$wgLogo = \"\$wgStylePath/common/images/wiki.png\";
## UPO means: this is also a user preference option
\$wgEnableEmail = {$this->values['wgEnableEmail']};
\$wgEnableUserEmail = {$this->values['wgEnableUserEmail']}; # UPO
\$wgEnableEmail = {$this->values['wgEnableEmail']};
\$wgEnableUserEmail = {$this->values['wgEnableUserEmail']}; # UPO
\$wgEmergencyContact = \"{$this->values['wgEmergencyContact']}\";
\$wgPasswordSender = \"{$this->values['wgPasswordSender']}\";
\$wgPasswordSender = \"{$this->values['wgPasswordSender']}\";
\$wgEnotifUserTalk = {$this->values['wgEnotifUserTalk']}; # UPO
\$wgEnotifWatchlist = {$this->values['wgEnotifWatchlist']}; # UPO
\$wgEnotifUserTalk = {$this->values['wgEnotifUserTalk']}; # UPO
\$wgEnotifWatchlist = {$this->values['wgEnotifWatchlist']}; # UPO
\$wgEmailAuthentication = {$this->values['wgEmailAuthentication']};
## Database settings
\$wgDBtype = \"{$this->values['wgDBtype']}\";
\$wgDBserver = \"{$this->values['wgDBserver']}\";
\$wgDBname = \"{$this->values['wgDBname']}\";
\$wgDBuser = \"{$this->values['wgDBuser']}\";
\$wgDBpassword = \"{$this->values['wgDBpassword']}\";
\$wgDBtype = \"{$this->values['wgDBtype']}\";
\$wgDBserver = \"{$this->values['wgDBserver']}\";
\$wgDBname = \"{$this->values['wgDBname']}\";
\$wgDBuser = \"{$this->values['wgDBuser']}\";
\$wgDBpassword = \"{$this->values['wgDBpassword']}\";
{$this->dbSettings}
## Shared memory settings
\$wgMainCacheType = $cacheType;
\$wgMainCacheType = $cacheType;
\$wgMemCachedServers = $mcservers;
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
\$wgEnableUploads = {$this->values['wgEnableUploads']};
\$wgEnableUploads = {$this->values['wgEnableUploads']};
{$magic}\$wgUseImageMagick = true;
{$magic}\$wgImageMagickConvertCommand = \"{$this->values['wgImageMagickConvertCommand']}\";
# InstantCommons allows wiki to use images from http://commons.wikimedia.org
\$wgUseInstantCommons = {$this->values['wgUseInstantCommons']};
\$wgUseInstantCommons = {$this->values['wgUseInstantCommons']};
## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
@ -342,7 +342,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
\$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright
\$wgRightsUrl = \"{$this->values['wgRightsUrl']}\";
\$wgRightsUrl = \"{$this->values['wgRightsUrl']}\";
\$wgRightsText = \"{$this->values['wgRightsText']}\";
\$wgRightsIcon = \"{$this->values['wgRightsIcon']}\";

View file

@ -637,10 +637,10 @@ class MysqlInstaller extends DatabaseInstaller {
$tblOpts = LocalSettingsGenerator::escapePhpString( $this->getTableOptions() );
return
"# MySQL specific settings
\$wgDBprefix = \"{$prefix}\";
\$wgDBprefix = \"{$prefix}\";
# MySQL table options to use during installation or update
\$wgDBTableOptions = \"{$tblOpts}\";
\$wgDBTableOptions = \"{$tblOpts}\";
# Experimental charset support for MySQL 5.0.
\$wgDBmysql5 = {$dbmysql5};";

View file

@ -416,7 +416,7 @@ class MysqlUpdater extends DatabaseUpdater {
if ( $prev_title == $row->cur_title && $prev_namespace == $row->cur_namespace ) {
$deleteId[] = $row->cur_id;
}
$prev_title = $row->cur_title;
$prev_title = $row->cur_title;
$prev_namespace = $row->cur_namespace;
}
$sql = "DELETE FROM $cur WHERE cur_id IN ( " . join( ',', $deleteId ) . ')';

View file

@ -202,7 +202,6 @@ class OracleInstaller extends DatabaseInstaller {
$this->parent->addInstallStep( $callback, 'database' );
}
public function setupDatabase() {
$status = Status::newGood();
return $status;
@ -294,7 +293,7 @@ class OracleInstaller extends DatabaseInstaller {
$prefix = $this->getVar( 'wgDBprefix' );
return
"# Oracle specific settings
\$wgDBprefix = \"{$prefix}\";
\$wgDBprefix = \"{$prefix}\";
";
}

View file

@ -531,8 +531,8 @@ class PostgresInstaller extends DatabaseInstaller {
$schema = $this->getVar( 'wgDBmwschema' );
return
"# Postgres specific settings
\$wgDBport = \"{$port}\";
\$wgDBmwschema = \"{$schema}\";";
\$wgDBport = \"{$port}\";
\$wgDBmwschema = \"{$schema}\";";
}
public function preUpgrade() {

View file

@ -240,7 +240,7 @@ class SqliteInstaller extends DatabaseInstaller {
$module = DatabaseSqlite::getFulltextSearchModule();
$fts3tTable = $this->db->checkForEnabledSearch();
if ( $fts3tTable && !$module ) {
if ( $fts3tTable && !$module ) {
$status->warning( 'config-sqlite-fts3-downgrade' );
$this->db->sourceFile( "$IP/maintenance/sqlite/archives/searchindex-no-fts.sql" );
} elseif ( !$fts3tTable && $module == 'FTS3' ) {
@ -256,6 +256,6 @@ class SqliteInstaller extends DatabaseInstaller {
$dir = LocalSettingsGenerator::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) );
return
"# SQLite-specific settings
\$wgSQLiteDataDir = \"{$dir}\";";
\$wgSQLiteDataDir = \"{$dir}\";";
}
}

View file

@ -124,7 +124,7 @@ class SqliteUpdater extends DatabaseUpdater {
protected function sqliteSetupSearchindex() {
$module = DatabaseSqlite::getFulltextSearchModule();
$fts3tTable = $this->updateRowExists( 'fts3' );
if ( $fts3tTable && !$module ) {
if ( $fts3tTable && !$module ) {
$this->applyPatch( 'searchindex-no-fts.sql', false, 'PHP is missing FTS3 support, downgrading tables' );
} elseif ( !$fts3tTable && $module == 'FTS3' ) {
$this->applyPatch( 'searchindex-fts3.sql', false, "Adding FTS3 search capabilities" );

View file

@ -41,9 +41,9 @@ abstract class JobQueue {
* @param $params array
*/
protected function __construct( array $params ) {
$this->wiki = $params['wiki'];
$this->type = $params['type'];
$this->order = isset( $params['order'] ) ? $params['order'] : 'random';
$this->wiki = $params['wiki'];
$this->type = $params['type'];
$this->order = isset( $params['order'] ) ? $params['order'] : 'random';
$this->claimTTL = isset( $params['claimTTL'] ) ? $params['claimTTL'] : 0;
$this->maxTries = isset( $params['maxTries'] ) ? $params['maxTries'] : 3;
}

View file

@ -28,12 +28,12 @@
* @since 1.21
*/
class JobQueueDB extends JobQueue {
const ROOTJOB_TTL = 1209600; // integer; seconds to remember root jobs (14 days)
const ROOTJOB_TTL = 1209600; // integer; seconds to remember root jobs (14 days)
const CACHE_TTL_SHORT = 30; // integer; seconds to cache info without re-validating
const CACHE_TTL_LONG = 300; // integer; seconds to cache info that is kept up to date
const MAX_AGE_PRUNE = 604800; // integer; seconds a job can live once claimed
const MAX_JOB_RANDOM = 2147483647; // integer; 2^31 - 1, used for job_random
const MAX_OFFSET = 255; // integer; maximum number of rows to skip
const CACHE_TTL_LONG = 300; // integer; seconds to cache info that is kept up to date
const MAX_AGE_PRUNE = 604800; // integer; seconds a job can live once claimed
const MAX_JOB_RANDOM = 2147483647; // integer; 2^31 - 1, used for job_random
const MAX_OFFSET = 255; // integer; maximum number of rows to skip
protected $cluster = false; // string; name of an external DB cluster
@ -225,8 +225,8 @@ class JobQueueDB extends JobQueue {
$row = $this->claimOldest( $uuid );
} else { // random first
$rand = mt_rand( 0, self::MAX_JOB_RANDOM ); // encourage concurrent UPDATEs
$gte = (bool)mt_rand( 0, 1 ); // find rows with rand before/after $rand
$row = $this->claimRandom( $uuid, $rand, $gte );
$gte = (bool)mt_rand( 0, 1 ); // find rows with rand before/after $rand
$row = $this->claimRandom( $uuid, $rand, $gte );
}
// Check if we found a row to reserve...
if ( !$row ) {
@ -281,8 +281,8 @@ class JobQueueDB extends JobQueue {
// For small queues, using OFFSET will overshoot and return no rows more often.
// Instead, this uses job_random to pick a row (possibly checking both directions).
$ineq = $gte ? '>=' : '<=';
$dir = $gte ? 'ASC' : 'DESC';
$row = $dbw->selectRow( 'job', '*', // find a random job
$dir = $gte ? 'ASC' : 'DESC';
$row = $dbw->selectRow( 'job', '*', // find a random job
array(
'job_cmd' => $this->type,
'job_token' => '', // unclaimed

View file

@ -37,7 +37,7 @@ class JobQueueGroup {
protected $wiki; // string; wiki ID
const TYPE_DEFAULT = 1; // integer; jobs popped by default
const TYPE_ANY = 2; // integer; any job
const TYPE_ANY = 2; // integer; any job
const USE_CACHE = 1; // integer; use process or persistent cache

Some files were not shown because too many files have changed in this diff Show more