2004-02-18 02:15:00 +00:00
|
|
|
<?php
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
|
|
|
|
* Include most things that's need to customize the site
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This file is not a valid entry point, perform no further processing unless
|
|
|
|
|
* MEDIAWIKI is defined
|
|
|
|
|
*/
|
2006-07-14 05:35:31 +00:00
|
|
|
if( !defined( 'MEDIAWIKI' ) ) {
|
|
|
|
|
echo "This file is part of MediaWiki, it is not a valid entry point.\n";
|
|
|
|
|
exit( 1 );
|
2008-04-14 07:45:50 +00:00
|
|
|
}
|
2004-08-06 22:30:47 +00:00
|
|
|
|
2003-04-14 23:10:40 +00:00
|
|
|
# The main wiki script and things like database
|
|
|
|
|
# conversion and maintenance scripts all share a
|
|
|
|
|
# common setup of including lots of classes and
|
|
|
|
|
# setting up a few globals.
|
|
|
|
|
#
|
|
|
|
|
|
2006-07-14 05:35:31 +00:00
|
|
|
$fname = 'Setup.php';
|
|
|
|
|
wfProfileIn( $fname );
|
|
|
|
|
|
2005-04-09 10:30:45 +00:00
|
|
|
// Check to see if we are at the file scope
|
2008-12-23 23:34:35 +00:00
|
|
|
if ( !isset( $wgVersion ) ) {
|
2006-01-14 02:49:43 +00:00
|
|
|
echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
|
2006-06-07 06:40:24 +00:00
|
|
|
die( 1 );
|
2005-04-09 10:30:45 +00:00
|
|
|
}
|
2004-03-20 15:03:26 +00:00
|
|
|
|
2007-01-03 08:41:16 +00:00
|
|
|
// Set various default paths sensibly...
|
2007-06-28 14:50:06 +00:00
|
|
|
if( $wgScript === false ) $wgScript = "$wgScriptPath/index$wgScriptExtension";
|
|
|
|
|
if( $wgRedirectScript === false ) $wgRedirectScript = "$wgScriptPath/redirect$wgScriptExtension";
|
2007-01-03 08:41:16 +00:00
|
|
|
|
|
|
|
|
if( $wgArticlePath === false ) {
|
|
|
|
|
if( $wgUsePathInfo ) {
|
2008-12-23 23:34:35 +00:00
|
|
|
$wgArticlePath = "$wgScript/$1";
|
2007-01-03 08:41:16 +00:00
|
|
|
} else {
|
2008-12-23 23:34:35 +00:00
|
|
|
$wgArticlePath = "$wgScript?title=$1";
|
2007-01-03 08:41:16 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins";
|
|
|
|
|
if( $wgStyleDirectory === false) $wgStyleDirectory = "$IP/skins";
|
|
|
|
|
|
|
|
|
|
if( $wgLogo === false ) $wgLogo = "$wgStylePath/common/images/wiki.png";
|
|
|
|
|
|
|
|
|
|
if( $wgUploadPath === false ) $wgUploadPath = "$wgScriptPath/images";
|
|
|
|
|
if( $wgUploadDirectory === false ) $wgUploadDirectory = "$IP/images";
|
|
|
|
|
|
|
|
|
|
if( $wgMathPath === false ) $wgMathPath = "{$wgUploadPath}/math";
|
|
|
|
|
if( $wgMathDirectory === false ) $wgMathDirectory = "{$wgUploadDirectory}/math";
|
|
|
|
|
if( $wgTmpDirectory === false ) $wgTmpDirectory = "{$wgUploadDirectory}/tmp";
|
|
|
|
|
|
2007-01-09 06:35:18 +00:00
|
|
|
if( $wgReadOnlyFile === false ) $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
|
|
|
|
|
if( $wgFileCacheDirectory === false ) $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
|
|
|
|
|
|
2008-12-23 23:34:35 +00:00
|
|
|
if ( empty( $wgFileStore['deleted']['directory'] ) ) {
|
2007-07-22 14:45:12 +00:00
|
|
|
$wgFileStore['deleted']['directory'] = "{$wgUploadDirectory}/deleted";
|
|
|
|
|
}
|
2007-10-01 19:50:25 +00:00
|
|
|
|
2008-08-31 13:03:30 +00:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
$wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface';
|
|
|
|
|
|
2008-11-27 20:27:05 +00:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2008-12-01 17:14:30 +00:00
|
|
|
$wgNamespaceAliases['Image'] = NS_FILE;
|
|
|
|
|
$wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
|
2008-11-27 20:27:05 +00:00
|
|
|
|
2007-05-30 21:02:32 +00:00
|
|
|
/**
|
|
|
|
|
* Initialise $wgLocalFileRepo from backwards-compatible settings
|
|
|
|
|
*/
|
2008-12-23 23:34:35 +00:00
|
|
|
if ( !$wgLocalFileRepo ) {
|
2008-04-14 07:45:50 +00:00
|
|
|
$wgLocalFileRepo = array(
|
2007-05-30 21:02:32 +00:00
|
|
|
'class' => 'LocalRepo',
|
|
|
|
|
'name' => 'local',
|
|
|
|
|
'directory' => $wgUploadDirectory,
|
|
|
|
|
'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath,
|
|
|
|
|
'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
|
|
|
|
|
'thumbScriptUrl' => $wgThumbnailScriptPath,
|
|
|
|
|
'transformVia404' => !$wgGenerateThumbnailOnParse,
|
2007-06-14 16:33:16 +00:00
|
|
|
'initialCapital' => $wgCapitalLinks,
|
2007-07-22 14:45:12 +00:00
|
|
|
'deletedDir' => $wgFileStore['deleted']['directory'],
|
2007-10-01 19:50:25 +00:00
|
|
|
'deletedHashLevels' => $wgFileStore['deleted']['hash']
|
2007-05-30 21:02:32 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Initialise shared repo from backwards-compatible settings
|
|
|
|
|
*/
|
2008-12-23 23:34:35 +00:00
|
|
|
if ( $wgUseSharedUploads ) {
|
|
|
|
|
if ( $wgSharedUploadDBname ) {
|
2007-05-30 21:02:32 +00:00
|
|
|
$wgForeignFileRepos[] = array(
|
|
|
|
|
'class' => 'ForeignDBRepo',
|
|
|
|
|
'name' => 'shared',
|
|
|
|
|
'directory' => $wgSharedUploadDirectory,
|
|
|
|
|
'url' => $wgSharedUploadPath,
|
|
|
|
|
'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
|
|
|
|
|
'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
|
|
|
|
|
'transformVia404' => !$wgGenerateThumbnailOnParse,
|
|
|
|
|
'dbType' => $wgDBtype,
|
|
|
|
|
'dbServer' => $wgDBserver,
|
|
|
|
|
'dbUser' => $wgDBuser,
|
|
|
|
|
'dbPassword' => $wgDBpassword,
|
|
|
|
|
'dbName' => $wgSharedUploadDBname,
|
2007-07-22 14:45:12 +00:00
|
|
|
'dbFlags' => ($wgDebugDumpSql ? DBO_DEBUG : 0) | DBO_DEFAULT,
|
2007-05-30 21:02:32 +00:00
|
|
|
'tablePrefix' => $wgSharedUploadDBprefix,
|
|
|
|
|
'hasSharedCache' => $wgCacheSharedUploads,
|
|
|
|
|
'descBaseUrl' => $wgRepositoryBaseUrl,
|
|
|
|
|
'fetchDescription' => $wgFetchCommonsDescriptions,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
2008-04-14 07:45:50 +00:00
|
|
|
$wgForeignFileRepos[] = array(
|
2007-05-30 21:02:32 +00:00
|
|
|
'class' => 'FSRepo',
|
|
|
|
|
'name' => 'shared',
|
|
|
|
|
'directory' => $wgSharedUploadDirectory,
|
|
|
|
|
'url' => $wgSharedUploadPath,
|
|
|
|
|
'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
|
|
|
|
|
'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
|
|
|
|
|
'transformVia404' => !$wgGenerateThumbnailOnParse,
|
|
|
|
|
'descBaseUrl' => $wgRepositoryBaseUrl,
|
|
|
|
|
'fetchDescription' => $wgFetchCommonsDescriptions,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-12-23 23:34:35 +00:00
|
|
|
if ( !class_exists( 'AutoLoader' ) ) {
|
|
|
|
|
require_once( "$IP/includes/AutoLoader.php" );
|
|
|
|
|
}
|
2006-06-08 13:27:11 +00:00
|
|
|
|
2006-06-06 23:07:26 +00:00
|
|
|
wfProfileIn( $fname.'-exception' );
|
2006-07-01 07:22:59 +00:00
|
|
|
require_once( "$IP/includes/Exception.php" );
|
2006-06-06 23:07:26 +00:00
|
|
|
wfInstallExceptionHandler();
|
|
|
|
|
wfProfileOut( $fname.'-exception' );
|
|
|
|
|
|
2004-06-09 01:25:31 +00:00
|
|
|
wfProfileIn( $fname.'-includes' );
|
2006-07-01 07:22:59 +00:00
|
|
|
require_once( "$IP/includes/GlobalFunctions.php" );
|
|
|
|
|
require_once( "$IP/includes/Hooks.php" );
|
|
|
|
|
require_once( "$IP/includes/Namespace.php" );
|
|
|
|
|
require_once( "$IP/includes/ProxyTools.php" );
|
|
|
|
|
require_once( "$IP/includes/ObjectCache.php" );
|
2006-07-02 15:57:59 +00:00
|
|
|
require_once( "$IP/includes/ImageFunctions.php" );
|
2006-07-26 07:15:39 +00:00
|
|
|
require_once( "$IP/includes/StubObject.php" );
|
2004-06-09 01:25:31 +00:00
|
|
|
wfProfileOut( $fname.'-includes' );
|
2004-08-14 13:34:57 +00:00
|
|
|
wfProfileIn( $fname.'-misc1' );
|
2004-02-14 12:37:25 +00:00
|
|
|
|
2006-07-26 07:15:39 +00:00
|
|
|
|
2005-09-05 02:22:20 +00:00
|
|
|
$wgIP = false; # Load on demand
|
2006-07-26 07:15:39 +00:00
|
|
|
# Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
|
|
|
|
|
$wgRequest = new WebRequest;
|
2006-04-02 04:13:23 +00:00
|
|
|
|
2004-02-14 12:37:25 +00:00
|
|
|
# Useful debug output
|
2008-12-23 23:34:35 +00:00
|
|
|
if ( $wgCommandLineMode ) {
|
2006-07-26 07:15:39 +00:00
|
|
|
wfDebug( "\n\nStart command line script $self\n" );
|
2008-12-23 23:34:35 +00:00
|
|
|
} elseif ( function_exists( 'getallheaders' ) ) {
|
2005-04-09 10:30:45 +00:00
|
|
|
wfDebug( "\n\nStart request\n" );
|
2004-03-08 01:51:32 +00:00
|
|
|
wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" );
|
2004-02-14 12:37:25 +00:00
|
|
|
$headers = getallheaders();
|
|
|
|
|
foreach ($headers as $name => $value) {
|
|
|
|
|
wfDebug( "$name: $value\n" );
|
|
|
|
|
}
|
|
|
|
|
wfDebug( "\n" );
|
2005-03-27 06:37:21 +00:00
|
|
|
} elseif( isset( $_SERVER['REQUEST_URI'] ) ) {
|
2004-03-08 01:51:32 +00:00
|
|
|
wfDebug( $_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['REQUEST_URI'] . "\n" );
|
2004-03-06 01:49:16 +00:00
|
|
|
}
|
2003-08-11 13:53:20 +00:00
|
|
|
|
2008-05-17 16:08:34 +00:00
|
|
|
if( $wgRCFilterByAge ) {
|
|
|
|
|
## Trim down $wgRCLinkDays so that it only lists links which are valid
|
|
|
|
|
## as determined by $wgRCMaxAge.
|
|
|
|
|
## Note that we allow 1 link higher than the max for things like 56 days but a 60 day link.
|
|
|
|
|
sort($wgRCLinkDays);
|
|
|
|
|
for( $i = 0; $i < count($wgRCLinkDays); $i++ ) {
|
|
|
|
|
if( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) {
|
|
|
|
|
$wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i+1, false );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-23 23:34:35 +00:00
|
|
|
if ( $wgSkipSkin ) {
|
2005-05-29 06:18:10 +00:00
|
|
|
$wgSkipSkins[] = $wgSkipSkin;
|
|
|
|
|
}
|
|
|
|
|
|
2005-06-25 13:47:18 +00:00
|
|
|
$wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
|
|
|
|
|
|
2008-12-23 23:34:35 +00:00
|
|
|
if($wgMetaNamespace === FALSE) {
|
2006-07-26 07:15:39 +00:00
|
|
|
$wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
|
|
|
|
|
}
|
|
|
|
|
|
2006-07-26 08:26:51 +00:00
|
|
|
# These are now the same, always
|
|
|
|
|
# To determine the user language, use $wgLang->getCode()
|
|
|
|
|
$wgContLanguageCode = $wgLanguageCode;
|
|
|
|
|
|
2009-01-27 19:58:26 +00:00
|
|
|
# Easy to forget to falsify $wgShowIPinHeader for static caches.
|
|
|
|
|
# If file cache or squid cache is on, just disable this (DWIMD).
|
|
|
|
|
if( $wgUseFileCache || $wgUseSquid ) $wgShowIPinHeader = false;
|
2009-01-27 19:53:20 +00:00
|
|
|
|
2009-05-24 12:09:15 +00:00
|
|
|
# $wgAllowRealName and $wgAllowUserSkin were removed in 1.16
|
|
|
|
|
# in favor of $wgHiddenPrefs, handle b/c here
|
2009-05-19 17:07:46 +00:00
|
|
|
if( !$wgAllowRealName ) {
|
|
|
|
|
$wgHiddenPrefs[] = 'realname';
|
|
|
|
|
}
|
|
|
|
|
|
2009-05-24 12:09:15 +00:00
|
|
|
if( !$wgAllowUserSkin ) {
|
|
|
|
|
$wgHiddenPrefs[] = 'skin';
|
|
|
|
|
}
|
|
|
|
|
|
2004-08-14 13:34:57 +00:00
|
|
|
wfProfileOut( $fname.'-misc1' );
|
|
|
|
|
wfProfileIn( $fname.'-memcached' );
|
|
|
|
|
|
2006-06-01 08:19:02 +00:00
|
|
|
$wgMemc =& wfGetMainCache();
|
|
|
|
|
$messageMemc =& wfGetMessageCacheStorage();
|
|
|
|
|
$parserMemc =& wfGetParserCacheStorage();
|
2004-08-21 10:04:30 +00:00
|
|
|
|
2005-07-03 04:00:33 +00:00
|
|
|
wfDebug( 'Main cache: ' . get_class( $wgMemc ) .
|
2008-06-17 08:14:33 +00:00
|
|
|
"\nMessage cache: " . get_class( $messageMemc ) .
|
|
|
|
|
"\nParser cache: " . get_class( $parserMemc ) . "\n" );
|
2003-11-21 02:43:12 +00:00
|
|
|
|
2004-06-09 01:25:31 +00:00
|
|
|
wfProfileOut( $fname.'-memcached' );
|
2008-12-10 23:15:50 +00:00
|
|
|
|
|
|
|
|
## Most of the config is out, some might want to run hooks here.
|
|
|
|
|
wfRunHooks( 'SetupAfterCache' );
|
|
|
|
|
|
2004-07-18 08:48:43 +00:00
|
|
|
wfProfileIn( $fname.'-SetupSession' );
|
|
|
|
|
|
2008-05-07 06:05:26 +00:00
|
|
|
# Set default shared prefix
|
|
|
|
|
if( $wgSharedPrefix === false ) $wgSharedPrefix = $wgDBprefix;
|
|
|
|
|
|
2008-07-21 21:51:51 +00:00
|
|
|
if( !$wgCookiePrefix ) {
|
2008-12-09 02:55:49 +00:00
|
|
|
if ( $wgSharedDB && $wgSharedPrefix && in_array('user',$wgSharedTables) ) {
|
2008-07-21 21:51:51 +00:00
|
|
|
$wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
|
2008-12-09 02:55:49 +00:00
|
|
|
} elseif ( $wgSharedDB && in_array('user',$wgSharedTables) ) {
|
2008-07-21 21:51:51 +00:00
|
|
|
$wgCookiePrefix = $wgSharedDB;
|
|
|
|
|
} elseif ( $wgDBprefix ) {
|
|
|
|
|
$wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
|
|
|
|
|
} else {
|
|
|
|
|
$wgCookiePrefix = $wgDBname;
|
|
|
|
|
}
|
2006-02-11 07:41:31 +00:00
|
|
|
}
|
2007-04-25 18:38:11 +00:00
|
|
|
$wgCookiePrefix = strtr($wgCookiePrefix, "=,; +.\"'\\[", "__________");
|
2006-02-11 07:41:31 +00:00
|
|
|
|
2006-01-15 08:05:28 +00:00
|
|
|
# If session.auto_start is there, we can't touch session name
|
|
|
|
|
#
|
2007-09-17 19:44:15 +00:00
|
|
|
if( !wfIniGetBool( 'session.auto_start' ) )
|
2006-07-04 04:20:14 +00:00
|
|
|
session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
|
2005-05-14 09:27:24 +00:00
|
|
|
|
2008-12-23 23:34:35 +00:00
|
|
|
if( !$wgCommandLineMode && ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix.'Token'] ) ) ) {
|
2005-12-26 13:08:06 +00:00
|
|
|
wfIncrStats( 'request_with_session' );
|
2006-07-26 07:15:39 +00:00
|
|
|
wfSetupSession();
|
2004-07-18 08:48:43 +00:00
|
|
|
$wgSessionStarted = true;
|
|
|
|
|
} else {
|
2005-12-26 13:08:06 +00:00
|
|
|
wfIncrStats( 'request_without_session' );
|
2004-07-18 08:48:43 +00:00
|
|
|
$wgSessionStarted = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wfProfileOut( $fname.'-SetupSession' );
|
2006-07-26 07:15:39 +00:00
|
|
|
wfProfileIn( $fname.'-globals' );
|
2004-06-15 15:00:54 +00:00
|
|
|
|
2006-07-26 07:15:39 +00:00
|
|
|
$wgContLang = new StubContLang;
|
2007-05-17 20:02:59 +00:00
|
|
|
|
|
|
|
|
// Now that variant lists may be available...
|
|
|
|
|
$wgRequest->interpolateTitle();
|
|
|
|
|
|
2006-07-26 07:15:39 +00:00
|
|
|
$wgUser = new StubUser;
|
|
|
|
|
$wgLang = new StubUserLang;
|
2009-05-30 19:49:51 +00:00
|
|
|
$wgVariant = new StubUserVariant;
|
2006-07-26 07:15:39 +00:00
|
|
|
$wgOut = new StubObject( 'wgOut', 'OutputPage' );
|
2007-11-20 10:55:08 +00:00
|
|
|
$wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
|
|
|
|
|
|
2008-04-14 07:45:50 +00:00
|
|
|
$wgMessageCache = new StubObject( 'wgMessageCache', 'MessageCache',
|
2008-06-17 08:14:33 +00:00
|
|
|
array( $messageMemc, $wgUseDatabaseMessages, $wgMsgCacheExpiry, wfWikiID() ) );
|
2006-07-26 07:15:39 +00:00
|
|
|
|
|
|
|
|
wfProfileOut( $fname.'-globals' );
|
2005-06-16 07:51:45 +00:00
|
|
|
wfProfileIn( $fname.'-User' );
|
|
|
|
|
|
|
|
|
|
# Skin setup functions
|
2005-07-03 04:00:33 +00:00
|
|
|
# Entries can be added to this variable during the inclusion
|
2005-06-16 07:51:45 +00:00
|
|
|
# of the extension file. Skins can then perform any necessary initialisation.
|
2008-04-14 07:45:50 +00:00
|
|
|
#
|
2008-12-23 23:34:35 +00:00
|
|
|
foreach ( $wgSkinExtensionFunctions as $func ) {
|
2005-12-14 16:46:27 +00:00
|
|
|
call_user_func( $func );
|
2005-06-16 07:51:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( !is_object( $wgAuth ) ) {
|
2006-07-26 07:15:39 +00:00
|
|
|
$wgAuth = new StubObject( 'wgAuth', 'AuthPlugin' );
|
2006-11-30 07:47:34 +00:00
|
|
|
wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
|
2005-06-16 07:51:45 +00:00
|
|
|
}
|
2006-11-30 07:47:34 +00:00
|
|
|
|
2005-06-16 07:51:45 +00:00
|
|
|
wfProfileOut( $fname.'-User' );
|
2004-09-24 13:14:52 +00:00
|
|
|
|
2004-08-14 13:34:57 +00:00
|
|
|
wfProfileIn( $fname.'-misc2' );
|
2004-06-04 02:44:58 +00:00
|
|
|
|
2003-04-14 23:10:40 +00:00
|
|
|
$wgDeferredUpdateList = array();
|
2005-03-09 02:02:04 +00:00
|
|
|
$wgPostCommitUpdateList = array();
|
|
|
|
|
|
2008-12-23 23:34:35 +00:00
|
|
|
if ( $wgAjaxWatch ) $wgAjaxExportList[] = 'wfAjaxWatch';
|
|
|
|
|
if ( $wgAjaxUploadDestCheck ) $wgAjaxExportList[] = 'UploadForm::ajaxGetExistsWarning';
|
2007-07-18 19:19:50 +00:00
|
|
|
if( $wgAjaxLicensePreview )
|
|
|
|
|
$wgAjaxExportList[] = 'UploadForm::ajaxGetLicensePreview';
|
2006-07-30 10:53:22 +00:00
|
|
|
|
2004-05-31 08:43:36 +00:00
|
|
|
# Placeholders in case of DB error
|
2006-07-26 07:15:39 +00:00
|
|
|
$wgTitle = null;
|
|
|
|
|
$wgArticle = null;
|
2004-05-31 08:43:36 +00:00
|
|
|
|
2004-08-14 13:34:57 +00:00
|
|
|
wfProfileOut( $fname.'-misc2' );
|
2004-06-09 01:25:31 +00:00
|
|
|
wfProfileIn( $fname.'-extensions' );
|
2004-06-04 02:44:58 +00:00
|
|
|
|
2004-09-26 13:41:21 +00:00
|
|
|
# Extension setup functions for extensions other than skins
|
2005-07-03 04:00:33 +00:00
|
|
|
# Entries should be added to this variable during the inclusion
|
|
|
|
|
# of the extension file. This allows the extension to perform
|
2004-05-15 03:36:39 +00:00
|
|
|
# any necessary initialisation in the fully initialised environment
|
2008-12-23 23:34:35 +00:00
|
|
|
foreach ( $wgExtensionFunctions as $func ) {
|
2009-04-06 12:41:20 +00:00
|
|
|
# Allow closures in PHP 5.3+
|
|
|
|
|
if ( is_object( $func ) && $func instanceof Closure )
|
|
|
|
|
$profName = $fname.'-extensions-closure';
|
2009-05-06 20:02:01 +00:00
|
|
|
elseif( is_array( $func ) )
|
|
|
|
|
$profName = $fname.'-extensions-'.implode( '::', $func );
|
2009-04-06 12:41:20 +00:00
|
|
|
else
|
|
|
|
|
$profName = $fname.'-extensions-'.strval( $func );
|
|
|
|
|
|
2006-10-02 17:04:13 +00:00
|
|
|
wfProfileIn( $profName );
|
2005-12-14 16:46:27 +00:00
|
|
|
call_user_func( $func );
|
2006-10-02 17:04:13 +00:00
|
|
|
wfProfileOut( $profName );
|
2004-05-15 03:36:39 +00:00
|
|
|
}
|
|
|
|
|
|
2006-05-25 07:37:20 +00:00
|
|
|
// For compatibility
|
|
|
|
|
wfRunHooks( 'LogPageValidTypes', array( &$wgLogTypes ) );
|
|
|
|
|
wfRunHooks( 'LogPageLogName', array( &$wgLogNames ) );
|
|
|
|
|
wfRunHooks( 'LogPageLogHeader', array( &$wgLogHeaders ) );
|
|
|
|
|
wfRunHooks( 'LogPageActionText', array( &$wgLogActions ) );
|
|
|
|
|
|
2008-09-13 00:29:33 +00:00
|
|
|
if( !empty($wgNewUserLog) ) {
|
|
|
|
|
# Add a new log type
|
|
|
|
|
$wgLogTypes[] = 'newusers';
|
|
|
|
|
$wgLogNames['newusers'] = 'newuserlogpage';
|
|
|
|
|
$wgLogHeaders['newusers'] = 'newuserlogpagetext';
|
|
|
|
|
$wgLogActions['newusers/newusers'] = 'newuserlogentry'; // For compatibility with older log entries
|
|
|
|
|
$wgLogActions['newusers/create'] = 'newuserlog-create-entry';
|
|
|
|
|
$wgLogActions['newusers/create2'] = 'newuserlog-create2-entry';
|
|
|
|
|
$wgLogActions['newusers/autocreate'] = 'newuserlog-autocreate-entry';
|
|
|
|
|
}
|
2006-05-25 07:37:20 +00:00
|
|
|
|
2006-07-26 07:15:39 +00:00
|
|
|
wfDebug( "Fully initialised\n" );
|
2004-07-18 08:48:43 +00:00
|
|
|
$wgFullyInitialised = true;
|
2004-06-09 01:25:31 +00:00
|
|
|
wfProfileOut( $fname.'-extensions' );
|
2003-10-25 08:01:33 +00:00
|
|
|
wfProfileOut( $fname );
|