MediaWiki  1.29.1
Setup.php File Reference

Include most things that are needed to make MediaWiki work. More...

Go to the source code of this file.

Variables

if(!defined( 'MEDIAWIKI')) $fname = 'Setup.php'
 This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined. More...
 
 $messageMemc = wfGetMessageCacheStorage()
 
 $parserMemc = wfGetParserCacheStorage()
 
 $ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' )
 
 $ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' )
 
 $ps_extensions = Profiler::instance()->scopedProfileIn( $fname . '-extensions' )
 
 $ps_globals = Profiler::instance()->scopedProfileIn( $fname . '-globals' )
 
 $ps_memcached = Profiler::instance()->scopedProfileIn( $fname . '-memcached' )
 
 $ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc1' )
 
if(!is_object( $wgAuth)) if( $wgAuth &&! $wgAuth instanceof MediaWiki\Auth\AuthManagerAuthPlugin$ps_session = Profiler::instance()->scopedProfileIn( $fname . '-session' )
 
 $ps_setup = Profiler::instance()->scopedProfileIn( $fname )
 
 $ps_validation = Profiler::instance()->scopedProfileIn( $fname . '-validation' )
 
 $rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 )
 
if( $wgCanonicalServer===false$serverParts = wfParseUrl( $wgCanonicalServer )
 
 $wgCanonicalNamespaceNames
 Definitions of the NS_ constants are in Defines.php. More...
 
global $wgCommandLineMode
 
 $wgContLang = Language::factory( $wgLanguageCode )
 
 $wgContLanguageCode = $wgLanguageCode
 
if( $wgLocalInterwiki) if( $wgSharedPrefix===false) if( $wgSharedSchema===false) if(! $wgCookiePrefix) $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' )
 
if( $wgRCFilterByAge) $wgDefaultUserOptions ['rcdays']
 
if(is_null( $wgLocalTZoffset)) $wgDefaultUserOptions ['timecorrection'] = "System|$wgLocalTZoffset"
 
 $wgDefaultUserOptions ['watchlistdays']
 
if(is_array( $wgExtraNamespaces)) $wgDummyLanguageCodes
 
 $wgEmailAuthentication = false
 
 $wgEnableUserEmail = false
 
 $wgEnotifFromEditor = false
 
 $wgEnotifImpersonal = false
 
 $wgEnotifMaxRecips = 0
 
 $wgEnotifMinorEdits = false
 
 $wgEnotifRevealEditorAddress = false
 
 $wgEnotifUseRealName = false
 
 $wgEnotifUserTalk = false
 
 $wgEnotifWatchlist = false
 
 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) )
 
foreach( $wgExtensionFunctions as $func) if(!defined( 'MW_NO_SESSION') &&! $wgCommandLineMode) if(! $wgCommandLineMode) $wgFullyInitialised = true
 
if( $wgUseFileCache|| $wgUseSquid) $wgHtml5 = true
 
 $wgInitialSessionId = null
 
 $wgJsMimeType = 'text/javascript'
 
 $wgLang = new StubUserLang
 
 $wgLockManagers []
 Initialise $wgLockManagers to include basic FS version. More...
 
 $wgMemc = wfGetMainCache()
 
if( $wgMetaNamespace===false) if( $wgResourceLoaderMaxQueryLength===false$wgMinUploadChunkSize
 
 $wgNamespaceAliases ['Image'] = NS_FILE
 The canonical names of namespaces 6 and 7 are, as of v1.14, "File" and "File_talk". More...
 
 $wgNamespaceAliases ['Image_talk'] = NS_FILE_TALK
 
if( $wgScript===false) if( $wgLoadScript===false) if( $wgArticlePath===false) if(!empty( $wgActionPaths) &&!isset( $wgActionPaths['view'])) if( $wgResourceBasePath===null) if( $wgStylePath===false) if( $wgLocalStylePath===false) if( $wgExtensionAssetsPath===false) if( $wgLogo===false) if( $wgUploadPath===false) if( $wgUploadDirectory===false) if( $wgReadOnlyFile===false) if( $wgFileCacheDirectory===false) if( $wgDeletedDirectory===false) if( $wgGitInfoCacheDirectory===false && $wgCacheDirectory !==false) if( $wgEnableParserCache===false) if( $wgRightsIcon) if(isset( $wgFooterIcons['copyright']['copyright']) && $wgFooterIcons['copyright']['copyright']===[]) if(isset( $wgFooterIcons['poweredby']) &&isset( $wgFooterIcons['poweredby']['mediawiki']) && $wgFooterIcons['poweredby']['mediawiki']['src']===null) $wgNamespaceProtection [NS_MEDIAWIKI] = 'editinterface'
 Unconditional protection for NS_MEDIAWIKI since otherwise it's too easy for a sysadmin to set $wgNamespaceProtection incorrectly and leave the wiki insecure. More...
 
 $wgOut = RequestContext::getMain()->getOutput()
 
 $wgParser
 
if(! $wgDBerrorLogTZ) $wgRequest = RequestContext::getMain()->getRequest()
 
if( $wgServerName !==false$wgServerName = $serverParts['host']
 
if( $wgInvalidateCacheOnLocalSettingsChange) if( $wgNewUserLog) if( $wgPageLanguageUseDB) if( $wgCookieSecure==='detect') if( $wgProfileOnly) if( $wgMinimalPasswordLength !==false) if( $wgMaximalPasswordLength !==false) if(! $wgSessionsInObjectCache) $wgSessionsInObjectCache = true
 
if( $wgSkipSkin) $wgSkipSkins [] = 'fallback'
 
 $wgTitle = null
 
 $wgUseEnotif = false
 
 $wgUser = RequestContext::getMain()->getUser()
 
 $wgUserEmailUseReplyTo = false
 
 $wgUsersNotifiedOnAllChanges = []
 
if(! $wgEmergencyContact) if(! $wgPasswordSender) if(! $wgNoReplyAddress) if( $wgSecureLogin &&substr( $wgServer, 0, 2) !=='//') $wgVirtualRestConfig ['global']['domain'] = $wgCanonicalServer
 
 $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml'
 
if( $wgEnableEmail) else
 
const MW_SERVICE_BOOTSTRAP_COMPLETE ( $wgSharedDB && $wgSharedTables) 1
 

Detailed Description

Include most things that are needed to make MediaWiki work.

This file is included by WebStart.php and doMaintenance.php so that both web and maintenance scripts share a final set up phase to include necessary files and create global object variables.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Definition in file Setup.php.

Variable Documentation

◆ $fname

if (!defined('MEDIAWIKI')) $fname = 'Setup.php'

This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.

Definition at line 36 of file Setup.php.

Referenced by Article\__get(), Article\__set(), DumpTestCase\assertDumpStart(), Wikimedia\Rdbms\DatabaseSqlite\attachDatabase(), Wikimedia\Rdbms\Database\begin(), Wikimedia\Rdbms\LBFactory\beginMasterChanges(), Wikimedia\Rdbms\LoadBalancer\beginMasterChanges(), Maintenance\beginTransaction(), IndexPager\buildQueryInfo(), DatabaseTestHelper\checkFunctionName(), AjaxResponse\checkLastModified(), TextPassDumperDatabaseTest\checkpointHelper(), SectionProfiler\collateData(), Wikimedia\Rdbms\LBFactory\commitAll(), Wikimedia\Rdbms\LoadBalancer\commitAll(), Wikimedia\Rdbms\LBFactory\commitAndWaitForReplication(), Wikimedia\Rdbms\LBFactory\commitMasterChanges(), Wikimedia\Rdbms\LoadBalancer\commitMasterChanges(), Maintenance\commitTransaction(), Wikimedia\Rdbms\DatabaseMssql\delete(), DatabaseOracle\delete(), Wikimedia\Rdbms\Database\delete(), Wikimedia\Rdbms\DatabaseMssql\deleteJoin(), Wikimedia\Rdbms\DatabaseMysqlBase\deleteJoin(), Wikimedia\Rdbms\Database\deleteJoin(), Wikimedia\Rdbms\Database\doAtomicSection(), JobQueueDB\doBatchPush(), Wikimedia\Rdbms\DatabaseSqlite\doBegin(), Wikimedia\Rdbms\Database\doProfiledQuery(), IndexPager\doQuery(), Wikimedia\Rdbms\DatabasePostgres\duplicateTableStructure(), Wikimedia\Rdbms\DatabaseSqlite\duplicateTableStructure(), Wikimedia\Rdbms\DatabaseMysqlBase\duplicateTableStructure(), Wikimedia\Rdbms\Database\endAtomic(), Wikimedia\Rdbms\DatabasePostgres\estimateRowCount(), Wikimedia\Rdbms\DatabaseMssql\estimateRowCount(), Wikimedia\Rdbms\DatabaseMysqlBase\estimateRowCount(), Wikimedia\Rdbms\Database\estimateRowCount(), ConvertExtensionToRegistration\execute(), ResourceLoaderWikiModule\fetchTitleInfo(), Wikimedia\Rdbms\LBFactory\flushReplicaSnapshots(), QueryPage\getCachedTimestamp(), SectionProfiler\getCallTreeLine(), SectionProfiler\getFunctionStats(), ProfilerXhprof\getFunctionStats(), Wikimedia\Rdbms\Database\getScopedLockAndFlush(), DumpTestCase\gunzip(), Wikimedia\Rdbms\Database\indexExists(), Wikimedia\Rdbms\DatabasePostgres\indexInfo(), Wikimedia\Rdbms\DatabaseSqlite\indexInfo(), Wikimedia\Rdbms\DatabaseMssql\indexInfo(), Wikimedia\Rdbms\DatabaseMysqlBase\indexInfo(), Wikimedia\Rdbms\DatabasePostgres\indexUnique(), Wikimedia\Rdbms\DatabaseSqlite\indexUnique(), DatabaseOracle\insert(), Wikimedia\Rdbms\DatabasePostgres\insert(), Wikimedia\Rdbms\Database\insert(), Wikimedia\Rdbms\Database\insertSelect(), Title\invalidateCache(), ChangeTags\listExplicitlyDefinedTags(), Wikimedia\Rdbms\DatabasePostgres\listTables(), Wikimedia\Rdbms\DatabaseMysqlBase\listTables(), LocalFile\loadExtraFromDB(), LocalFile\loadFieldsWithTimestamp(), LocalFile\loadFromDB(), moveToExternal(), Wikimedia\Rdbms\DatabasePostgres\nativeInsertSelect(), Wikimedia\Rdbms\DatabaseMssql\nativeInsertSelect(), Wikimedia\Rdbms\Database\nativeInsertSelect(), DatabaseTestHelper\nativeReplace(), Wikimedia\Rdbms\Database\nativeReplace(), RecentChange\newFromConds(), XmlTypeCheck\newFromFilename(), ImportStreamSource\newFromUpload(), LocalFile\nextHistoryLine(), Wikimedia\Rdbms\Database\onTransactionIdle(), Wikimedia\Rdbms\Database\onTransactionPreCommitOrIdle(), Wikimedia\Rdbms\Database\onTransactionResolution(), InfoAction\pageCounts(), ResourceLoaderWikiModule\preloadTitleInfo(), UserGroupMembership\purgeExpired(), Block\purgeExpired(), Title\purgeExpiredRestrictions(), DatabaseTestHelper\query(), Wikimedia\Rdbms\Database\query(), DatabaseOracle\queryIgnore(), ContribsPager\reallyDoQuery(), ImageListPager\reallyDoQuery(), IndexPager\reallyDoQuery(), QueryPage\reallyDoQuery(), QueryPage\recache(), Wikimedia\Rdbms\DatabaseMysqlBase\replace(), Wikimedia\Rdbms\Database\replace(), Wikimedia\Rdbms\DatabasePostgres\reportQueryError(), Wikimedia\Rdbms\Database\reportQueryError(), resolveStub(), resolveStubs(), Wikimedia\Rdbms\LBFactory\rollbackMasterChanges(), Wikimedia\Rdbms\LoadBalancer\rollbackMasterChanges(), Maintenance\rollbackTransaction(), Wikimedia\Rdbms\DatabaseMssql\select(), Wikimedia\Rdbms\Database\select(), Wikimedia\Rdbms\Database\selectField(), Wikimedia\Rdbms\Database\selectFieldValues(), RandomPage\selectRandomPageFromDB(), SpecialRandomInCategory\selectRandomPageFromDB(), DatabaseOracle\selectRow(), Wikimedia\Rdbms\Database\selectRow(), Wikimedia\Rdbms\Database\selectRowCount(), Wikimedia\Rdbms\DatabaseMssql\selectSQLText(), Wikimedia\Rdbms\DatabasePostgres\selectSQLText(), StreamFile\send404Message(), HTTPFileStreamer\send404Message(), Wikimedia\Rdbms\TransactionProfiler\setExpectation(), Wikimedia\Rdbms\TransactionProfiler\setExpectations(), BaseDumpTest\setUpPrefetch(), TextPassDumperDatabaseTest\setUpStub(), Wikimedia\Rdbms\Database\sourceFile(), Wikimedia\Rdbms\Database\sourceStream(), ImportImages\splitFilename(), Wikimedia\Rdbms\Database\startAtomic(), StreamFile\stream(), DatabaseTestHelper\tableExists(), Wikimedia\Rdbms\DatabaseMysqlBase\tableExists(), Wikimedia\Rdbms\Database\tableExists(), ChangeTags\tagUsageStatistics(), BackupDumperPageTest\testCurrentStubGzip(), BackupDumperPageTest\testCurrentStubPlain(), ExportDemoTest\testExportDemo(), BackupDumperPageTest\testFullStubPlain(), BackupDumperPageTest\testFullTextPlain(), BaseDumpTest\testPageMissAtEnd(), BackupDumperLoggerTest\testPlain(), BaseDumpTest\testRevisionMissAtEnd(), BaseDumpTest\testSequential(), BaseDumpTest\testSynchronizePageMiss(), BaseDumpTest\testSynchronizePageMissAtStart(), BaseDumpTest\testSynchronizeRevisionMissAtStart(), BaseDumpTest\testSynchronizeRevisionMissToPage(), BaseDumpTest\testSynchronizeRevisionMissToRevision(), GlobalTest\testWfMkdirParents(), BackupDumperLoggerTest\testXmlDumpsBackupUseCaseLogging(), Wikimedia\Rdbms\Database\update(), WatchedItemStore\updateNotificationTimestamp(), Wikimedia\Rdbms\DatabaseMysqlBase\upsert(), and Wikimedia\Rdbms\Database\upsert().

◆ $messageMemc

$messageMemc = wfGetMessageCacheStorage()

Definition at line 667 of file Setup.php.

◆ $parserMemc

$parserMemc = wfGetParserCacheStorage()

Definition at line 668 of file Setup.php.

◆ $ps_default

$ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' )

Definition at line 53 of file Setup.php.

◆ $ps_default2

$ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' )

Definition at line 550 of file Setup.php.

◆ $ps_extensions

$ps_extensions = Profiler::instance()->scopedProfileIn( $fname . '-extensions' )

Definition at line 806 of file Setup.php.

◆ $ps_globals

$ps_globals = Profiler::instance()->scopedProfileIn( $fname . '-globals' )

Definition at line 684 of file Setup.php.

◆ $ps_memcached

$ps_memcached = Profiler::instance()->scopedProfileIn( $fname . '-memcached' )

Definition at line 664 of file Setup.php.

◆ $ps_misc

$ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc1' )

Definition at line 610 of file Setup.php.

◆ $ps_session

if (!is_object($wgAuth)) if ($wgAuth &&! $wgAuth instanceof MediaWiki\Auth\AuthManagerAuthPlugin) $ps_session = Profiler::instance()->scopedProfileIn( $fname . '-session' )

Definition at line 712 of file Setup.php.

◆ $ps_setup

$ps_setup = Profiler::instance()->scopedProfileIn( $fname )

Definition at line 37 of file Setup.php.

◆ $ps_validation

$ps_validation = Profiler::instance()->scopedProfileIn( $fname . '-validation' )

Definition at line 534 of file Setup.php.

◆ $rcMaxAgeDays

$rcMaxAgeDays = $wgRCMaxAge / ( 3600 * 24 )

Definition at line 267 of file Setup.php.

◆ $serverParts

if ($wgCanonicalServer===false) $serverParts = wfParseUrl( $wgCanonicalServer )

Definition at line 557 of file Setup.php.

◆ $wgCanonicalNamespaceNames

$wgCanonicalNamespaceNames
Initial value:
= [
NS_MEDIA => 'Media',
NS_SPECIAL => 'Special',
NS_TALK => 'Talk',
NS_USER => 'User',
NS_USER_TALK => 'User_talk',
NS_PROJECT => 'Project',
NS_PROJECT_TALK => 'Project_talk',
NS_FILE => 'File',
NS_FILE_TALK => 'File_talk',
NS_MEDIAWIKI => 'MediaWiki',
NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
NS_TEMPLATE => 'Template',
NS_TEMPLATE_TALK => 'Template_talk',
NS_HELP => 'Help',
NS_HELP_TALK => 'Help_talk',
NS_CATEGORY => 'Category',
NS_CATEGORY_TALK => 'Category_talk',
]

Definitions of the NS_ constants are in Defines.php.

Access:\n private

Definition at line 381 of file Setup.php.

Referenced by MWNamespace\getCanonicalNamespaces(), and wfInstallerMain().

◆ $wgCommandLineMode

◆ $wgContLang

$wgContLang = Language::factory( $wgLanguageCode )

Definition at line 689 of file Setup.php.

◆ $wgContLanguageCode

$wgContLanguageCode = $wgLanguageCode

Definition at line 414 of file Setup.php.

Referenced by SpecialCiteThisPage\getContentText().

◆ $wgCookiePrefix

if ($wgLocalInterwiki) if ($wgSharedPrefix===false) if ($wgSharedSchema===false) if (! $wgCookiePrefix) $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' )

◆ $wgDefaultUserOptions [1/3]

if ($wgRCFilterByAge) $wgDefaultUserOptions[ 'rcdays']
Initial value:
= min(
ceil( $rcMaxAgeDays )
)

Definition at line 284 of file Setup.php.

Referenced by Preferences\getDateOptions(), User\getDefaultOptions(), and UserTest\testAnonOptions().

◆ $wgDefaultUserOptions [2/3]

if (is_null($wgLocalTZoffset)) $wgDefaultUserOptions[ 'timecorrection'] = "System|$wgLocalTZoffset"

Definition at line 632 of file Setup.php.

◆ $wgDefaultUserOptions [3/3]

$wgDefaultUserOptions[ 'watchlistdays']
Initial value:
= min(
$wgDefaultUserOptions['watchlistdays'],
ceil( $rcMaxAgeDays )
)

Definition at line 288 of file Setup.php.

◆ $wgDummyLanguageCodes

if (is_array($wgExtraNamespaces)) $wgDummyLanguageCodes
Initial value:
= [
'qqq' => 'qqq',
'qqx' => 'qqx',
Todo:
UGLY UGLY

Definition at line 407 of file Setup.php.

◆ $wgEmailAuthentication

$wgEmailAuthentication = false

Definition at line 334 of file Setup.php.

◆ $wgEnableUserEmail

$wgEnableUserEmail = false

Definition at line 335 of file Setup.php.

◆ $wgEnotifFromEditor

$wgEnotifFromEditor = false

Definition at line 336 of file Setup.php.

◆ $wgEnotifImpersonal

$wgEnotifImpersonal = false

Definition at line 337 of file Setup.php.

◆ $wgEnotifMaxRecips

$wgEnotifMaxRecips = 0

Definition at line 338 of file Setup.php.

◆ $wgEnotifMinorEdits

$wgEnotifMinorEdits = false

Definition at line 339 of file Setup.php.

◆ $wgEnotifRevealEditorAddress

$wgEnotifRevealEditorAddress = false

Definition at line 340 of file Setup.php.

◆ $wgEnotifUseRealName

$wgEnotifUseRealName = false

Definition at line 341 of file Setup.php.

◆ $wgEnotifUserTalk

$wgEnotifUserTalk = false

Definition at line 342 of file Setup.php.

◆ $wgEnotifWatchlist

$wgEnotifWatchlist = false

Definition at line 343 of file Setup.php.

◆ $wgFileExtensions

$wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) )

Definition at line 429 of file Setup.php.

◆ $wgFullyInitialised

foreach ($wgExtensionFunctions as $func) if (!defined('MW_NO_SESSION') &&! $wgCommandLineMode) if (! $wgCommandLineMode) $wgFullyInitialised = true

Definition at line 856 of file Setup.php.

Referenced by User\isSafeToLoad(), User\load(), and MWExceptionTest\testUseOutputPage().

◆ $wgHtml5

if ($wgUseFileCache||$wgUseSquid) $wgHtml5 = true

Definition at line 424 of file Setup.php.

◆ $wgInitialSessionId

$wgInitialSessionId = null

Definition at line 717 of file Setup.php.

Referenced by LoginSignupSpecialPage\hasSessionCookie().

◆ $wgJsMimeType

$wgJsMimeType = 'text/javascript'

Definition at line 426 of file Setup.php.

Referenced by SkinTemplate\prepareQuickTemplate().

◆ $wgLang

$wgLang = new StubUserLang

Definition at line 786 of file Setup.php.

◆ $wgLockManagers

$wgLockManagers[]
Initial value:
= [
'name' => 'fsLockManager',
'class' => 'FSLockManager',
'lockDirectory' => "{$wgUploadDirectory}/lockdir",
]

Initialise $wgLockManagers to include basic FS version.

Definition at line 170 of file Setup.php.

◆ $wgMemc

$wgMemc = wfGetMainCache()

Definition at line 666 of file Setup.php.

◆ $wgMinUploadChunkSize

if ($wgMetaNamespace===false) if ($wgResourceLoaderMaxQueryLength===false) $wgMinUploadChunkSize
Initial value:
= min(
UploadBase::getMaxUploadSize( 'file' ),
UploadBase::getMaxPhpUploadSize(),
ini_get( 'post_max_size' ) ?: ini_get( 'hhvm.server.max_post_size' ),
PHP_INT_MAX
) ?: PHP_INT_MAX ) - 1024
)

Definition at line 367 of file Setup.php.

◆ $wgNamespaceAliases [1/2]

$wgNamespaceAliases[ 'Image'] = NS_FILE

The canonical names of namespaces 6 and 7 are, as of v1.14, "File" and "File_talk".

The old names "Image" and "Image_talk" are retained as aliases for backwards compatibility.

Definition at line 164 of file Setup.php.

Referenced by NamespaceConflictChecker\checkAll(), Language\getNamespaceIds(), InputBox\getSearchForm(), and UploadFromUrlTestSuite\setUp().

◆ $wgNamespaceAliases [2/2]

$wgNamespaceAliases[ 'Image_talk'] = NS_FILE_TALK

Definition at line 165 of file Setup.php.

◆ $wgNamespaceProtection

if ($wgScript===false) if ($wgLoadScript===false) if ($wgArticlePath===false) if (!empty($wgActionPaths) &&!isset($wgActionPaths[ 'view'])) if ($wgResourceBasePath===null) if ($wgStylePath===false) if ($wgLocalStylePath===false) if ($wgExtensionAssetsPath===false) if ($wgLogo===false) if ($wgUploadPath===false) if ($wgUploadDirectory===false) if ($wgReadOnlyFile===false) if ($wgFileCacheDirectory===false) if ($wgDeletedDirectory===false) if ($wgGitInfoCacheDirectory===false &&$wgCacheDirectory !==false) if ($wgEnableParserCache===false) if ($wgRightsIcon) if (isset($wgFooterIcons[ 'copyright'][ 'copyright']) &&$wgFooterIcons[ 'copyright'][ 'copyright']===[]) if (isset($wgFooterIcons[ 'poweredby']) &&isset($wgFooterIcons[ 'poweredby'][ 'mediawiki']) &&$wgFooterIcons[ 'poweredby'][ 'mediawiki'][ 'src']===null) $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface'

Unconditional protection for NS_MEDIAWIKI since otherwise it's too easy for a sysadmin to set $wgNamespaceProtection incorrectly and leave the wiki insecure.

Note that this is the definition of editinterface and it can be granted to all users if desired.

Definition at line 157 of file Setup.php.

Referenced by MWNamespace\getRestrictionLevels(), Title\isNamespaceProtected(), UploadFromUrlTestSuite\setUp(), and TitlePermissionTest\testSpecialsAndNSPermissions().

◆ $wgOut

OutputPage $wgOut = RequestContext::getMain()->getOutput()

Definition at line 791 of file Setup.php.

Referenced by EditPage\addEditNotices(), EditPage\addLongPageWarningHeader(), EditPage\addPageProtectionWarningHeaders(), EditPage\addTalkPageText(), SpecialPageFactory\capturePath(), FeedUtils\checkFeedOutput(), EditPage\displayPermissionsError(), EditPage\displayPreviewArea(), EditPage\displayViewSourcePage(), EditPage\edit(), FileDeleteForm\execute(), EditPage\getContentObject(), EditPage\getEditToolbar(), EditPage\getPreviewText(), ParserOutput\getText(), EditPage\handleStatus(), ChangesFeed\loadFromCache(), QuickTemplate\msgWiki(), EditPage\noSuchSectionPage(), GeSHi\parse_code(), BadRequestError\report(), ThrottledError\report(), ErrorPageError\report(), PermissionsError\report(), LocalFileLockError\report(), MWExceptionRenderer\reportHTML(), MWException\reportHTML(), FileDeleteForm\setHeaders(), EditPage\setHeaders(), UploadFromUrlTestSuite\setUp(), EditPage\showConflict(), EditPage\showCustomIntro(), EditPage\showDiff(), EditPage\showEditForm(), EditPage\showEditTools(), FileDeleteForm\showForm(), EditPage\showFormAfterText(), EditPage\showFormBeforeText(), EditPage\showHeader(), EditPage\showHeaderCopyrightWarning(), QuestyCaptcha\showHelp(), SimpleCaptcha\showHelp(), FancyCaptcha\showImage(), EditPage\showIntro(), FileDeleteForm\showLogEntries(), EditPage\showPreview(), EditPage\showStandardInputs(), EditPage\showSummaryInput(), EditPage\showTextbox(), EditPage\showTosSummary(), EditPage\spamPageWithContent(), and MWExceptionTest\testUseOutputPage().

◆ $wgParser

Parser $wgParser
Initial value:
= new StubObject( 'wgParser', function () {
return MediaWikiServices::getInstance()->getParser();
} )

Definition at line 796 of file Setup.php.

Referenced by WebInstaller\__construct(), OutputPage\addWikiTextTitle(), PreprocessDump\checkOptions(), Preferences\cleanSignature(), ApiFeedWatchlist\createFeedItem(), ApiExpandTemplates\execute(), ApiParse\execute(), MaintenanceFormatInstallDoc\execute(), SpecialExpandTemplates\execute(), PPFuzzTest\execute(), ApiQueryRevisionsBase\extractRevisionInfo(), EditPage\extractSectionTitle(), TextContent\fillParserOutput(), WikitextContent\fillParserOutput(), SimpleCaptcha\findLinks(), ApiParse\formatSummary(), SpecialExpandTemplates\generateHtml(), MessageCache\getParser(), SpecialVersion\getParserFunctionHooks(), SpecialVersion\getParserTags(), RawAction\getRawText(), WikitextContent\getSection(), PreprocessDump\getStripList(), EditPage\getSummaryPreview(), EditPage\internalAttemptSave(), SimpleCaptcha\loadText(), TitleBlacklistEntry\newFromString(), EditPage\newSectionSummary(), onContentGetParserOutput(), SpecialListGroupRights\outputNamespaceProtectionInfo(), Installer\parse(), OutputPage\parse(), WikitextContent\preloadTransform(), JavaScriptContent\preSaveTransform(), CssContent\preSaveTransform(), WikitextContent\preSaveTransform(), Preferences\profilePreferences(), WikitextContent\replaceSection(), UploadFromUrlTestSuite\setUp(), ParserMethodsTest\testCallParserFunction(), ParserMethodsTest\testGetSections(), ParserMethodsTest\testPreSaveTransform(), ParserMethodsTest\testRecursiveParse(), and Preferences\validateSignature().

◆ $wgRequest

if (! $wgDBerrorLogTZ) $wgRequest = RequestContext::getMain()->getRequest()
Examples
/src/tests/phpunit/MediaWikiTestCase.php.

Definition at line 639 of file Setup.php.

Referenced by TitleBlacklistHooks\abortNewAccount(), TitleBlacklistHooks\addOverrideCheckbox(), SimpleCaptcha\badLoginKey(), SpecialPageFactory\capturePath(), RecentChange\checkIPAddress(), FeedUtils\checkPurge(), EditPage\checkUnicodeCompliantBrowser(), LoginForm\clearCreateaccountToken(), LoginForm\clearLoginThrottle(), LoginForm\clearLoginToken(), SimpleCaptcha\confirmEmailUser(), EditPage\displayPermissionsError(), UploadFromUrlTest\doApiRequest(), ApiTestCase\doApiRequest(), ApiTestCase\doApiRequestWithToken(), SimpleCaptcha\doConfirmEdit(), MediaWikiTestCase\doLightweightServiceReset(), EditPage\edit(), ApiEditPage\execute(), FileDeleteForm\execute(), SpamBlacklist\filter(), WebInstaller\getAcceptLanguage(), EditPage\getContentObject(), LoginForm\getCreateaccountToken(), Title\getLocalURL(), LoginForm\getLoginToken(), ParserCache\getParserOutputKey(), User\getRequest(), AtomFeed\getSelfUrl(), MWExceptionHandler\getURL(), MWExceptionRenderer\googleSearchForm(), RequestContext\importScopedSession(), LoginForm\incrementLoginThrottle(), EditPage\internalAttemptSave(), SimpleCaptcha\isIPWhitelisted(), ChangeTags\modifyDisplayQuery(), RecentChange\newLogEntry(), TitleBlacklistHooks\onAddNewAccountApiForm(), ReCaptcha\passCaptcha(), EditPage\previewOnOpen(), UploadFromUrlTestSuite\setUp(), FileDeleteForm\showForm(), FancyCaptcha\showImage(), MediaWikiTestCase\tearDown(), LanguageConverterTest\testGetPreferredVariantDefaultLanguageVsUrlVariant(), LanguageConverterTest\testGetPreferredVariantHeaderMulti(), LanguageConverterTest\testGetPreferredVariantHeaders(), LanguageConverterTest\testGetPreferredVariantHeaderUserVsUrl(), LanguageConverterTest\testGetPreferredVariantHeaderWeight(), LanguageConverterTest\testGetPreferredVariantHeaderWeight2(), OutputPage\transformCssMedia(), and wfInstallerMain().

◆ $wgServerName

if ($wgServerName !==false) $wgServerName = $serverParts['host']

Definition at line 562 of file Setup.php.

◆ $wgSessionsInObjectCache

if ($wgInvalidateCacheOnLocalSettingsChange) if ($wgNewUserLog) if ($wgPageLanguageUseDB) if ($wgCookieSecure==='detect') if ($wgProfileOnly) if ($wgMinimalPasswordLength !==false) if ($wgMaximalPasswordLength !==false) if (! $wgSessionsInObjectCache) $wgSessionsInObjectCache = true

Definition at line 485 of file Setup.php.

◆ $wgSkipSkins

$wgSkipSkins[] = 'fallback'

Definition at line 298 of file Setup.php.

Referenced by Skin\getAllowedSkins().

◆ $wgTitle

$wgTitle = null

Definition at line 803 of file Setup.php.

◆ $wgUseEnotif

$wgUseEnotif = false

◆ $wgUser

User $wgUser = RequestContext::getMain()->getUser()

Definition at line 781 of file Setup.php.

Referenced by UploadStash\__construct(), ApiMain\__construct(), Installer\__construct(), Revision\__construct(), ParserOptions\__construct(), LocalFileDeleteBatch\__construct(), TitleBlacklistHooks\abortNewAccount(), LogPage\addEntry(), TitleBlacklistHooks\addOverrideCheckbox(), EditPage\attemptSave(), SpecialPageFactory\capturePath(), AjaxResponse\checkLastModified(), FeedUtils\checkPurge(), SimpleCaptcha\confirmEmailUser(), Language\dateFormat(), ApiTestCase\doApiRequest(), SimpleCaptcha\doConfirmEdit(), FileDeleteForm\doDelete(), WikiPage\doDeleteArticleReal(), WikiPage\doEditContent(), ApiTestCase\doLogin(), EditPage\doPreviewParse(), EditPage\edit(), Undelete\execute(), DeleteDefaultMessages\execute(), ImportSiteScripts\execute(), CleanupSpam\execute(), EditCLI\execute(), TableCleanup\execute(), DeleteBatch\execute(), MoveBatch\execute(), FileDeleteForm\execute(), DeleteEqualMessages\execute(), ImportImages\execute(), PPFuzzTest\execute(), SimpleCaptcha\findLinks(), User\getBlockedStatus(), ApiQueryInfo\getBlockToken(), EditPage\getCheckboxesDefinition(), EditPage\getContentObject(), ApiQueryInfo\getDeleteToken(), EditPage\getEditPermissionErrors(), ApiQueryInfo\getEditToken(), ApiQueryInfo\getEmailToken(), LogEventsList\getExcludeClause(), GenderCache\getGenderOf(), ApiQueryInfo\getImportToken(), WebRequest\getLimitOffset(), ApiQueryInfo\getMoveToken(), Title\getNotificationTimestamp(), ApiQueryInfo\getOptionsToken(), MessageCache\getParserOptions(), ApiQueryRecentChanges\getPatrolToken(), EditPage\getPreloadedContent(), ApiQueryInfo\getProtectToken(), SpecialPageFactory\getRestrictedPages(), ApiQueryRevisions\getRollbackToken(), SpecialPageFactory\getUsablePages(), ApiQueryUsers\getUserrightsToken(), ApiQueryInfo\getWatchToken(), EditPage\handleStatus(), EditPage\importFormData(), RequestContext\importScopedSession(), EditPage\initialiseForm(), EditPage\internalAttemptSave(), WikiEditorHooks\isEnabled(), Title\isValidMoveOperation(), UploadFromUrl\isValidRequest(), SpamBlacklist\logFilterHit(), RecentChange\markPatrolled(), Title\moveTo(), SimpleCaptcha\needCreateAccountCaptcha(), Revision\newNullRevision(), RenameuserHooks\onContributionsToolLinks(), WikiPage\prepareContentForEdit(), EditPage\previewOnOpen(), PatrolLog\record(), LocalFile\recordUpload(), LocalFile\recordUpload2(), DoubleRedirectJob\run(), EditPage\setHeaders(), LoginSignupSpecialPage\setSessionUserForCurrentRequest(), UploadFromUrlTestSuite\setUp(), EditPage\showDiff(), EditPage\showEditForm(), FileDeleteForm\showForm(), EditPage\showFormAfterText(), EditPage\showHeader(), EditPage\showIntro(), EditPage\showTextbox(), LanguageConverterTest\testGetPreferredVariantHeaderUserVsUrl(), LanguageConverterTest\testGetPreferredVariantUserOption(), LanguageConverterTest\testGetPreferredVariantUserOptionForForeignLanguage(), UserTest\testSoftBlockRanges(), EditPage\tokenOk(), LogEventsList\typeAction(), PageArchive\undelete(), EditPage\updateWatchlist(), Language\userAdjust(), Title\userCan(), LogEventsList\userCanBitfield(), Revision\userCanBitfield(), Linker\userToolLinks(), TitleBlacklistHooks\validateBlacklist(), and Title\validateFileMoveOperation().

◆ $wgUserEmailUseReplyTo

$wgUserEmailUseReplyTo = false

Definition at line 346 of file Setup.php.

◆ $wgUsersNotifiedOnAllChanges

$wgUsersNotifiedOnAllChanges = []

Definition at line 347 of file Setup.php.

◆ $wgVirtualRestConfig

if (! $wgEmergencyContact) if (! $wgPasswordSender) if (! $wgNoReplyAddress) if ($wgSecureLogin &&substr($wgServer, 0, 2) !=='//') $wgVirtualRestConfig[ 'global'][ 'domain'] = $wgCanonicalServer

Definition at line 584 of file Setup.php.

◆ $wgXhtmlDefaultNamespace

$wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml'

Definition at line 425 of file Setup.php.

◆ else

if (!defined('MW_NO_SESSION') &&! $wgCommandLineMode) else
Initial value:

Definition at line 330 of file Setup.php.

◆ MW_SERVICE_BOOTSTRAP_COMPLETE

const MW_SERVICE_BOOTSTRAP_COMPLETE($wgSharedDB &&$wgSharedTables) 1

Definition at line 528 of file Setup.php.

LanguageCode\getDeprecatedCodeMapping
static getDeprecatedCodeMapping()
Returns a mapping of deprecated language codes that were used in previous versions of MediaWiki to up...
Definition: LanguageCode.php:40
NS_HELP
const NS_HELP
Definition: Defines.php:74
$wgMinUploadChunkSize
if( $wgMetaNamespace===false) if( $wgResourceLoaderMaxQueryLength===false) $wgMinUploadChunkSize
Definition: Setup.php:367
StubObject
Class to implement stub globals, which are globals that delay loading the their associated module cod...
Definition: StubObject.php:44
NS_TEMPLATE_TALK
const NS_TEMPLATE_TALK
Definition: Defines.php:73
$wgDefaultUserOptions
if( $wgRCFilterByAge) $wgDefaultUserOptions['rcdays']
Definition: Setup.php:284
NS_FILE
const NS_FILE
Definition: Defines.php:68
NS_TEMPLATE
const NS_TEMPLATE
Definition: Defines.php:72
$rcMaxAgeDays
$rcMaxAgeDays
Definition: Setup.php:267
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:51
NS_PROJECT
const NS_PROJECT
Definition: Defines.php:66
NS_MEDIAWIKI_TALK
const NS_MEDIAWIKI_TALK
Definition: Defines.php:71
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:76
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:65
NS_MEDIA
const NS_MEDIA
Definition: Defines.php:50
NS_PROJECT_TALK
const NS_PROJECT_TALK
Definition: Defines.php:67
$wgAllowHTMLEmail
$wgAllowHTMLEmail
For parts of the system that have been updated to provide HTML email content, send both text and HTML...
Definition: DefaultSettings.php:1658
wfShorthandToInteger
wfShorthandToInteger( $string='', $default=-1)
Converts shorthand byte notation to integer form.
Definition: GlobalFunctions.php:3339
NS_HELP_TALK
const NS_HELP_TALK
Definition: Defines.php:75
NS_USER
const NS_USER
Definition: Defines.php:64
NS_TALK
const NS_TALK
Definition: Defines.php:63
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:70
NS_FILE_TALK
const NS_FILE_TALK
Definition: Defines.php:69
NS_CATEGORY_TALK
const NS_CATEGORY_TALK
Definition: Defines.php:77
$wgExtraLanguageCodes
$wgExtraLanguageCodes
List of mappings from one language code to another.
Definition: DefaultSettings.php:2901