return $this->mContent;
}
-
/**
* Get text content object
* Does *NOT* follow redirects.
'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',
'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',
'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',
# 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();
}
}
-
/**
* Writer class which uses the DBA extension
*/
}
}
-
/**
* Generate a list of changes using the good old system (no javascript)
*/
}
}
-
/**
* Generate a list of changes using an Enhanced system (uses javascript).
*/
}
}
-
class IcuCollation extends Collation {
var $primaryCollator, $mainCollator, $locale;
var $firstLetterData;
*/
var $stateStack;
-
/**
* The path stack is a stack of associative arrays with the following elements:
* name The name of top level of the path
*/
$wgScriptExtension = '.php';
-
/**@}*/
/************************************************************************//**
),
);
-
/** Determines if a failed virus scan (AV_SCAN_FAILED) will cause the file to be rejected. */
$wgAntivirusRequired = true;
/**@}*/ # End of DB settings }
-
/************************************************************************//**
* @name Text storage
* @{
*/
$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.
/** @} */ # End of resource loader settings }
-
/*************************************************************************//**
* @name Page title and interwiki link settings
* @{
*/
$wgMaxGeneratedPPNodeCount = 1000000;
-
/**
* Maximum recursion depth for templates within templates.
* The current parser adds two levels to the PHP call stack for each template,
$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;
$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;
$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;
// 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
*/
$wgCookieDomain = '';
-
/**
* Set this variable if you want to restrict cookies to a certain path within
* the domain specified by $wgCookieDomain.
),
);
-
/**
* Overwrite the caching key prefix with custom value.
* @since 1.19
define( 'DB_WRITE', -2 );
define( 'DB_LAST', -3 ); # deprecated since 2008, usage throws exception
-
/**@{
* Virtual namespaces; don't appear in the page database
*/
/**
* 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
/**
* 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.
$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
$this->starttime = null;
}
- $this->recreate = $request->getCheck( 'wpRecreate' );
+ $this->recreate = $request->getCheck( 'wpRecreate' );
$this->minoredit = $request->getCheck( 'wpMinoredit' );
$this->watchthis = $request->getCheck( 'wpWatchthis' );
} 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)
$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 );
}
}
-
/**
* Use this method before edit() to preload some text into the edit box
*
$this->showHeaderCopyrightWarning();
}
-
/**
* Standard summary input and label (wgSummary), abstracted so EditPage
* subclasses may reorganize the form.
$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;
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 ) {
}
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";
}
}
-
/**
* Base class for output stream; prints to stdout or buffer or whereever.
* @ingroup Dump
}
}
-
/**
* Dump output filter to include only the last revision in each page sequence.
* @ingroup Dump
return $total;
}
-
/**
* Fallback implementation of mb_strpos, hardcoded to UTF-8.
* @param $haystack String
}
}
-
// Support for Wietse Venema's taint feature
if ( !function_exists( 'istainted' ) ) {
/**
return urldecode( $matches[1] );
}
-
-
/**
* Make URL indexes, appropriate for the el_index field of externallinks.
*
$frame['function'];
}
-
/* Some generic result counters, pulled out of SearchEngine */
-
/**
* @todo document
*
*/
class HTMLRadioField extends HTMLFormField {
-
function validate( $value, $alldata ) {
$p = parent::validate( $value, $alldata );
}
}
-
/**
* Pointer object for an item within a CGZ blob stored in the text table.
*/
}
}
-
/**
* 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
unset( self::$handlers[$name] );
}
-
/**
* Attach an event handler to a given hook
*
return (int)$this->respStatus;
}
-
/**
* Returns true if the last status code was a redirect.
*
if ( isset( $url['host'] ) ) {
$domain = $url[ 'scheme' ] . '://' . $url[ 'host' ];
- break; //found correct URI (with host)
+ break; //found correct URI (with host)
} else {
$foundRelativeURI = true;
}
return long2ip( ( hexdec( $m[1] ) << 16 ) + hexdec( $m[2] ) );
}
- return null; // give up
+ return null; // give up
}
/**
* @file
*/
-
/**
* Some functions to help implement an external link filter for spam control.
*
return self::userToolLinks( $userId, $userText, true, 0, $edits );
}
-
/**
* @param $userId Integer: user id in database.
* @param $userText String: user name in database.
}
}
-
/**
* Returns true if the text matches the word, and alters the
* input string, removing all instances of the word
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
$ext = $this->getExtensionsForType( $mime );
if ( !$ext ) {
- return null; // Unknown mime type
+ return null; // Unknown mime type
}
$ext = explode( ' ', $ext );
$this->addHTML( $text );
}
-
/**
* Add the output of a QuickTemplate to the output buffer
*
$this->mJsConfigVars[$keys] = $value;
}
-
/**
* Get an array containing the variables to be set in mw.config in JavaScript.
*
) );
}
-
# Language variants
if ( !$wgDisableLangConversion && $wgCanonicalLanguageLinks ) {
$lang = $this->getTitle()->getPageLanguage();
protected function getDefaultDirections() { return false; }
}
-
/**
* IndexPager with an alphabetic list and a formatted navigation bar
* @ingroup Pager
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.
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'];
}
}
// 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 );
);
}
-
$defaultPreferences['emailaddress'] = array(
'type' => 'info',
'raw' => true,
'label-message' => 'tog-forceeditsummary',
);
-
$defaultPreferences['uselivepreview'] = array(
'type' => 'toggle',
'section' => 'editing/advancedediting',
'min' => 0,
);
-
if ( $wgVectorUseSimpleSearch ) {
$defaultPreferences['vector-simplesearch'] = array(
'type' => 'toggle',
# 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>
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
'rc_params' => ''
);
- $rc->mExtra = array(
+ $rc->mExtra = array(
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => $lastTimestamp,
'oldSize' => $oldSize,
'rc_params' => ''
);
- $rc->mExtra = array(
+ $rc->mExtra = array(
'prefixedDBkey' => $title->getPrefixedDBkey(),
'lastTimestamp' => 0,
'oldSize' => 0,
'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
// 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]
// 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 = "/
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";
( $this->getTitle()->getArticleID() == 0 || $action == 'history' ) ) {
$n = $this->getTitle()->isDeleted();
-
if ( $n ) {
if ( $this->getUser()->isAllowed( 'undelete' ) ) {
$msg = 'thisisdeleted';
$userLang = $this->getLanguage();
$userLangCode = $userLang->getHtmlCode();
- $userLangDir = $userLang->getDir();
+ $userLangDir = $userLang->getDir();
$tpl->set( 'lang', $userLangCode );
$tpl->set( 'dir', $userLangDir );
var $mHasSubpage; // /< Whether a page has any subpages
// @}
-
/**
* Constructor
*/
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 ) == '/..'
)
return $retVal;
}
-
/**
* Get a list of URLs to purge from the Squid cache when this
* page changes
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 );
}
}
-
/**
* Get blocking information
* @param $bFromSlave Bool Whether to check the slave database first. To
// 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();
* @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
}
}
-
/**
* Collection of static functions for sending mail
*/
$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 );
}
}
// 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() ) )
{
// 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 ) {
$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();
}
$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 ) {
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 .= '>';
/**
* 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 );
/**
return $this->mModuleName;
}
-
/**
* Get the module manager, or null if this module has no sub-modules
* @since 1.21
if ( $t === '' ) {
$nothingPrompt = 'Can be empty, or ';
} else {
- $choices[] = $t;
+ $choices[] = $t;
}
}
$desc .= $paramPrefix . $nothingPrompt . $prompt;
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' ) ) ) {
case LoginForm::ABORTED:
$result['result'] = 'Aborted';
- $result['reason'] = $loginForm->mAbortLoginErrorMsg;
+ $result['reason'] = $loginForm->mAbortLoginErrorMsg;
break;
default:
$this->profileDBOut();
}
- $this->initFromQueryResult( $res, $remaining, false ); // process PageIDs
+ $this->initFromQueryResult( $res, $remaining, false ); // process PageIDs
// Resolve any found redirects
$this->resolvePendingRedirects();
// 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
$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 );
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();
$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();
*/
private function run( $resultPageSet = null ) {
if ( $this->getPageSet()->getGoodTitleCount() == 0 ) {
- return; // nothing to do
+ return; // nothing to do
}
$params = $this->extractRequestParams();
$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'];
}
// 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'];
$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' );
$file['suppressed'] = '';
}
-
$fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $file );
if ( !$fit ) {
$this->setContinueEnumParameter( 'continue', $row->fa_name );
*/
private function run( $resultPageSet = null ) {
if ( $this->getPageSet()->getGoodTitleCount() == 0 ) {
- return; // nothing to do
+ return; // nothing to do
}
$params = $this->extractRequestParams();
*/
private function run( $resultPageSet = null ) {
if ( $this->getPageSet()->getGoodTitleCount() == 0 ) {
- return; // nothing to do
+ return; // nothing to do
}
$params = $this->extractRequestParams();
!is_null( $params['endid'] ) || $params['dir'] === 'newer' ||
!is_null( $params['start'] ) || !is_null( $params['end'] ) );
-
$pageSet = $this->getPageSet();
$pageCount = $pageSet->getGoodTitleCount();
$revCount = $pageSet->getRevisionCount();
$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;
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'] ) ) {
}
}
-
/**
* Check warnings.
* Returns a suitable array for inclusion into API results if there were warnings
return $warnings;
}
-
/**
* Perform the actual upload. Returns a suitable result array on success;
* dies on failure.
*/
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] ) ) {
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",
return $cacheEntry['batches'];
}
-
// 4) ... finally fetch from the slow database :(
$this->getLinks( $table );
$cacheEntry = $this->partitionResult( $this->fullResultCache[$table], $batchSize );
}
}
-
/**
* Load a plural XML file with the given filename, compile the relevant
* rules, and save the compiled rules in a process-local cache.
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();
return $this->getNativeData() === $that->getNativeData();
}
-
/**
* Returns a list of DataUpdate objects for recording information about this
* Content in some secondary data store.
return $parserOutput->getSecondaryDataUpdates( $title, $recursive );
}
-
/**
* @see Content::getRedirectChain
*
return new CssContent( $pst );
}
-
protected function getHtml( ) {
$html = "";
$html .= "<pre class=\"mw-code mw-css\" dir=\"ltr\">\n";
return new JavaScriptContent( $pst );
}
-
protected function getHtml( ) {
$html = "";
$html .= "<pre class=\"mw-code mw-js\" dir=\"ltr\">\n";
return $diff;
}
-
/**
* Returns a generic ParserOutput object, wrapping the HTML returned by
* getHtml().
return new WikitextContent( '' );
}
-
/**
* Returns a WikitextContent object representing a redirect to the given destination page.
*
*/
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
*/
protected $fileHandle = null;
-
# ------------------------------------------------------------------------------
# Accessors
# ------------------------------------------------------------------------------
&& 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
$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();
TO $newUser
;
" );
-
-
}
function encodeBlob( $b ) {
parent::reportQueryError( $error, $errno, $sql, $fname, false );
}
-
function queryIgnore( $sql, $fname = 'DatabasePostgres::queryIgnore' ) {
return $this->query( $sql, $fname, true );
}
return $a;
}
-
function indexUnique( $table, $index, $fname = 'DatabasePostgres::indexUnique' ) {
$sql = "SELECT indexname FROM pg_indexes WHERE tablename='{$table}'".
" AND indexdef LIKE 'CREATE UNIQUE%(" .
return '[http://www.postgresql.org/ PostgreSQL]';
}
-
/**
* Return current schema (executes SELECT current_schema())
* Needs transaction
*/
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 );
* @return bool
*/
function wasErrorReissuable() {
- return $this->lastErrno() == 17; // SQLITE_SCHEMA;
+ return $this->lastErrno() == 17; // SQLITE_SCHEMA;
}
/**
return $this->query( $sql, $fname );
}
-
/**
* List all tables on the database
*
* 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 ) {
interface IORMRow {
-
/**
* Constructor.
*
*/
public function setReadDb( $db );
-
/**
* Get the ID of the any foreign wiki to use as a target for database operations
*
* @ingroup Database
*/
-
/**
* A multi-wiki, multi-master factory for Wikimedia and similar installations.
* Ignores the old configuration globals
$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;
}
}
* @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 );
}
* @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();
* @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() );
}
* @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 );
trigger_error( "Reversed closing doesn't match", E_USER_ERROR );
}
-
$prevtype = 'none';
foreach ( $this->edits as $edit ) {
if ( $prevtype == $edit->type ) {
return $this->msg( 'lineno' )->numParams( $matches[1] )->escaped();
}
-
/**
* If there are revisions between the ones being compared, return a note saying so.
* @return string
$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
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
}
}
$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 ) {
*/
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 );
}
$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 {
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 );
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 );
*/
public function nameForThumb( $name ) {
if ( strlen( $name ) > $this->abbrvThreshold ) {
- $ext = FileBackend::extensionFromPath( $name );
+ $ext = FileBackend::extensionFromPath( $name );
$name = ( $ext == '' ) ? 'thumbnail' : "thumbnail.$ext";
}
return $name;
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 );
$expiry = 86400; // has invalidation, 1 day
}
$cachedValue = $wgMemc->get( $memcKey );
- if ( $cachedValue === ' ' || $cachedValue === '' ) {
+ if ( $cachedValue === ' ' || $cachedValue === '' ) {
// Does not exist
return false;
} elseif ( strval( $cachedValue ) !== '' ) {
'page_namespace' => $title->getNamespace(),
'page_title' => $title->getDBkey(),
),
- __METHOD__ //Function name
+ __METHOD__ //Function name
);
return $id;
}
// 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
}
}
*/
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)
}
}
-
/**
* Check the libicu version
*/
## 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
## 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']}\";
$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};";
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 ) . ')';
$this->parent->addInstallStep( $callback, 'database' );
}
-
public function setupDatabase() {
$status = Status::newGood();
return $status;
$prefix = $this->getVar( 'wgDBprefix' );
return
"# Oracle specific settings
-\$wgDBprefix = \"{$prefix}\";
+\$wgDBprefix = \"{$prefix}\";
";
}
$schema = $this->getVar( 'wgDBmwschema' );
return
"# Postgres specific settings
-\$wgDBport = \"{$port}\";
-\$wgDBmwschema = \"{$schema}\";";
+\$wgDBport = \"{$port}\";
+\$wgDBmwschema = \"{$schema}\";";
}
public function preUpgrade() {
$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' ) {
$dir = LocalSettingsGenerator::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) );
return
"# SQLite-specific settings
-\$wgSQLiteDataDir = \"{$dir}\";";
+\$wgSQLiteDataDir = \"{$dir}\";";
}
}
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" );
* @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;
}
* @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
$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 ) {
// 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
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
protected $server; // string; server address
- 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 MAX_AGE_PRUNE = 604800; // integer; seconds a job can live once claimed (7 days)
protected $key; // string; key to prefix the queue keys with (used for testing)
*/
public static function newFromJob( Job $job ) {
$djob = new self( $job->getTitle(), $job->getParams(), $job->getId() );
- $djob->command = $job->getType();
- $djob->params = is_array( $djob->params ) ? $djob->params : array();
- $djob->params = array( 'isDuplicate' => true ) + $djob->params;
+ $djob->command = $job->getType();
+ $djob->params = is_array( $djob->params ) ? $djob->params : array();
+ $djob->params = array( 'isDuplicate' => true ) + $djob->params;
$djob->metadata = $job->metadata;
return $djob;
}
parent::__construct( 'htmlCacheUpdate', $title, $params, $id );
- $this->rowsPerJob = $wgUpdateRowsPerJob;
+ $this->rowsPerJob = $wgUpdateRowsPerJob;
$this->rowsPerQuery = $wgUpdateRowsPerQuery;
- $this->blCache = $title->getBacklinkCache();
+ $this->blCache = $title->getBacklinkCache();
}
public function run() {
$masterPos = false;
}
- $tbc = $this->title->getBacklinkCache();
+ $tbc = $this->title->getBacklinkCache();
$jobs = array(); // jobs to insert
if ( isset( $this->params['start'] ) && isset( $this->params['end'] ) ) {
*/
protected function getSingleTitleJobs( $table, $masterPos ) {
# The "start"/"end" fields are not set for the base jobs
- $start = isset( $this->params['start'] ) ? $this->params['start'] : false;
- $end = isset( $this->params['end'] ) ? $this->params['end'] : false;
+ $start = isset( $this->params['start'] ) ? $this->params['start'] : false;
+ $end = isset( $this->params['end'] ) ? $this->params['end'] : false;
$titles = $this->title->getBacklinkCache()->getLinks( $table, $start, $end );
# Convert into single page refresh links jobs.
# This handles well when in sapi mode and is useful in any case for job
}
$changeText = $this->context->getLanguage()->listToText( $changes );
-
$newParams = array_slice( $params, 0, 3 );
$newParams[3] = $changeText;
$count = count( explode( ',', $params[$paramStart] ) );
return $messages[$flag];
}
-
/**
* Name of the log.
* @return Message
return true;
}
-
/**
* Extracts the width/height if the image will be scaled before rotating
*
return array( $width, $height );
}
-
/**
* Function that returns the number of pixels to be thumbnailed.
* Intended for animated GIFs to multiply by the number of frames.
return $this->getClientScalingThumbnailImage( $image, $scalerParams );
}
-
if ( $scaler == 'client' ) {
# Client-side image scaling, use the source URL
# Using the destination URL in a TRANSFORM_LATER request would be incorrect
$rotation = $this->getRotation( $image );
list( $width, $height ) = $this->extractPreRotationDimensions( $params, $rotation );
- $cmd =
+ $cmd =
wfEscapeShellArg( $wgImageMagickConvertCommand ) .
// Specify white background color, will be used for transparent images
// in Internet Explorer/Windows instead of default black.
$this->addMetadata( $iptc, $this->iptcType );
}
-
/**
* Get exif info using exif class.
* Basically what used to be in BitmapHandler::getMetadata().
}
}
-
-
}
return $info !== false;
}
-
/**
* Return data in the style of getimagesize()
* @return array or false on failure
$data = $this->getInfo();
if( $data !== false ) {
- $width = $data['width'];
+ $width = $data['width'];
$height = $data['height'];
return array( $width, $height, 'DjVu',
*/
class Exif {
- const BYTE = 1; //!< An 8-bit (1-byte) unsigned integer.
- const ASCII = 2; //!< An 8-bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL.
- const SHORT = 3; //!< A 16-bit (2-byte) unsigned integer.
- const LONG = 4; //!< A 32-bit (4-byte) unsigned integer.
- const RATIONAL = 5; //!< Two LONGs. The first LONG is the numerator and the second LONG expresses the denominator
- const UNDEFINED = 7; //!< An 8-bit byte that can take any value depending on the field definition
- const SLONG = 9; //!< A 32-bit (4-byte) signed integer (2's complement notation),
- const SRATIONAL = 10; //!< Two SLONGs. The first SLONG is the numerator and the second SLONG is the denominator.
- const IGNORE = -1; // A fake value for things we don't want or don't support.
+ const BYTE = 1; //!< An 8-bit (1-byte) unsigned integer.
+ const ASCII = 2; //!< An 8-bit byte containing one 7-bit ASCII code. The final byte is terminated with NULL.
+ const SHORT = 3; //!< A 16-bit (2-byte) unsigned integer.
+ const LONG = 4; //!< A 32-bit (4-byte) unsigned integer.
+ const RATIONAL = 5; //!< Two LONGs. The first LONG is the numerator and the second LONG expresses the denominator
+ const UNDEFINED = 7; //!< An 8-bit byte that can take any value depending on the field definition
+ const SLONG = 9; //!< A 32-bit (4-byte) signed integer (2's complement notation),
+ const SRATIONAL = 10; //!< Two SLONGs. The first SLONG is the numerator and the second SLONG is the denominator.
+ const IGNORE = -1; // A fake value for things we don't want or don't support.
//@{
/* @var array
* @file
*/
-
/**
* Format Image metadata values into a human readable form.
*
}
break;
-
case 'GPSTrackRef':
case 'GPSImgDirectionRef':
case 'GPSDestBearingRef':
*/
static function readGCT( $fh, $bpp ) {
if ( $bpp > 0 ) {
- for( $i=1; $i<=pow( 2, $bpp ); ++$i ) {
+ for( $i = 1; $i <= pow( 2, $bpp ); ++$i ) {
fread( $fh, 3 );
}
}
case "\x1b(K":
$c = "ISO646-DE";
break;
- case "\x1b(N": //crylic
+ case "\x1b(N": //crylic
$c = "ISO_5427";
break;
case "\x1b(`": //iso646-NO
$params['height'] = $params['physicalHeight'];
}
-
if ( !$this->validateThumbParams( $params['physicalWidth'],
$params['physicalHeight'], $srcWidth, $srcHeight, $mimeType ) ) {
return false;
return self::METADATA_GOOD;
}
-
/**
* Get a MediaTransformOutput object representing an alternate of the transformed
* output which will call an intermediary thumbnail assist script.
return $fields;
}
-
/**
* This is used to generate an array element for each metadata value
* That array is then used to generate the table of metadata values
* element pops up when we're in that mode, we ignore it.
*/
const MODE_INITIAL = 0;
- const MODE_IGNORE = 1;
- const MODE_LI = 2;
+ const MODE_IGNORE = 1;
+ const MODE_LI = 2;
const MODE_LI_LANG = 3;
- const MODE_QDESC = 4;
+ const MODE_QDESC = 4;
// The following MODE constants are also used in the
// $items array to denote what type of property the item is.
- const MODE_SIMPLE = 10;
- const MODE_STRUCT = 11; // structure (associative array)
- const MODE_SEQ = 12; // ordered list
- const MODE_BAG = 13; // unordered list
- const MODE_LANG = 14;
- const MODE_ALT = 15; // non-language alt. Currently not implemented, and not needed atm.
+ const MODE_SIMPLE = 10;
+ const MODE_STRUCT = 11; // structure (associative array)
+ const MODE_SEQ = 12; // ordered list
+ const MODE_BAG = 13; // unordered list
+ const MODE_LANG = 14;
+ const MODE_ALT = 15; // non-language alt. Currently not implemented, and not needed atm.
const MODE_BAGSTRUCT = 16; // A BAG of Structs.
const NS_RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
const NS_XML = 'http://www.w3.org/XML/1998/namespace';
-
/**
* Constructor.
*
}
}
-
// We don't want to return the special values, since they're
// special and not info to be stored about the file.
unset( $data['xmp-special'] );
return false;
}
-
// we're not very robust here. we should accept it in the wrong order. To quote
// the xmp standard:
// "A JPEG writer should write the ExtendedXMP marker segments in order, immediately following the
array_shift( $this->mode );
array_shift( $this->curItem );
}
-
-
}
/**
$this->mode[0] = self::MODE_QDESC;
}
foreach ( $attribs as $name => $val ) {
-
-
if ( strpos( $name, ' ' ) === false ) {
// This shouldn't happen, but so far some old software forgets namespace
// on rdf:about.
return;
}
-
// Extra check for empty string necessary due to TZ but no second case.
$stripSeconds = false;
if ( !isset( $res[6] ) || $res[6] === '' ) {
$z >>= $length;
# Add in the free bits from subsequent bytes
- for ( $i=1; $i<$length; $i++ ) {
+ for ( $i=1; $i < $length; $i++ ) {
$z <<= 6;
$z |= ord( $char[$i] ) & 0x3f;
}
return true;
}
- $uRTT = ceil( 1e6 * ( microtime( true ) - $timestamp ) ); // estimate RTT (us)
+ $uRTT = ceil( 1e6 * ( microtime( true ) - $timestamp ) ); // estimate RTT (us)
$sleep = 2*$uRTT; // rough time to do get()+set()
- $locked = false; // lock acquired
+ $locked = false; // lock acquired
$attempts = 0; // failed attempts
do {
if ( ++$attempts >= 3 && $sleep <= 1e6 ) {
// }}}
-
/**
* Command statistics
*
// }}}
}
-
// }}}
class MemCachedClientforWiki extends MWMemcached {
*
* @file
*/
+
class RedisBagOStuff extends BagOStuff {
/** @var RedisConnectionPool */
protected $redisPool;
return self::formatRaw( SiteStats::numberingroup( strtolower( $name ) ), $raw );
}
-
/**
* Given a title, return the namespace name that would be given by the
* corresponding magic word
$this->lang = $lang;
$this->monthNames = $this->getMonthRegex();
- for ( $i=1; $i<=12; $i++ ) {
+ for ( $i = 1; $i <= 12; $i++ ) {
$this->xMonths[$this->lang->lc( $this->lang->getMonthName( $i ) )] = $i;
$this->xMonths[$this->lang->lc( $this->lang->getMonthAbbreviation( $i ) )] = $i;
}
} else {
$preference = self::NONE;
}
- for ( $i=1; $i<=self::LAST; $i++ ) {
+ for ( $i = 1; $i <= self::LAST; $i++ ) {
$this->mSource = $i;
if ( isset ( $this->rules[$preference][$i] ) ) {
# Specific rules
$bits = array();
$key = $this->keys[$this->mSource];
- for ( $p=0; $p < strlen( $key ); $p++ ) {
+ for ( $p = 0; $p < strlen( $key ); $p++ ) {
if ( $key[$p] != ' ' ) {
$bits[$key[$p]] = $matches[$p+1];
}
$bits['d'] = sprintf( '%02d', $bits['j'] );
}
- for ( $p=0; $p < strlen( $format ); $p++ ) {
+ for ( $p = 0; $p < strlen( $format ); $p++ ) {
$char = $format[$p];
switch ( $char ) {
case 'd': # ISO day of month
}
}
-
if( !$linkBatch->isEmpty() ) {
// construct query
$dbr = wfGetDB( DB_SLAVE );
*/
function replaceTextCallback( $matches ) {
$type = $matches[1];
- $key = $matches[2];
+ $key = $matches[2];
if( $type == 'LINK' ) {
list( $ns, $index ) = explode( ':', $key, 2 );
if( isset( $this->internals[$ns][$index]['text'] ) ) {
var $mFunctionHooks = array();
var $mFunctionSynonyms = array( 0 => array(), 1 => array() );
var $mFunctionTagHooks = array();
- var $mStripList = array();
- var $mDefaultStripList = array();
+ var $mStripList = array();
+ var $mDefaultStripList = array();
var $mVarCache = array();
var $mImageParams = array();
var $mImageParamsMagicArray = array();
$this->mUniqPrefix = "\x7fUNIQ" . self::getRandomString();
$this->mStripState = new StripState( $this->mUniqPrefix );
-
# Clear these on every parse, bug 4549
$this->mTplExpandCache = $this->mTplRedirCache = $this->mTplDomCache = array();
}
if ( count( $p ) > 5 ) {
# comment
- $element = $p[4];
+ $element = $p[4];
$attributes = '';
- $close = '';
- $inside = $p[5];
+ $close = '';
+ $inside = $p[5];
} else {
# tag
- $element = $p[1];
+ $element = $p[1];
$attributes = $p[2];
- $close = $p[3];
- $inside = $p[4];
+ $close = $p[3];
+ $inside = $p[4];
}
$marker = "$uniq_prefix-$element-" . sprintf( '%08X', $n++ ) . self::MARKER_SUFFIX;
array_push( $tr_history, false );
array_push( $td_history, false );
array_push( $last_tag_history, '' );
- } elseif ( $first_character === '|' || $first_character === '!' || substr( $line, 0, 2 ) === '|+' ) {
+ } elseif ( $first_character === '|' || $first_character === '!' || substr( $line, 0, 2 ) === '|+' ) {
# This might be cell elements, td, th or captions
if ( substr( $line, 0, 2 ) === '|+' ) {
$first_character = '+';
return $text . $trail;
}
-
/**
* Parse headers and return html
*
wfProfileOut( __METHOD__ . "-might_be_img" );
}
- $wasblank = ( $text == '' );
+ $wasblank = ( $text == '' );
if ( $wasblank ) {
$text = $link;
} else {
# Increase TOC level
$toclevel++;
$sublevelCount[$toclevel] = 0;
- if ( $toclevel<$wgMaxTocLevel ) {
+ if ( $toclevel < $wgMaxTocLevel ) {
$prevtoclevel = $toclevel;
$toc .= Linker::tocIndent();
$numVisible++;
if ( $i == 0 ) {
$toclevel = 1;
}
- if ( $toclevel<$wgMaxTocLevel ) {
+ if ( $toclevel < $wgMaxTocLevel ) {
if ( $prevtoclevel < $wgMaxTocLevel ) {
# Unindent only if the previous toc level was shown :p
$toc .= Linker::tocUnindent( $prevtoclevel - $toclevel );
}
} else {
# No change in level, end TOC line
- if ( $toclevel<$wgMaxTocLevel ) {
+ if ( $toclevel < $wgMaxTocLevel ) {
$toc .= Linker::tocLineEnd();
}
}
$confstr .= '*';
}
-
// Space assigned for the stubthreshold but unused
// since it disables the parser cache, its value will always
// be 0 when this function is called by parsercache.
return $this->mProperties;
}
-
/**
* Returns the options from its ParserOptions which have been taken
* into account to produce this output or false if not available.
*/
function getChildrenOfType( $type );
-
/**
* Returns the length of the array, or false if this is not an array-type node
*/
*/
var $depth;
-
/**
* Construct a new preprocessor frame.
* @param $preprocessor Preprocessor The parent preprocessor
*/
var $depth;
-
/**
* Construct a new preprocessor frame.
* @param $preprocessor Preprocessor: the parent preprocessor
$width = 140;
$nameWidth = $width - 65;
- $format = "%-{$nameWidth}s %6d %13.3f %13.3f %13.3f%% %9d (%13.3f -%13.3f) [%d]\n";
+ $format = "%-{$nameWidth}s %6d %13.3f %13.3f %13.3f%% %9d (%13.3f -%13.3f) [%d]\n";
$titleFormat = "%-{$nameWidth}s %6s %13s %13s %13s %9s\n";
$prof = "\nProfiling data\n";
$prof .= sprintf( $titleFormat, 'Name', 'Calls', 'Total', 'Each', '%', 'Mem' );
class ProfilerSimple extends Profiler {
var $mMinimumTime = 0;
- var $zeroEntry = array( 'cpu'=> 0.0, 'cpu_sq' => 0.0, 'real' => 0.0, 'real_sq' => 0.0, 'count' => 0 );
+ var $zeroEntry = array( 'cpu' => 0.0, 'cpu_sq' => 0.0, 'real' => 0.0, 'real_sq' => 0.0, 'count' => 0 );
var $errorEntry;
public function isPersistent() {
$this->registerTestModules();
}
-
wfProfileOut( __METHOD__ );
}
// to propagate to clients quickly
// If there were errors, we also need a shorter expiry time so we can recover quickly
if ( is_null( $context->getVersion() ) || $errors ) {
- $maxage = $wgResourceLoaderMaxage['unversioned']['client'];
+ $maxage = $wgResourceLoaderMaxage['unversioned']['client'];
$smaxage = $wgResourceLoaderMaxage['unversioned']['server'];
// If a version was specified we can use a longer expiry time since changing
// version numbers causes cache misses
} else {
- $maxage = $wgResourceLoaderMaxage['versioned']['client'];
+ $maxage = $wgResourceLoaderMaxage['versioned']['client'];
$smaxage = $wgResourceLoaderMaxage['versioned']['server'];
}
if ( $context->getOnly() === 'styles' ) {
// Interpret request
// List of modules
$modules = $request->getVal( 'modules' );
- $this->modules = $modules ? self::expandModuleNames( $modules ) : array();
+ $this->modules = $modules ? self::expandModuleNames( $modules ) : array();
// Various parameters
- $this->skin = $request->getVal( 'skin' );
- $this->user = $request->getVal( 'user' );
- $this->debug = $request->getFuzzyBool( 'debug', $wgResourceLoaderDebug );
- $this->only = $request->getVal( 'only' );
- $this->version = $request->getVal( 'version' );
- $this->raw = $request->getFuzzyBool( 'raw' );
+ $this->skin = $request->getVal( 'skin' );
+ $this->user = $request->getVal( 'user' );
+ $this->debug = $request->getFuzzyBool( 'debug', $wgResourceLoaderDebug );
+ $this->only = $request->getVal( 'only' );
+ $this->version = $request->getVal( 'version' );
+ $this->raw = $request->getFuzzyBool( 'raw' );
$skinnames = Skin::getSkinNames();
// If no skin is specified, or we don't recognize the skin, use the default skin
public function getLanguage() {
if ( $this->language === null ) {
global $wgLang;
- $this->language = $this->request->getVal( 'lang' );
+ $this->language = $this->request->getVal( 'lang' );
if ( !$this->language ) {
$this->language = $wgLang->getCode();
}
return false;
}
-
/** @var JSParser lazy-initialized; use self::javaScriptParser() */
private static $jsParser;
private static $parseCacheVersion = 1;
if ( strval( $script ) !== '' ) {
$script = $this->validateScriptFile( $titleText, $script );
if ( strpos( $titleText, '*/' ) === false ) {
- $scripts .= "/* $titleText */\n";
+ $scripts .= "/* $titleText */\n";
}
$scripts .= $script . "\n";
}
$styles[$media] = array();
}
if ( strpos( $titleText, '*/' ) === false ) {
- $style = "/* $titleText */\n" . $style;
+ $style = "/* $titleText */\n" . $style;
}
$styles[$media][] = $style;
}
}
}
-
/**
* Item class for a archive table row by ar_rev_id -- actually
* used via RevDel_RevisionList.
$title = Title::newFromText( $searchterm );
-
# Entering an IP address goes to the contributions page
if ( $wgEnableSearchContributorsByIP ) {
if ( ( $title->getNamespace() == NS_USER && User::isIP( $title->getText() ) )
}
}
-
# Entering a user goes to the user page whether it's there or not
if ( $title->getNamespace() == NS_USER ) {
return $title;
# # Some search engines may bail out if too many matches are found
}
-
/**
* @todo FIXME: This class is horribly factored. It would probably be better to
* have a useful base class to which you pass some standard information, then
}
$spat .= '/';
$textExt = array(); // text extracts
- $otherExt = array(); // other extracts
+ $otherExt = array(); // other extracts
wfProfileIn( "$fname-split" );
$start = 0;
$textLen = strlen( $text );
return new MssqlSearchResultSet( $resultSet, $this->searchTerms );
}
-
/**
* Return a partial WHERE clause to exclude redirects, if so set
*
*/
function queryMain( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
- $page = $this->db->tableName( 'page' );
+ $page = $this->db->tableName( 'page' );
$searchindex = $this->db->tableName( 'searchindex' );
return 'SELECT page_id, page_namespace, page_title, ftindex.[RANK]' .
return new MySQLSearchResultSet( $resultSet, $this->searchTerms );
}
-
/**
* Return a partial WHERE clause to exclude redirects, if so set
* @return String
$this->queryRanking( $filteredTerm, $fulltext ) . ' ' );
}
-
/**
* Picks which field to index on, depending on what type of query.
* @param $fulltext Boolean
}
}
-
$searchon = $this->db->addQuotes( ltrim( $searchon, ' &' ) );
$field = $this->getIndexField( $fulltext );
return " CONTAINS($field, $searchon, 1) > 0 ";
array() );
}
-
public static function legalSearchChars() {
return "\"" . parent::legalSearchChars();
}
return new SqliteSearchResultSet( $resultSet, $this->searchTerms, $total );
}
-
/**
* Return a partial WHERE clause to exclude redirects, if so set
* @return String
function getCountQuery( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
- $page = $this->db->tableName( 'page' );
+ $page = $this->db->tableName( 'page' );
$searchindex = $this->db->tableName( 'searchindex' );
return "SELECT COUNT(*) AS c " .
"FROM $page,$searchindex " .
return $page['title'];
}
-
/**
* Get normalization record for a given page title from an API response.
*
const PATH_LINK = 'link';
-
/**
* A version ID that identifies the serialization structure used by getSerializationData()
* and unserialize(). This is useful for constructing cache keys in cases where the cache relies
$this->lang = ( $langObj ? $langObj : $wgContLang );
$this->langcode = $this->lang->getCode();
- $this->foreign = $this->langcode != $wgContLang->getCode();
+ $this->foreign = $this->langcode != $wgContLang->getCode();
$request = $this->getRequest();
function formatValue( $field, $value ) {
switch( $field ) {
-
case 'am_title' :
-
$title = Title::makeTitle( NS_MEDIAWIKI, $value . $this->suffix );
- $talk = Title::makeTitle( NS_MEDIAWIKI_TALK, $value . $this->suffix );
+ $talk = Title::makeTitle( NS_MEDIAWIKI_TALK, $value . $this->suffix );
if( $this->mCurrentRow->am_customised ) {
$title = Linker::linkKnown( $title, $this->getLanguage()->lcfirst( $value ) );
global $wgScript;
$t = $this->getTitle();
- $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
+ $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
$out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
$out .= Html::hidden( 'title', $t->getPrefixedText() );
$out .= Xml::openElement( 'fieldset' );
Linker::link( $self, $this->msg( 'allpages' )->escaped() );
# Do we put a previous link ?
- if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) {
+ if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) {
$query = array( 'from' => $prevTitle->getText() );
if( $namespace )
private function makeForm() {
global $wgScript;
- $form = '<fieldset><legend>' . $this->msg( 'booksources-search-legend' )->escaped() . '</legend>';
+ $form = '<fieldset><legend>' . $this->msg( 'booksources-search-legend' )->escaped() . '</legend>';
$form .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
$form .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() );
$form .= '<p>' . Xml::inputLabel( $this->msg( 'booksources-isbn' )->text(), 'isbn', 'isbn', 20, $this->isbn );
$out->wrapWikiMsg( "<div class=\"error mw-confirmemail-pending\">\n$1\n</div>", 'confirmemail_pending' );
}
$out->addWikiMsg( 'confirmemail_text' );
- $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl() ) );
+ $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl() ) );
$form .= Html::hidden( 'token', $user->getEditToken() );
$form .= Xml::submitButton( $this->msg( 'confirmemail_send' )->text() );
$form .= Xml::closeElement( 'form' );
}
$out->preventClickjacking( $pager->getPreventClickjacking() );
-
# Show the appropriate "footer" message - WHOIS tools, etc.
if ( $this->opts['contribs'] == 'newbie' ) {
$message = 'sp-contributions-footer-newbies';
);
}
-
function sortDescending() {
return false;
}
* @author Brion Vibber
*/
-
/**
* Special:LinkSearch to search the external-links table.
* @ingroup SpecialPage
return $s;
}
-
/**
* Set page title and show header for this log type
* @param $type string
parent::execute( $par );
}
-
function formatResult( $skin, $result ) {
global $wgContLang;
? Title::newFromText( $newTitleText_bc )
: Title::makeTitleSafe( $newTitleTextNs, $newTitleTextMain );
-
$user = $this->getUser();
# Check rights
$msgName = 'movepage-moved-noredirect';
}
-
$out->addHTML( $this->msg( 'movepage-moved' )->rawParams( $oldLink,
$newLink )->params( $oldText, $newText )->parseAsBlock() );
$out->addWikiMsg( $msgName );
}
}
-
/**
* @ingroup SpecialPage Pager
*/
function namespacePrefixForm( $namespace = NS_MAIN, $from = '', $hideredirects = false ) {
global $wgScript;
- $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
+ $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
$out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
$out .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() );
$out .= Xml::openElement( 'fieldset' );
class SpecialProtectedpages extends SpecialPage {
protected $IdLevel = 'level';
- protected $IdType = 'type';
+ protected $IdType = 'type';
public function __construct() {
parent::__construct( 'Protectedpages' );
class SpecialProtectedtitles extends SpecialPage {
protected $IdLevel = 'level';
- protected $IdType = 'type';
+ protected $IdType = 'type';
public function __construct() {
parent::__construct( 'Protectedtitles' );
* @ingroup SpecialPage
*/
class RandomPage extends SpecialPage {
- private $namespaces; // namespaces to select pages from
+ private $namespaces; // namespaces to select pages from
protected $isRedir = false; // should the result be a redirect?
protected $extra = array(); // Extra SQL statements
return $this->rcOptions;
}
-
/**
* Main execution point
*
if( $opts['namespace'] !== '' ) {
$selectedNS = $dbr->addQuotes( $opts['namespace'] );
$operator = $opts['invert'] ? '!=' : '=';
- $boolean = $opts['invert'] ? 'AND' : 'OR';
+ $boolean = $opts['invert'] ? 'AND' : 'OR';
# namespace association (bug 2429)
if( !$opts['associated'] ) {
}
$dl = $lang->pipeList( $dl );
-
// show/hide links
$showhide = array( $this->msg( 'show' )->text(), $this->msg( 'hide' )->text() );
$filters = array(
$out->addHTML( $this->formHeader( $term, $num, $totalRes ) );
$out->addHtml( $this->getProfileForm( $this->profile, $term ) );
-
$out->addHtml( Xml::closeElement( 'form' ) );
$out->addHtml( "<div class='searchresults'>" );
// default for page_namespace is all content namespaces (if requestedNamespace is false)
// otherwise, page_namespace is requestedNamespace
'conds' => array ( 'cl_from IS NULL',
- 'page_namespace' => ( $this->requestedNamespace!==false ? $this->requestedNamespace : MWNamespace::getContentNamespaces() ),
+ 'page_namespace' => ( $this->requestedNamespace !== false ? $this->requestedNamespace : MWNamespace::getContentNamespaces() ),
'page_is_redirect' => 0 ),
'join_conds' => array ( 'categorylinks' => array (
'LEFT JOIN', 'cl_from = page_id' ) )
$makepage = false;
# Page already exists. Import the history, and if necessary
# we'll update the latest revision field in the record.
- $newid = 0;
- $pageId = $page->page_id;
- $previousRevId = $page->page_latest;
+ $newid = 0;
+ $pageId = $page->page_id;
+ $previousRevId = $page->page_latest;
# Get the time span of this page
$previousTimestamp = $dbw->selectField( 'revision', 'rev_timestamp',
array( 'rev_id' => $previousRevId ),
return Status::newFatal( "undeleterevdel" );
}
// Safe to insert now...
- $newid = $article->insertOn( $dbw );
+ $newid = $article->insertOn( $dbw );
$pageId = $newid;
} else {
// Check if a deleted revision will become the current revision...
}
}
- $newid = false;
+ $newid = false;
$pageId = $article->getId();
}
if ( $this->mAllowed ) {
# Slip in the hidden controls here
- $misc = Html::hidden( 'target', $this->mTarget );
+ $misc = Html::hidden( 'target', $this->mTarget );
$misc .= Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() );
$misc .= Xml::closeElement( 'form' );
$out->addHTML( $misc );
}
/** Misc variables **/
- public $mRequest; // The WebRequest or FauxRequest this form is supposed to handle
+ public $mRequest; // The WebRequest or FauxRequest this form is supposed to handle
public $mSourceType;
/**
public $mUploadClicked;
/** User input variables from the "description" section **/
- public $mDesiredDestName; // The requested target file name
+ public $mDesiredDestName; // The requested target file name
public $mComment;
public $mLicense;
/** Hidden variables **/
public $mDestWarningAck;
- public $mForReUpload; // The user followed an "overwrite this file" link
- public $mCancelUpload; // The user clicked "Cancel and return to upload form" button
+ public $mForReUpload; // The user followed an "overwrite this file" link
+ public $mCancelUpload; // The user clicked "Cancel and return to upload form" button
public $mTokenOk;
- public $mUploadSuccessful = false; // Subclasses can use this to determine whether a file was uploaded
+ public $mUploadSuccessful = false; // Subclasses can use this to determine whether a file was uploaded
/** Text injection points for hooks not using HTMLForm **/
public $uploadFormTextTop;
$this->mCopyrightStatus = $request->getText( 'wpUploadCopyStatus' );
$this->mCopyrightSource = $request->getText( 'wpUploadSource' );
-
$this->mForReUpload = $request->getBool( 'wpForReUpload' ); // updating a file
$this->mCancelUpload = $request->getCheck( 'wpCancelUpload' )
|| $request->getCheck( 'wpReUpload' ); // b/w compat
}
}
-
/**
* Provides output to the user for a result of UploadBase::verifyUpload
*
$out = $this->getOutput();
$out->addJsConfigVars( $scriptVars );
-
$out->addModules( array(
'mediawiki.action.edit', // For <charinsert> support
'mediawiki.legacy.upload', // Old form stuff...
// faces etc will probably just fail cleanly here.
$retval = self::RESET_PASS;
} else {
- $retval = ( $this->mPassword == '' ) ? self::EMPTY_PASS : self::WRONG_PASS;
+ $retval = ( $this->mPassword == '' ) ? self::EMPTY_PASS : self::WRONG_PASS;
}
} elseif ( $wgBlockDisablesLogin && $u->isBlocked() ) {
// If we've enabled it, make it so that a blocked user cannot login
return $result;
}
-
/**
* Run any hooks registered for logins, then HTTP redirect to
* $this->mReturnTo (or Main Page if that's undefined). Formerly we had a
return array( $add, $remove );
}
-
/**
* Add a rights log entry for an action.
*/
return $repo->getHeadSHA1();
}
-
/**
* Get the list of entry points and their URLs
* @return string Wikitext
# Up estimate of watched items by 15% to compensate for talk pages...
-
# Toggles
if( $values['hideOwn'] ) {
$conds[] = 'rc_user != ' . $user->getId();
}
$this->mFilteredName = $nt->getDBkey();
-
-
/**
* We'll want to blacklist against *any* 'extension', and use
* only the final one for the whitelist.
$ext = array( $this->mFinalExtension );
}
}
-
}
/* Don't allow users to override the blacklist (check file extension) */
}
# use set to add a remote / data / script target to an element
- if( $strippedElement == 'set' && $stripped == 'to' && preg_match( '!(http|https|data|script):!sim', $value ) ) {
+ if( $strippedElement == 'set' && $stripped == 'to' && preg_match( '!(http|https|data|script):!sim', $value ) ) {
wfDebug( __METHOD__ . ": Found svg setting attibute to '$value' in uploaded file.\n" );
return true;
}
-
# use handler attribute with remote / data / script
- if( $stripped == 'handler' && preg_match( '!(http|https|data|script):!sim', $value ) ) {
+ if( $stripped == 'handler' && preg_match( '!(http|https|data|script):!sim', $value ) ) {
wfDebug( __METHOD__ . ": Found svg setting handler with remote/data/script '$attrib'='$value' in uploaded file.\n" );
return true;
}
}
}
-
foreach( self::getFilenamePrefixBlacklist() as $prefix ) {
if ( substr( $partname, 0, strlen( $prefix ) ) == $prefix ) {
return array(
return $this->removeFileNoAuth( $key );
}
-
/**
* Remove a file (see removeFile), but doesn't check ownership first.
*