MediaWiki  1.23.2
Setup.php File Reference

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

Go to the source code of this file.

Variables

 $debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n"
 
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()
 
if( $wgMetaNamespace===false) if( $wgResourceLoaderMaxQueryLength===false$wgCanonicalNamespaceNames
 Definitions of the NS_ constants are in Defines.php. More...
 
global $wgCommandLineMode
 
 $wgContLang = Language::factory( $wgLanguageCode )
 
if(is_array( $wgExtraNamespaces)) $wgContLanguageCode = $wgLanguageCode
 
if( $wgRCFilterByAge) if( $wgSkipSkin) if( $wgLocalInterwiki) if( $wgSharedPrefix===false) if(! $wgCookiePrefix) $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' )
 
 $wgDeferredUpdateList = array()
 
if(! $wgHtml5Version && $wgAllowRdfaAttributes) $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) )
 
 $wgFullyInitialised = true
 
if( $wgUseFileCache|| $wgUseSquid) if(! $wgEnotifMinorEdits) $wgHtml5 = true
 
 $wgJsMimeType = 'text/javascript'
 
 $wgLang = new StubUserLang
 
 $wgLangConvMemc = wfGetLangConverterCacheStorage()
 
 $wgLockManagers []
 Initialise $wgLockManagers to include basic FS version. More...
 
 $wgMemc = wfGetMainCache()
 
 $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(!isset( $wgVersion)) if( $wgScript===false) if( $wgLoadScript===false) if( $wgArticlePath===false) if(!empty( $wgActionPaths) &&!isset( $wgActionPaths['view'])) if( $wgStylePath===false) if( $wgLocalStylePath===false) if( $wgStyleDirectory===false) if( $wgExtensionAssetsPath===false) if( $wgLogo===false) if( $wgUploadPath===false) if( $wgUploadDirectory===false) if( $wgReadOnlyFile===false) if( $wgFileCacheDirectory===false) if( $wgDeletedDirectory===false) if(isset( $wgFileStore['deleted']['directory'])) if(isset( $wgFooterIcons['copyright']) &&isset( $wgFooterIcons['copyright']['copyright']) && $wgFooterIcons['copyright']['copyright']===array()) 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 = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) )
 
if(!is_object( $wgAuth)) $wgTitle = null
 
 $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist
 
 $wgUser = RequestContext::getMain()->getUser()
 
 $wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml'
 
if(is_null( $wgLocalTZoffset)) if( $wgCommandLineMode) else
 

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

◆ $debug

◆ $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 35 of file Setup.php.

Referenced by Skin\__call(), Article\__call(), DummyLinker\__call(), lessc\__construct(), Article\__get(), Article\__set(), StubObject\_unstub(), DumpTestCase\assertDumpStart(), DatabaseSqlite\attachDatabase(), DatabaseBase\begin(), IndexPager\buildQueryInfo(), lessc\cachedCompile(), DatabaseTestHelper\checkFunctionName(), AjaxResponse\checkLastModified(), TextPassDumperTest\checkpointHelper(), Profiler\collateData(), lessc\compileFile(), DatabaseBase\deadlockLoop(), DatabaseMssql\delete(), DatabaseOracle\delete(), DatabaseBase\delete(), DatabaseMssql\deleteJoin(), DatabaseMysqlBase\deleteJoin(), DatabaseBase\deleteJoin(), IndexPager\doQuery(), DatabaseSqlite\duplicateTableStructure(), DatabaseMysqlBase\duplicateTableStructure(), DatabaseBase\endAtomic(), DatabaseMysqlBase\estimateRowCount(), DatabaseMssql\estimateRowCount(), DatabaseBase\estimateRowCount(), lessc\evaluate(), DatabasePostgres\freeResult(), lessc_parser\func(), lessc\funcToColor(), QueryPage\getCachedTimestamp(), Profiler\getCallTreeLine(), Profiler\getFunctionReport(), Profiler\getRawData(), DumpTestCase\gunzip(), SearchHighlighter\highlightSimple(), SearchHighlighter\highlightText(), DatabaseBase\indexExists(), DatabaseSqlite\indexInfo(), DatabaseMysqlBase\indexInfo(), DatabaseMssql\indexInfo(), DatabaseSqlite\indexUnique(), DatabaseOracle\insert(), DatabaseBase\insert(), DatabaseMssql\insertSelect(), DatabaseBase\insertSelect(), DatabaseMysqlBase\listTables(), LocalFile\loadExtraFromDB(), LocalFile\loadFromDB(), moveToExternal(), DatabaseTestHelper\nativeReplace(), DatabaseBase\nativeReplace(), RecentChange\newFromConds(), XmlTypeCheck\newFromFilename(), ImportStreamSource\newFromUpload(), LocalFile\nextHistoryLine(), EmailNotification\notifyOnPageChange(), DatabaseTestHelper\query(), DatabaseBase\query(), DatabaseOracle\queryIgnore(), ImageListPager\reallyDoQuery(), IndexPager\reallyDoQuery(), QueryPage\reallyDoQuery(), QueryPage\recache(), SearchHighlighter\removeWiki(), DatabaseMysqlBase\replace(), DatabaseBase\replace(), DatabaseOracle\reportQueryError(), DatabaseBase\reportQueryError(), resolveStub(), resolveStubs(), DatabaseMssql\select(), DatabaseBase\select(), DatabaseBase\selectField(), RandomPage\selectRandomPageFromDB(), SpecialRandomInCategory\selectRandomPageFromDB(), DatabaseOracle\selectRow(), DatabaseBase\selectRow(), DatabaseMssql\selectSQLText(), BaseDumpTest\setUpPrefetch(), TextPassDumperTest\setUpStub(), DatabaseBase\sourceFile(), DatabaseBase\sourceStream(), splitFilename(), DatabaseBase\startAtomic(), StreamFile\stream(), DatabaseTestHelper\tableExists(), DatabaseBase\tableExists(), 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(), DatabaseBase\update(), DatabaseMysqlBase\upsert(), DatabaseBase\upsert(), and XmlTypeCheck\validateFromFile().

◆ $messageMemc

$messageMemc = wfGetMessageCacheStorage()

Definition at line 514 of file Setup.php.

◆ $parserMemc

$parserMemc = wfGetParserCacheStorage()

Definition at line 515 of file Setup.php.

◆ $wgCanonicalNamespaceNames

if ($wgMetaNamespace===false) if ($wgResourceLoaderMaxQueryLength===false) $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 304 of file Setup.php.

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

◆ $wgCommandLineMode

◆ $wgContLang

$wgContLang = Language::factory( $wgLanguageCode )

Definition at line 546 of file Setup.php.

◆ $wgContLanguageCode

if (is_array($wgExtraNamespaces)) $wgContLanguageCode = $wgLanguageCode
Todo:
UGLY UGLY

Definition at line 331 of file Setup.php.

◆ $wgCookiePrefix

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

◆ $wgDeferredUpdateList

$wgDeferredUpdateList = array()

Definition at line 577 of file Setup.php.

Referenced by DeferredUpdates\clearPendingUpdates(), and DeferredUpdates\doUpdates().

◆ $wgFileExtensions

if (! $wgHtml5Version &&$wgAllowRdfaAttributes) $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) )

◆ $wgFullyInitialised

$wgFullyInitialised = true

Definition at line 606 of file Setup.php.

Referenced by MWExceptionHandler\handle(), and MWExceptionTest\testUseOutputPage().

◆ $wgHtml5

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

Definition at line 348 of file Setup.php.

◆ $wgJsMimeType

$wgJsMimeType = 'text/javascript'

Definition at line 350 of file Setup.php.

Referenced by SkinTemplate\prepareQuickTemplate().

◆ $wgLang

$wgLang = new StubUserLang

Definition at line 557 of file Setup.php.

◆ $wgLangConvMemc

$wgLangConvMemc = wfGetLangConverterCacheStorage()

Definition at line 516 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 148 of file Setup.php.

Referenced by LockManagerGroup\initFromGlobals().

◆ $wgMemc

$wgMemc = wfGetMainCache()

Definition at line 513 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 142 of file Setup.php.

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

◆ $wgNamespaceAliases [2/2]

$wgNamespaceAliases[ 'Image_talk'] = NS_FILE_TALK

Definition at line 143 of file Setup.php.

◆ $wgNamespaceProtection

if (!isset($wgVersion)) if ($wgScript===false) if ($wgLoadScript===false) if ($wgArticlePath===false) if (!empty($wgActionPaths) &&!isset($wgActionPaths[ 'view'])) if ($wgStylePath===false) if ($wgLocalStylePath===false) if ($wgStyleDirectory===false) if ($wgExtensionAssetsPath===false) if ($wgLogo===false) if ($wgUploadPath===false) if ($wgUploadDirectory===false) if ($wgReadOnlyFile===false) if ($wgFileCacheDirectory===false) if ($wgDeletedDirectory===false) if (isset($wgFileStore[ 'deleted'][ 'directory'])) if (isset($wgFooterIcons[ 'copyright']) &&isset($wgFooterIcons[ 'copyright'][ 'copyright']) &&$wgFooterIcons[ 'copyright'][ 'copyright']===array()) 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 135 of file Setup.php.

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

◆ $wgOut

◆ $wgParser

◆ $wgTitle

if (!is_object($wgAuth)) $wgTitle = null

Definition at line 575 of file Setup.php.

◆ $wgUseEnotif

$wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist

◆ $wgUser

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

Definition at line 552 of file Setup.php.

Referenced by ProtectionForm\__construct(), UploadStash\__construct(), ApiMain\__construct(), Installer\__construct(), ParserOptions\__construct(), Revision\__construct(), LogPage\addEntry(), LoginForm\addNewAccount(), User\addNewUserLogEntry(), LoginForm\authenticateUserData(), ProtectionForm\buildForm(), ProtectionForm\buildSelector(), SpecialPageFactory\capturePath(), AjaxResponse\checkLastModified(), FeedUtils\checkPurge(), ResourceLoaderUserTokensModule\contextUserTokens(), Language\dateFormat(), ApiTestCase\doApiRequest(), LocalFileDeleteBatch\doDBInserts(), FileDeleteForm\doDelete(), WikiPage\doDeleteArticleReal(), WikiPage\doEditContent(), Undelete\execute(), DeleteDefaultMessages\execute(), CleanupSpam\execute(), ImportSiteScripts\execute(), CapsCleanup\execute(), EditCLI\execute(), DeleteBatch\execute(), TableCleanup\execute(), MoveBatch\execute(), FileDeleteForm\execute(), DeleteEqualMessages\execute(), PPFuzzTest\execute(), User\getBlockedStatus(), ApiQueryInfo\getBlockToken(), ApiQueryInfo\getDeleteToken(), ApiQueryInfo\getEditToken(), ApiQueryInfo\getEmailToken(), LogEventsList\getExcludeClause(), GenderCache\getGenderOf(), ApiQueryInfo\getImportToken(), WebRequest\getLimitOffset(), ResourceLoaderUserCSSPrefsModule\getModifiedTime(), ResourceLoaderUserOptionsModule\getModifiedTime(), ApiQueryInfo\getMoveToken(), Title\getNotificationTimestamp(), ApiQueryInfo\getOptionsToken(), ResourceLoaderUserGroupsModule\getPages(), ApiQueryRecentChanges\getPatrolToken(), ApiQueryInfo\getProtectToken(), SpecialPageFactory\getRestrictedPages(), ApiQueryRevisions\getRollbackToken(), ResourceLoaderUserOptionsModule\getScript(), ResourceLoaderUserCSSPrefsModule\getStyles(), SpecialPageFactory\getUsablePages(), ApiQueryUsers\getUserrightsToken(), ApiQueryInfo\getWatchToken(), RequestContext\importScopedSession(), Title\isValidMoveOperation(), UploadFromUrl\isValidRequest(), Linker\linkAttribs(), ProtectionForm\loadData(), RecentChange\markPatrolled(), Title\moveTo(), Title\moveToInternal(), AjaxDispatcher\performAction(), WikiPage\prepareContentForEdit(), WikiPage\preSaveTransform(), DatabaseBase\query(), PatrolLog\record(), LocalFile\recordUpload(), LocalFile\recordUpload2(), DoubleRedirectJob\run(), ProtectionForm\save(), UploadFromUrlTestSuite\setUp(), FileDeleteForm\showForm(), WikiPageTest\testDoQuickEdit(), WikiPageTest\testDoQuickEditContent(), LanguageConverterTest\testGetPreferredVariantHeaderUserVsUrl(), LanguageConverterTest\testGetPreferredVariantUserOption(), LanguageConverterTest\testGetPreferredVariantUserOptionForForeignLanguage(), TitleTest\testWgWhitelistReadRegexp(), LogEventsList\typeAction(), PageArchive\undelete(), WikiPage\updateRestrictions(), Title\updateTitleProtection(), ChangesList\usePatrol(), Language\userAdjust(), Title\userCan(), LogEventsList\userCanBitfield(), Revision\userCanBitfield(), Title\userIsWatching(), Linker\userToolLinks(), and Title\validateFileMoveOperation().

◆ $wgXhtmlDefaultNamespace

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

Definition at line 349 of file Setup.php.

◆ else

if (is_null($wgLocalTZoffset)) if ($wgCommandLineMode) else
Initial value:
{
$wgRequest = new WebRequest

Definition at line 494 of file Setup.php.

NS_HELP
const NS_HELP
Definition: Defines.php:91
NS_TEMPLATE_TALK
const NS_TEMPLATE_TALK
Definition: Defines.php:90
NS_FILE
const NS_FILE
Definition: Defines.php:85
NS_TEMPLATE
const NS_TEMPLATE
Definition: Defines.php:89
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:68
NS_PROJECT
const NS_PROJECT
Definition: Defines.php:83
NS_MEDIAWIKI_TALK
const NS_MEDIAWIKI_TALK
Definition: Defines.php:88
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:93
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:82
NS_MEDIA
const NS_MEDIA
Definition: Defines.php:67
NS_PROJECT_TALK
const NS_PROJECT_TALK
Definition: Defines.php:84
WebRequest
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form,...
Definition: WebRequest.php:38
NS_HELP_TALK
const NS_HELP_TALK
Definition: Defines.php:92
NS_USER
const NS_USER
Definition: Defines.php:81
NS_TALK
const NS_TALK
Definition: Defines.php:80
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:87
NS_FILE_TALK
const NS_FILE_TALK
Definition: Defines.php:86
NS_CATEGORY_TALK
const NS_CATEGORY_TALK
Definition: Defines.php:94