* @private
*/
function getHTML() {
- global $wgOut, $wgCategoryMagicGallery, $wgCategoryPagingLimit, $wgContLang;
+ global $wgOut, $wgCategoryMagicGallery, $wgContLang;
wfProfileIn( __METHOD__ );
$this->showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery;
* @return null or true
*/
public function execute( $feed, $rows, $lastmod, $opts ) {
- global $messageMemc, $wgFeedCacheTimeout;
- global $wgSitename, $wgLang, $wgRenderHashAppend;
+ global $wgLang, $wgRenderHashAppend;
if ( !FeedUtils::checkFeedOutput( $this->format ) ) {
return;
* @return one of the constants describing the result
*/
function internalAttemptSave( &$result, $bot = false ) {
- global $wgFilterCallback, $wgUser, $wgOut, $wgParser;
+ global $wgFilterCallback, $wgUser, $wgParser;
global $wgMaxArticleSize;
wfProfileIn( __METHOD__ );
* @return string
*/
function getPreviewText() {
- global $wgOut, $wgUser, $wgTitle, $wgParser, $wgLang, $wgContLang, $wgMessageCache;
+ global $wgOut, $wgUser, $wgParser, $wgMessageCache;
wfProfileIn( __METHOD__ );
* $wgOut to output the exception.
*/
function htmlHeader() {
- global $wgLogo, $wgSitename, $wgOutputEncoding;
+ global $wgLogo, $wgOutputEncoding;
if ( !headers_sent() ) {
header( 'HTTP/1.0 500 Internal Server Error' );
* Show the confirmation form
*/
protected function showForm() {
- global $wgOut, $wgUser, $wgRequest, $wgLang, $wgContLang;
+ global $wgOut, $wgUser, $wgLang, $wgContLang;
$timestamp = $this->getTimestamp();
$form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction() ) );
* Fork a number of worker processes.
*/
protected function forkWorkers( $numProcs ) {
- global $wgMemc, $wgCaches, $wgMainCacheType;
-
$this->prepareEnvironment();
// Create the child processes
* @return string
*/
function wfMsgGetKey( $key, $useDB, $langCode = false, $transform = true ) {
- global $wgContLang, $wgMessageCache;
+ global $wgMessageCache;
wfRunHooks('NormalizeMessageKey', array(&$key, &$useDB, &$langCode, &$transform));
}
function wfGetSiteNotice() {
- global $wgUser, $wgSiteNotice;
+ global $wgUser;
$fname = 'wfGetSiteNotice';
wfProfileIn( $fname );
$siteNotice = '';
public function fileCacheName() {
if( !$this->mFileCache ) {
- global $wgCacheDirectory, $wgFileCacheDirectory, $wgRequest;
+ global $wgCacheDirectory, $wgFileCacheDirectory;
if ( $wgFileCacheDirectory ) {
$dir = $wgFileCacheDirectory;
$ret .= "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?" . ">\n";
}
- global $wgHtml5, $wgHtml5Version, $wgWellFormedXml, $wgDocType, $wgDTD;
+ global $wgHtml5, $wgHtml5Version, $wgDocType, $wgDTD;
global $wgXhtmlNamespaces, $wgXhtmlDefaultNamespace;
if ( $wgHtml5 ) {
$ret .= "<!DOCTYPE html>\n";
$wgOut->addHTML( $html );
if ( $showmeta ) {
- global $wgStylePath, $wgStyleVersion;
$expand = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-expand' ) ) );
$collapse = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-collapse' ) ) );
$wgOut->addHTML( Xml::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ) . "\n" );
}
public function imageHistoryLine( $iscur, $file ) {
- global $wgUser, $wgLang, $wgContLang;
+ global $wgUser, $wgLang;
$timestamp = wfTimestamp( TS_MW, $file->getTimestamp() );
$img = $iscur ? $file->getName() : $file->getArchiveName();
* @return Integer
*/
public function addLinkObj( $nt ) {
- global $wgAntiLockFlags, $wgProfiler;
+ global $wgAntiLockFlags;
wfProfileIn( __METHOD__ );
$key = $nt->getPrefixedDBkey();
}
function makeThumbLink2( Title $title, $file, $frameParams = array(), $handlerParams = array(), $time = false, $query = "" ) {
- global $wgStylePath, $wgContLang;
+ global $wgStylePath;
$exists = $file && $file->exists();
# Shortcuts
// @TODO: split up!
private function logActionLinks( $row, $title, $paramArray, &$comment ) {
- global $wgUser, $wgLang;
+ global $wgUser;
if( ( $this->flags & self::NO_ACTION_LINK ) // we don't want to see the action
|| self::isDeleted( $row, LogPage::DELETED_ACTION ) ) // action is hidden
{
}
public function getQueryInfo() {
- global $wgOut;
$tables = array( 'logging', 'user' );
$this->mConds[] = 'user_id = log_user';
$index = array();
* Add a magic word by name
*/
public function add( $name ) {
- global $wgContLang;
$this->names[] = $name;
$this->hash = $this->baseRegex = $this->regex = null;
}
* Both elements are false if there was no match.
*/
public function matchVariableStartToEnd( $text ) {
- global $wgContLang;
$regexes = $this->getVariableStartToEndRegex();
foreach ( $regexes as $regex ) {
if ( $regex !== '' ) {
}
protected function person($name, User $user ){
- global $wgContLang;
-
if( $user->isAnon() ){
$this->element( $name, wfMsgExt( 'anonymous', array( 'parsemag' ), 1 ) );
} else if( $real = $user->getRealName() ) {
* @return String: The doctype, opening <html>, and head element.
*/
public function headElement( Skin $sk, $includeStyle = true ) {
- global $wgContLanguageCode, $wgOutputEncoding, $wgMimeType;
- global $wgContLang, $wgUseTrackbacks, $wgStyleVersion, $wgHtml5;
+ global $wgOutputEncoding, $wgMimeType;
+ global $wgUseTrackbacks, $wgHtml5;
global $wgUser, $wgRequest, $wgLang;
if ( $sk->commonPrintStylesheet() ) {
if ( self::$defaultPreferences )
return self::$defaultPreferences;
- global $wgRCMaxAge;
-
$defaultPreferences = array();
self::profilePreferences( $user, $defaultPreferences );
}
## Prod in defaults from the user
- global $wgDefaultUserOptions;
foreach ( $defaultPreferences as $name => &$info ) {
$prefFromUser = self::getOptionFromUser( $name, $info, $user );
$field = HTMLForm::loadInputFromParameters( $info ); // For validation
static private $out;
function getFunctionReport() {
- global $wgRequest, $wgOut;
-
if($this->mTemplated) {
uasort($this->mCollated,array('self','sort'));
array_walk($this->mCollated,array('self','format'));
}
function view() {
- global $wgOut, $wgScript, $wgRequest;
+ global $wgOut, $wgRequest;
if( $wgRequest->isPathInfoBad() ) {
# Internet Explorer will ignore the Content-Type header if it
}
function getRawText() {
- global $wgUser, $wgOut, $wgRequest;
+ global $wgUser, $wgOut;
if( $this->mGen ) {
$sk = $wgUser->getSkin();
if( !StubObject::isRealObject( $wgOut ) )
global $wgUseAjax, $wgAjaxWatch;
global $wgVersion, $wgEnableAPI, $wgEnableWriteAPI;
global $wgRestrictionTypes;
- global $wgMWSuggestTemplate, $wgDBname, $wgEnableMWSuggest;
+ global $wgDBname, $wgEnableMWSuggest;
global $wgSitename;
$ns = $wgTitle->getNamespace();
* @private
*/
function setupUserCss( OutputPage $out ) {
- global $wgRequest, $wgContLang, $wgUser;
- global $wgAllowUserCss, $wgUseSiteCss, $wgSquidMaxage, $wgStylePath;
+ global $wgRequest, $wgUser;
+ global $wgAllowUserCss, $wgUseSiteCss, $wgSquidMaxage;
wfProfileIn( __METHOD__ );
}
function getUndeleteLink() {
- global $wgUser, $wgContLang, $wgLang, $wgRequest;
+ global $wgUser, $wgLang, $wgRequest;
$action = $wgRequest->getVal( 'action', 'view' );
* Show a drop-down box of special pages
*/
function specialPagesList() {
- global $wgUser, $wgContLang, $wgServer, $wgRedirectScript;
+ global $wgContLang, $wgServer, $wgRedirectScript;
$pages = array_merge( SpecialPage::getRegularPages(), SpecialPage::getRestrictedPages() );
foreach ( $pages as $name => $page ) {
$pages[$name] = $page->getDescription();
*/
function buildNavUrls() {
global $wgUseTrackbacks, $wgOut, $wgUser, $wgRequest;
- global $wgEnableUploads, $wgUploadNavigationUrl;
+ global $wgUploadNavigationUrl;
wfProfileIn( __METHOD__ );
*/
if ( $safe ) {
global $wgFileBlacklist, $wgCheckFileExtensions, $wgStrictFileExtensions,
- $wgFileExtensions, $wgVerifyMimeType, $wgMimeTypeBlacklist, $wgRequest;
+ $wgFileExtensions, $wgVerifyMimeType, $wgMimeTypeBlacklist;
list( $partName, $extList ) = UploadBase::splitExtensions( $filename );
if ( UploadBase::checkFileExtensionList( $extList, $wgFileBlacklist ) ) {
return 'unknown/unknown';
* @return \type{\string} the URL
*/
public function getFullURL( $query = '', $variant = false ) {
- global $wgContLang, $wgServer, $wgRequest;
+ global $wgServer, $wgRequest;
if ( is_array( $query ) ) {
$query = wfArrayToCGI( $query );
* Ignored if the user doesn't have the suppressredirect right
*/
private function moveToNewTitle( &$nt, $reason = '', $createRedirect = true ) {
- global $wgUseSquid, $wgUser, $wgContLang;
+ global $wgUser, $wgContLang;
$comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
if ( $reason ) {
* @return Boolean
*/
public function canUseNoindex() {
- global $wgArticleRobotPolicies, $wgContentNamespaces,
- $wgExemptFromUserRobotsControl;
+ global $wgContentNamespaces, $wgExemptFromUserRobotsControl;
$bannedNamespaces = is_null( $wgExemptFromUserRobotsControl )
? $wgContentNamespaces
* @return \bool True if the user is logged in, false otherwise.
*/
private function loadFromSession() {
- global $wgMemc, $wgCookiePrefix, $wgExternalAuthType, $wgAutocreatePolicy;
+ global $wgCookiePrefix, $wgExternalAuthType, $wgAutocreatePolicy;
$result = null;
wfRunHooks( 'UserLoadFromSession', array( $this, &$result ) );
# we use $wgPasswordSender as sender's address
global $wgEnotifWatchlist;
global $wgEnotifMinorEdits, $wgEnotifUserTalk;
- global $wgEnotifImpersonal;
wfProfileIn( __METHOD__ );
* @return DatabaseBase or null if invalid selection
*/
public static function getDB( $database ) {
- global $wgLocalDatabases, $wgDBname;
+ global $wgDBname;
if( self::validDatabase( $database ) ) {
if( $database == $wgDBname ) {
// Hmm... this shouldn't happen though. :)
* @return WikiReference object or null if the wiki was not found
*/
public static function getWiki( $wikiID ) {
- global $wgConf, $IP;
+ global $wgConf;
$wgConf->loadFullData();
* @param $tempIgnore Boolean
*/
function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
- global $wgCommandLineMode;
# Ignore errors during error handling to avoid infinite recursion
$ignore = $this->ignoreErrors( true );
++$this->mErrorCount;
}
function setup_database() {
- global $wgVersion, $wgDBmwschema, $wgDBts2schema, $wgDBport, $wgDBuser;
-
$res = $this->sourceFile( "../maintenance/ora/tables.sql" );
if ($res === true) {
print " done.</li>\n";
* @param $wiki String: wiki ID
*/
public function &getConnection( $i, $groups = array(), $wiki = false ) {
- global $wgDBtype;
wfProfileIn( __METHOD__ );
if ( $i == DB_LAST ) {
* Get the name of an image from its title object
*/
function getNameFromTitle( $title ) {
- global $wgCapitalLinks;
if ( $this->initialCapital != MWNamespace::isCapitalized( NS_FILE ) ) {
global $wgContLang;
$name = $title->getUserCaseDBKey();
* @return Status
*/
public function installExtensions() {
- global $wgHooks, $wgAutoloadClasses;
-
$exts = $this->getVar( '_Extensions' );
$path = $this->getVar( 'IP' ) . '/extensions';
}
public function submitConnectForm() {
- global $wgSQLiteDataDir;
$this->setVarsFromRequest( array( 'wgSQLiteDataDir', 'wgDBname' ) );
$dir = realpath( $this->getVar( 'wgSQLiteDataDir' ) );
* @param $frame PPFrame
*/
function extensionSubstitution( $params, $frame ) {
- global $wgRawHtml, $wgContLang;
-
$name = $frame->expand( $params['name'] );
$attrText = !isset( $params['attr'] ) ? null : $frame->expand( $params['attr'] );
$content = !isset( $params['inner'] ) ? null : $frame->expand( $params['inner'] );
* @return String
*/
public function highlightText( $text, $terms, $contextlines, $contextchars ) {
- global $wgLang, $wgContLang;
+ global $wgContLang;
global $wgSearchHighlightBoundaries;
$fname = __METHOD__;
* @return String
*/
function extract( $text, $start, $end, &$posStart = null, &$posEnd = null ) {
- global $wgContLang;
-
if ( $start != 0 )
$start = $this->position( $text, $start, 1 );
if ( $end >= strlen( $text ) )
* @return String
*/
public function highlightSimple( $text, $terms, $contextlines, $contextchars ) {
- global $wgLang, $wgContLang;
+ global $wgContLang;
$fname = __METHOD__;
$lines = explode( "\n", $text );
}
function getPageHeader() {
- global $wgScript, $wgRequest;
+ global $wgScript;
$self = $this->getTitle();
$limit = $this->mLimit ? Xml::hidden( 'limit', $this->mLimit ) : '';
}
public function execute( $par ) {
- global $wgUser, $wgOut, $wgLang, $wgRequest;
+ global $wgUser, $wgOut, $wgRequest;
$this->setHeaders();
$this->outputHeader();
* @param $type String
*/
protected function feed( $type ) {
- global $wgRequest, $wgFeed, $wgFeedClasses, $wgFeedLimit;
+ global $wgFeed, $wgFeedClasses, $wgFeedLimit;
if( !$wgFeed ) {
global $wgOut;
return;
}
- global $wgOut, $wgLang, $wgRequest;
+ global $wgOut, $wgRequest;
$wgOut->setPageTitle( wfMsgExt( 'deletedcontributions-title', array( 'parsemag' ) ) );
* @param $options Array: the options to be included.
*/
function getForm( $options ) {
- global $wgScript, $wgRequest;
+ global $wgScript;
$options['title'] = SpecialPage::getTitleFor( 'DeletedContributions' )->getPrefixedText();
if ( !isset( $options['target'] ) ) {
* @return Mixed: True on success, String on error
*/
public static function submit( $data ) {
- global $wgUser, $wgUserEmailUseReplyTo, $wgSiteName;
+ global $wgUser, $wgUserEmailUseReplyTo;
$target = self::getTarget( $data['Target'] );
if( !$target instanceof User ){
* not returning full history)
*/
private function doExport( $page, $history, $list_authors ) {
- global $wgExportMaxHistory;
-
$pageSet = array(); // Inverted index of all pages to look up
// Split up and normalize input
* Validate link depth setting, if available.
*/
private function validateLinkDepth( $depth ) {
- global $wgExportMaxLinkDepth, $wgExportMaxLinkDepthLimit;
+ global $wgExportMaxLinkDepth;
if( $depth < 0 ) {
return 0;
}
}
private function showForm() {
- global $wgUser, $wgOut, $wgRequest, $wgImportSources, $wgExportMaxLinkDepth;
+ global $wgUser, $wgOut, $wgImportSources, $wgExportMaxLinkDepth;
if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) )
return $wgOut->permissionRequired( 'import' );
}
function searchForm() {
- global $wgScript, $wgRequest, $wgLang;
+ global $wgScript, $wgLang;
$showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) );
$nondefaults = array();
function wfSpecialLinkSearch( $par ) {
list( $limit, $offset ) = wfCheckLimits();
- global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang;
+ global $wgOut, $wgUrlProtocols, $wgMiserMode, $wgLang;
$target = $GLOBALS['wgRequest']->getVal( 'target', $par );
$namespace = $GLOBALS['wgRequest']->getIntorNull( 'namespace', null );
}
function getPageHeader( ) {
- global $wgScript, $wgRequest;
+ global $wgScript;
$self = $this->getTitle();
# Form tag
* $par string (optional) A group to list users from
*/
function wfSpecialListusers( $par = null ) {
- global $wgRequest, $wgOut;
+ global $wgOut;
$up = new UsersPager($par);
}
private function showHistory() {
- global $wgLang, $wgUser, $wgOut;
+ global $wgUser, $wgOut;
$this->sk = $wgUser->getSkin();
}
function doSubmit() {
- global $wgOut, $wgUser, $wgRequest, $wgMaximumMovedPages, $wgLang;
+ global $wgOut, $wgUser, $wgMaximumMovedPages, $wgLang;
global $wgFixDoubleRedirects;
if ( $wgUser->pingLimiter( 'move' ) ) {
* @return String
*/
public function execute( $par ) {
- global $wgLang, $wgOut;
+ global $wgOut;
$this->setHeaders();
$this->outputHeader();
* Callback function to output a restriction
*/
function formatRow( $row ) {
- global $wgUser, $wgLang, $wgContLang;
+ global $wgUser, $wgLang;
wfProfileIn( __METHOD__ );
* Mostly initializes variables and calls either showForm() or submit()
*/
public function execute( $par ) {
- global $wgUser, $wgOut, $wgSkin;
+ global $wgUser, $wgOut;
$this->setHeaders();
$this->outputHeader();
* This function actually move the revision. NEVER call this function, call submit()
*/
protected function moveRevisions() {
- global $wgOut;
-
$oldArticle = new Article( $this->mOldTitle );
$newArticle = new Article( $this->mNewTitle );
* @param $terms Array: terms to highlight
*/
protected function showHit( $result, $terms ) {
- global $wgContLang, $wgLang, $wgUser;
+ global $wgLang, $wgUser;
wfProfileIn( __METHOD__ );
if( $result->isBrokenTitle() ) {
*/
protected function showInterwikiHit( $result, $lastInterwiki, $terms, $query, $customCaptions) {
wfProfileIn( __METHOD__ );
- global $wgContLang, $wgLang;
if( $result->isBrokenTitle() ) {
wfProfileOut( __METHOD__ );
* @return String: HTML form
*/
protected function powerSearchBox( $term ) {
- global $wgScript, $wgContLang;
-
// Groups namespaces into rows according to subject
$rows = array();
foreach( SearchEngine::searchableNamespaces() as $namespace => $name ) {
}
protected function formHeader( $term, $resultsShown, $totalNum ) {
- global $wgContLang, $wgLang;
+ global $wgLang;
$out = Xml::openElement('div', array( 'class' => 'mw-search-formheader' ) );
}
public function execute( $par ) {
- global $wgOut, $wgRequest, $wgMessageCache, $wgMemc;
+ global $wgOut, $wgRequest, $wgMemc;
global $wgDisableCounters, $wgMiserMode;
$this->setHeaders();
* @return string table row in HTML format
*/
private function formatRow( $text, $number, $trExtraParams = array(), $descMsg = '', $descMsgParam = '' ) {
- global $wgStylePath;
if( $descMsg ) {
$descriptionText = wfMsgExt( $descMsg, array( 'parseinline' ), $descMsgParam );
if ( !wfEmptyMsg( $descMsg, $descriptionText ) ) {
// Generic list of deleted pages
private function showList( $result ) {
- global $wgLang, $wgContLang, $wgUser, $wgOut;
+ global $wgLang, $wgUser, $wgOut;
if( $result->numRows() == 0 ) {
$wgOut->addWikiMsg( 'undelete-no-results' );
}
private function showHistory( ) {
- global $wgLang, $wgUser, $wgOut;
+ global $wgUser, $wgOut;
$sk = $wgUser->getSkin();
if( $this->mAllowed ) {
* Special page entry point
*/
public function execute( $par ) {
- global $wgUser, $wgOut, $wgRequest;
+ global $wgUser, $wgOut;
$this->setHeaders();
$this->outputHeader();
* @return String: empty string if there is no warning or an HTML fragment
*/
public static function getExistsWarning( $exists ) {
- global $wgUser, $wgContLang;
+ global $wgUser;
if ( !$exists ) {
return '';
global $wgLang, $wgCheckFileExtensions, $wgStrictFileExtensions,
$wgFileExtensions, $wgFileBlacklist;
- $allowedExtensions = '';
if( $wgCheckFileExtensions ) {
if( $wgStrictFileExtensions ) {
# Everything not permitted is banned
}
function processLogin() {
- global $wgUser, $wgAuth;
+ global $wgUser;
switch ( $this->authenticateUserData() ) {
case self::SUCCESS:
* @private
*/
function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
- global $wgServer, $wgScript, $wgUser, $wgNewPasswordExpiry;
+ global $wgServer, $wgScript, $wgNewPasswordExpiry;
if ( $u->getEmail() == '' ) {
return new WikiError( wfMsg( 'noemail', $u->getName() ) );
* @private
*/
function successfulLogin() {
- global $wgUser, $wgOut;
+ global $wgOut;
# Run any hooks; display injected HTML if any, else redirect
$injected_html = '';
* @private
*/
function successfulCreation() {
- global $wgUser, $wgOut;
-
+ global $wgUser;
# Run any hooks; display injected HTML
$injected_html = '';
wfRunHooks('UserLoginComplete', array(&$wgUser, &$injected_html));
* @return null
*/
function saveUserGroups( $username, $reason = '' ) {
- global $wgRequest, $wgUser, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
+ global $wgRequest, $wgOut;
$status = $this->fetchUser( $username );
if( !$status->isOK() ) {
* @return wiki text showing the license information
*/
static function MediaWikiCredits() {
- global $wgContLang;
-
$ret = Xml::element( 'h2', array( 'id' => 'mw-version-license' ), wfMsg( 'version-license' ) );
// This text is always left-to-right.
$wgUser->saveSettings();
}
- global $wgServer, $wgScriptPath, $wgFeedClasses;
+ global $wgFeedClasses;
$apiParams = array( 'action' => 'feedwatchlist', 'allrev' => 'allrev',
'wlowner' => $wgUser->getName(), 'wltoken' => $wlToken );
$feedTemplate = wfScript('api').'?';
}
function wfSpecialWithoutinterwiki() {
- global $wgRequest, $wgContLang;
+ global $wgRequest;
list( $limit, $offset ) = wfCheckLimits();
// Only searching the mainspace anyway
$prefix = Title::capitalize( $wgRequest->getVal( 'prefix' ), NS_MAIN );
}
if ( $status->isGood() ) {
- global $wgLocalFileRepo;
$file = $this->getLocalFile();
$wgUser->leaveUserMessage( wfMsg( 'successfulupload' ),