wiki.techinc.nl/includes/Setup.php

426 lines
14 KiB
PHP
Raw Normal View History

<?php
/**
* Include most things that's need to customize the site
*
* @file
*/
/**
* This file is not a valid entry point, perform no further processing unless
* MEDIAWIKI is defined
*/
2011-01-14 21:42:38 +00:00
if ( !defined( 'MEDIAWIKI' ) ) {
exit( 1 );
}
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.
#
$fname = 'Setup.php';
wfProfileIn( $fname );
// Check to see if we are at the file scope
if ( !isset( $wgVersion ) ) {
echo "Error, Setup.php must be included from the file scope, after DefaultSettings.php\n";
die( 1 );
}
// Set various default paths sensibly...
2011-01-14 21:42:38 +00:00
if ( $wgScript === false ) $wgScript = "$wgScriptPath/index$wgScriptExtension";
if ( $wgRedirectScript === false ) $wgRedirectScript = "$wgScriptPath/redirect$wgScriptExtension";
if ( $wgLoadScript === false ) $wgLoadScript = "$wgScriptPath/load$wgScriptExtension";
2011-01-14 21:42:38 +00:00
if ( $wgArticlePath === false ) {
if ( $wgUsePathInfo ) {
$wgArticlePath = "$wgScript/$1";
} else {
$wgArticlePath = "$wgScript?title=$1";
}
}
2011-01-14 21:42:38 +00:00
if ( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins";
if ( $wgLocalStylePath === false ) $wgLocalStylePath = "$wgScriptPath/skins";
if ( $wgStyleDirectory === false ) $wgStyleDirectory = "$IP/skins";
if ( $wgExtensionAssetsPath === false ) $wgExtensionAssetsPath = "$wgScriptPath/extensions";
2011-01-14 21:42:38 +00:00
if ( $wgLogo === false ) $wgLogo = "$wgStylePath/common/images/wiki.png";
2011-01-14 21:42:38 +00:00
if ( $wgUploadPath === false ) $wgUploadPath = "$wgScriptPath/images";
if ( $wgUploadDirectory === false ) $wgUploadDirectory = "$IP/images";
2011-01-14 21:42:38 +00:00
if ( $wgMathPath === false ) $wgMathPath = "{$wgUploadPath}/math";
if ( $wgMathDirectory === false ) $wgMathDirectory = "{$wgUploadDirectory}/math";
if ( $wgTmpDirectory === false ) $wgTmpDirectory = "{$wgUploadDirectory}/tmp";
2011-01-14 21:42:38 +00:00
if ( $wgReadOnlyFile === false ) $wgReadOnlyFile = "{$wgUploadDirectory}/lock_yBgMBwiR";
if ( $wgFileCacheDirectory === false ) $wgFileCacheDirectory = "{$wgUploadDirectory}/cache";
if ( $wgDeletedDirectory === false ) $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
2011-01-14 21:42:38 +00:00
if ( isset( $wgFileStore['deleted']['directory'] ) ) {
$wgDeletedDirectory = $wgFileStore['deleted']['directory'];
}
2011-01-14 21:42:38 +00:00
if ( isset( $wgFooterIcons['copyright'] ) &&
isset( $wgFooterIcons['copyright']['copyright'] ) &&
$wgFooterIcons['copyright']['copyright'] === array() )
{
if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) {
2011-01-14 21:42:38 +00:00
$wgFooterIcons['copyright']['copyright'] = $wgCopyrightIcon;
} elseif ( $wgRightsIcon || $wgRightsText ) {
2011-01-14 21:42:38 +00:00
$wgFooterIcons['copyright']['copyright'] = array(
'url' => $wgRightsUrl,
'src' => $wgRightsIcon,
'alt' => $wgRightsText,
);
} else {
2011-01-14 21:42:38 +00:00
unset( $wgFooterIcons['copyright']['copyright'] );
}
}
2011-01-14 21:42:38 +00:00
if ( isset( $wgFooterIcons['poweredby'] ) &&
isset( $wgFooterIcons['poweredby']['mediawiki'] ) &&
$wgFooterIcons['poweredby']['mediawiki']['src'] === null )
{
$wgFooterIcons['poweredby']['mediawiki']['src'] = "$wgStylePath/common/images/poweredby_mediawiki_88x31.png";
}
/**
* 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';
/**
* 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.
*/
$wgNamespaceAliases['Image'] = NS_FILE;
$wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
/**
* Initialise $wgLocalFileRepo from backwards-compatible settings
*/
if ( !$wgLocalFileRepo ) {
2011-01-14 21:42:38 +00:00
if ( isset( $wgFileStore['deleted']['hash'] ) ) {
$deletedHashLevel = $wgFileStore['deleted']['hash'];
} else {
$deletedHashLevel = $wgHashedUploadDirectory ? 3 : 0;
}
$wgLocalFileRepo = array(
'class' => 'LocalRepo',
'name' => 'local',
'directory' => $wgUploadDirectory,
'scriptDirUrl' => $wgScriptPath,
'scriptExtension' => $wgScriptExtension,
'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath,
'hashLevels' => $wgHashedUploadDirectory ? 2 : 0,
'thumbScriptUrl' => $wgThumbnailScriptPath,
'transformVia404' => !$wgGenerateThumbnailOnParse,
'deletedDir' => $wgDeletedDirectory,
'deletedHashLevels' => $deletedHashLevel
);
}
/**
* Initialise shared repo from backwards-compatible settings
*/
if ( $wgUseSharedUploads ) {
if ( $wgSharedUploadDBname ) {
$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,
2011-01-14 21:42:38 +00:00
'dbFlags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
'tablePrefix' => $wgSharedUploadDBprefix,
'hasSharedCache' => $wgCacheSharedUploads,
'descBaseUrl' => $wgRepositoryBaseUrl,
'fetchDescription' => $wgFetchCommonsDescriptions,
);
} else {
$wgForeignFileRepos[] = array(
'class' => 'FSRepo',
'name' => 'shared',
'directory' => $wgSharedUploadDirectory,
'url' => $wgSharedUploadPath,
'hashLevels' => $wgHashedSharedUploadDirectory ? 2 : 0,
'thumbScriptUrl' => $wgSharedThumbnailScriptPath,
'transformVia404' => !$wgGenerateThumbnailOnParse,
'descBaseUrl' => $wgRepositoryBaseUrl,
'fetchDescription' => $wgFetchCommonsDescriptions,
);
}
}
2011-01-14 21:42:38 +00:00
if ( $wgUseInstantCommons ) {
$wgForeignFileRepos[] = array(
'class' => 'ForeignAPIRepo',
'name' => 'wikimediacommons',
'apibase' => 'http://commons.wikimedia.org/w/api.php',
'hashLevels' => 2,
'fetchDescription' => true,
'descriptionCacheExpiry' => 43200,
'apiThumbCacheExpiry' => 86400,
);
}
if ( $wgRCFilterByAge ) {
2011-01-14 21:42:38 +00:00
# # 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 );
2011-01-14 21:42:38 +00:00
for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) {
if ( $wgRCLinkDays[$i] >= $wgRCMaxAge / ( 3600 * 24 ) ) {
$wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false );
break;
}
}
}
if ( $wgSkipSkin ) {
$wgSkipSkins[] = $wgSkipSkin;
}
# Set default shared prefix
if ( $wgSharedPrefix === false ) {
$wgSharedPrefix = $wgDBprefix;
}
if ( !$wgCookiePrefix ) {
if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
$wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
} elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
$wgCookiePrefix = $wgSharedDB;
} elseif ( $wgDBprefix ) {
$wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
} else {
$wgCookiePrefix = $wgDBname;
}
}
2011-01-14 21:42:38 +00:00
$wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' );
$wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
if ( $wgMetaNamespace === false ) {
$wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
}
# These are now the same, always
# To determine the user language, use $wgLang->getCode()
$wgContLanguageCode = $wgLanguageCode;
# 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;
}
# $wgAllowRealName and $wgAllowUserSkin were removed in 1.16
# in favor of $wgHiddenPrefs, handle b/c here
if ( !$wgAllowRealName ) {
$wgHiddenPrefs[] = 'realname';
}
if ( !$wgAllowUserSkin ) {
$wgHiddenPrefs[] = 'skin';
}
# Doesn't make sense to have if disabled.
if ( !$wgEnotifMinorEdits ) {
$wgHiddenPrefs[] = 'enotifminoredits';
}
if ( !$wgHtml5Version && $wgHtml5 && $wgAllowRdfaAttributes ) {
# see http://www.w3.org/TR/rdfa-in-html/#document-conformance
if ( $wgMimeType == 'application/xhtml+xml' ) {
$wgHtml5Version = 'XHTML+RDFa 1.0';
} else {
$wgHtml5Version = 'HTML+RDFa 1.0';
}
}
# Blacklisted file extensions shouldn't appear on the "allowed" list
$wgFileExtensions = array_diff ( $wgFileExtensions, $wgFileBlacklist );
if ( $wgInvalidateCacheOnLocalSettingsChange ) {
$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( "$IP/LocalSettings.php" ) ) );
}
if ( $wgAjaxUploadDestCheck ) {
$wgAjaxExportList[] = 'SpecialUpload::ajaxGetExistsWarning';
}
if ( $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';
}
if ( !class_exists( 'AutoLoader' ) ) {
require_once( "$IP/includes/AutoLoader.php" );
}
2006-06-08 13:27:11 +00:00
2011-01-14 21:42:38 +00:00
wfProfileIn( $fname . '-exception' );
require_once( "$IP/includes/Exception.php" );
wfInstallExceptionHandler();
2011-01-14 21:42:38 +00:00
wfProfileOut( $fname . '-exception' );
2011-01-14 21:42:38 +00:00
wfProfileIn( $fname . '-includes' );
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/ImageFunctions.php" );
2011-01-14 21:42:38 +00:00
wfProfileOut( $fname . '-includes' );
wfProfileIn( $fname . '-misc1' );
# Raise the memory limit if it's too low
wfMemoryLimit();
Merged localisation-work branch: * Made lines from initialiseMessages() appear as list items during installation * Moved the bulk of the localisation data from the Language*.php files to the Messages*.php files. Deleted most of the Languages*.php files. * Introduced "stub global" framework to provide deferred initialisation of core modules. * Removed placeholder values for $wgTitle and $wgArticle, these variables will now be null during the initialisation process, until they are set by index.php or another entry point. * Added DBA cache type, for BDB-style caches. * Removed custom date format functions, replacing them with a format string in the style of PHP's date(). Used string identifiers instead of integer identifiers, in both the language files and user preferences. Migration should be transparent in most cases. * Simplified the initialisation API for LoadBalancer objects. * Removed the broken altencoding feature. * Moved default user options and toggles from Language to User. Language objects are still able to define default preference overrides and extra user toggles, via a slightly different interface. * Don't include the date option in the parser cache rendering hash unless $wgUseDynamicDates is enabled. * Merged LanguageUtf8 with Language. Removed LanguageUtf8.php. * Removed inclusion of language files from the bottom of Language.php. This is now consistently done from Language::factory(). * Add the name of the executing maintenance script to the debug log. Start the profiler during maintenance scripts. * Added "serialized" directory, for storing precompiled data in serialized form.
2006-07-26 07:15:39 +00:00
/**
* Set up the timezone, suppressing the pseudo-security warning in PHP 5.1+
* that happens whenever you use a date function without the timezone being
* explicitly set. Inspired by phpMyAdmin's treatment of the problem.
*/
wfSuppressWarnings();
date_default_timezone_set( date_default_timezone_get() );
wfRestoreWarnings();
Merged localisation-work branch: * Made lines from initialiseMessages() appear as list items during installation * Moved the bulk of the localisation data from the Language*.php files to the Messages*.php files. Deleted most of the Languages*.php files. * Introduced "stub global" framework to provide deferred initialisation of core modules. * Removed placeholder values for $wgTitle and $wgArticle, these variables will now be null during the initialisation process, until they are set by index.php or another entry point. * Added DBA cache type, for BDB-style caches. * Removed custom date format functions, replacing them with a format string in the style of PHP's date(). Used string identifiers instead of integer identifiers, in both the language files and user preferences. Migration should be transparent in most cases. * Simplified the initialisation API for LoadBalancer objects. * Removed the broken altencoding feature. * Moved default user options and toggles from Language to User. Language objects are still able to define default preference overrides and extra user toggles, via a slightly different interface. * Don't include the date option in the parser cache rendering hash unless $wgUseDynamicDates is enabled. * Merged LanguageUtf8 with Language. Removed LanguageUtf8.php. * Removed inclusion of language files from the bottom of Language.php. This is now consistently done from Language::factory(). * Add the name of the executing maintenance script to the debug log. Start the profiler during maintenance scripts. * Added "serialized" directory, for storing precompiled data in serialized form.
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
# Useful debug output
global $wgCommandLineMode;
if ( $wgCommandLineMode ) {
Merged localisation-work branch: * Made lines from initialiseMessages() appear as list items during installation * Moved the bulk of the localisation data from the Language*.php files to the Messages*.php files. Deleted most of the Languages*.php files. * Introduced "stub global" framework to provide deferred initialisation of core modules. * Removed placeholder values for $wgTitle and $wgArticle, these variables will now be null during the initialisation process, until they are set by index.php or another entry point. * Added DBA cache type, for BDB-style caches. * Removed custom date format functions, replacing them with a format string in the style of PHP's date(). Used string identifiers instead of integer identifiers, in both the language files and user preferences. Migration should be transparent in most cases. * Simplified the initialisation API for LoadBalancer objects. * Removed the broken altencoding feature. * Moved default user options and toggles from Language to User. Language objects are still able to define default preference overrides and extra user toggles, via a slightly different interface. * Don't include the date option in the parser cache rendering hash unless $wgUseDynamicDates is enabled. * Merged LanguageUtf8 with Language. Removed LanguageUtf8.php. * Removed inclusion of language files from the bottom of Language.php. This is now consistently done from Language::factory(). * Add the name of the executing maintenance script to the debug log. Start the profiler during maintenance scripts. * Added "serialized" directory, for storing precompiled data in serialized form.
2006-07-26 07:15:39 +00:00
wfDebug( "\n\nStart command line script $self\n" );
} else {
$debug = "Start request\n\n{$_SERVER['REQUEST_METHOD']} {$wgRequest->getRequestURL()}";
if ( $wgDebugPrintHttpHeaders ) {
$debug .= "\nHTTP HEADERS:\n";
foreach ( $wgRequest->getAllHeaders() as $name => $value ) {
$debug .= "$name: $value\n";
}
}
wfDebug( "$debug\n" );
}
2011-01-14 21:42:38 +00:00
wfProfileOut( $fname . '-misc1' );
wfProfileIn( $fname . '-memcached' );
* Rewrote ObjectCache.php to conform to the modern coding style, and to be less convoluted about how CACHE_ANYTHING and CACHE_ACCEL are resolved. Moved most functionality to static members of a new ObjectCache class. * Moved the global functions to GlobalFunctions.php, where they are now just convenience wrappers. Made them return non-references. Updated callers (none found in extensions). * Added an advanced configuration method, $wgObjectCaches, which allows a lot more detail in the object cache configuration than $wgMainCacheType. * Made all object cache classes derive from BagOStuff. * Split the MWMemcached class into a generic client class and a MediaWiki-specific wrapper class. The wrapper class presents a simple BagOStuff interface to calling code, hiding memcached client internals, and will simplify the task of supporting the PECL extension. * Added some extra constructor parameters to MWMemcached, configurable via $wgObjectCaches. * Removed the *_multi() methods from BagOStuff, my grepping indicates that they are not used. * Rewrote FakeMemCachedClient as a BagOStuff subclass, called EmptyBagOStuff. * Added an optional "server" parameter to SQLBagOStuff. This allows the server holding the objectcache table to be different from the server holding the core DB. * Added MultiWriteBagOStuff: a cache class which writes to multiple locations, and reads from them in a defined fallback sequence. This can be used to extend the cache space by adding disk-backed storage to existing in-memory caches. * Made MWMemcached::get() return false on failure instead of null, to match the BagOStuff documentation and the other BagOStuff subclasses. Anything that was relying on it returning null would have already been broken with SqlBagOStuff. * Fixed a bug in the memcached client causing keys with spaces or line breaks in them to break the memcached protocol, injecting arbitrary commands or parameters. Since the PECL client apparently also has this flaw, I implemented the fix in the wrapper class. * Renamed BagOStuff::set_debug() to setDebug(), since we aren't emulating the memcached client anymore * Fixed spelling error in MWMemcached: persistant -> persistent
2011-03-03 09:37:37 +00:00
$wgMemc = wfGetMainCache();
$messageMemc = wfGetMessageCacheStorage();
$parserMemc = wfGetParserCacheStorage();
wfDebug( 'CACHES: ' . get_class( $wgMemc ) . '[main] ' .
get_class( $messageMemc ) . '[message] ' .
get_class( $parserMemc ) . "[parser]\n" );
2003-11-21 02:43:12 +00:00
2011-01-14 21:42:38 +00:00
wfProfileOut( $fname . '-memcached' );
2011-01-14 21:42:38 +00:00
# # Most of the config is out, some might want to run hooks here.
wfRunHooks( 'SetupAfterCache' );
2011-01-14 21:42:38 +00:00
wfProfileIn( $fname . '-session' );
# If session.auto_start is there, we can't touch session name
if ( !wfIniGetBool( 'session.auto_start' ) ) {
session_name( $wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session' );
}
2011-01-14 21:42:38 +00:00
if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
if ( $wgRequest->checkSessionCookie() || isset( $_COOKIE[$wgCookiePrefix . 'Token'] ) ) {
wfIncrStats( 'request_with_session' );
wfSetupSession();
$wgSessionStarted = true;
} else {
wfIncrStats( 'request_without_session' );
$wgSessionStarted = false;
}
}
2011-01-14 21:42:38 +00:00
wfProfileOut( $fname . '-session' );
wfProfileIn( $fname . '-globals' );
Merged localisation-work branch: * Made lines from initialiseMessages() appear as list items during installation * Moved the bulk of the localisation data from the Language*.php files to the Messages*.php files. Deleted most of the Languages*.php files. * Introduced "stub global" framework to provide deferred initialisation of core modules. * Removed placeholder values for $wgTitle and $wgArticle, these variables will now be null during the initialisation process, until they are set by index.php or another entry point. * Added DBA cache type, for BDB-style caches. * Removed custom date format functions, replacing them with a format string in the style of PHP's date(). Used string identifiers instead of integer identifiers, in both the language files and user preferences. Migration should be transparent in most cases. * Simplified the initialisation API for LoadBalancer objects. * Removed the broken altencoding feature. * Moved default user options and toggles from Language to User. Language objects are still able to define default preference overrides and extra user toggles, via a slightly different interface. * Don't include the date option in the parser cache rendering hash unless $wgUseDynamicDates is enabled. * Merged LanguageUtf8 with Language. Removed LanguageUtf8.php. * Removed inclusion of language files from the bottom of Language.php. This is now consistently done from Language::factory(). * Add the name of the executing maintenance script to the debug log. Start the profiler during maintenance scripts. * Added "serialized" directory, for storing precompiled data in serialized form.
2006-07-26 07:15:39 +00:00
$wgContLang = new StubContLang;
// Now that variant lists may be available...
$wgRequest->interpolateTitle();
$wgUser = $wgCommandLineMode ? new User : User::newFromSession();
Merged localisation-work branch: * Made lines from initialiseMessages() appear as list items during installation * Moved the bulk of the localisation data from the Language*.php files to the Messages*.php files. Deleted most of the Languages*.php files. * Introduced "stub global" framework to provide deferred initialisation of core modules. * Removed placeholder values for $wgTitle and $wgArticle, these variables will now be null during the initialisation process, until they are set by index.php or another entry point. * Added DBA cache type, for BDB-style caches. * Removed custom date format functions, replacing them with a format string in the style of PHP's date(). Used string identifiers instead of integer identifiers, in both the language files and user preferences. Migration should be transparent in most cases. * Simplified the initialisation API for LoadBalancer objects. * Removed the broken altencoding feature. * Moved default user options and toggles from Language to User. Language objects are still able to define default preference overrides and extra user toggles, via a slightly different interface. * Don't include the date option in the parser cache rendering hash unless $wgUseDynamicDates is enabled. * Merged LanguageUtf8 with Language. Removed LanguageUtf8.php. * Removed inclusion of language files from the bottom of Language.php. This is now consistently done from Language::factory(). * Add the name of the executing maintenance script to the debug log. Start the profiler during maintenance scripts. * Added "serialized" directory, for storing precompiled data in serialized form.
2006-07-26 07:15:39 +00:00
$wgLang = new StubUserLang;
$wgOut = new StubObject( 'wgOut', 'OutputPage' );
$wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
2011-01-14 21:42:38 +00:00
if ( !is_object( $wgAuth ) ) {
Merged localisation-work branch: * Made lines from initialiseMessages() appear as list items during installation * Moved the bulk of the localisation data from the Language*.php files to the Messages*.php files. Deleted most of the Languages*.php files. * Introduced "stub global" framework to provide deferred initialisation of core modules. * Removed placeholder values for $wgTitle and $wgArticle, these variables will now be null during the initialisation process, until they are set by index.php or another entry point. * Added DBA cache type, for BDB-style caches. * Removed custom date format functions, replacing them with a format string in the style of PHP's date(). Used string identifiers instead of integer identifiers, in both the language files and user preferences. Migration should be transparent in most cases. * Simplified the initialisation API for LoadBalancer objects. * Removed the broken altencoding feature. * Moved default user options and toggles from Language to User. Language objects are still able to define default preference overrides and extra user toggles, via a slightly different interface. * Don't include the date option in the parser cache rendering hash unless $wgUseDynamicDates is enabled. * Merged LanguageUtf8 with Language. Removed LanguageUtf8.php. * Removed inclusion of language files from the bottom of Language.php. This is now consistently done from Language::factory(). * Add the name of the executing maintenance script to the debug log. Start the profiler during maintenance scripts. * Added "serialized" directory, for storing precompiled data in serialized form.
2006-07-26 07:15:39 +00:00
$wgAuth = new StubObject( 'wgAuth', 'AuthPlugin' );
wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
}
# Placeholders in case of DB error
Merged localisation-work branch: * Made lines from initialiseMessages() appear as list items during installation * Moved the bulk of the localisation data from the Language*.php files to the Messages*.php files. Deleted most of the Languages*.php files. * Introduced "stub global" framework to provide deferred initialisation of core modules. * Removed placeholder values for $wgTitle and $wgArticle, these variables will now be null during the initialisation process, until they are set by index.php or another entry point. * Added DBA cache type, for BDB-style caches. * Removed custom date format functions, replacing them with a format string in the style of PHP's date(). Used string identifiers instead of integer identifiers, in both the language files and user preferences. Migration should be transparent in most cases. * Simplified the initialisation API for LoadBalancer objects. * Removed the broken altencoding feature. * Moved default user options and toggles from Language to User. Language objects are still able to define default preference overrides and extra user toggles, via a slightly different interface. * Don't include the date option in the parser cache rendering hash unless $wgUseDynamicDates is enabled. * Merged LanguageUtf8 with Language. Removed LanguageUtf8.php. * Removed inclusion of language files from the bottom of Language.php. This is now consistently done from Language::factory(). * Add the name of the executing maintenance script to the debug log. Start the profiler during maintenance scripts. * Added "serialized" directory, for storing precompiled data in serialized form.
2006-07-26 07:15:39 +00:00
$wgTitle = null;
$wgArticle = null;
$wgDeferredUpdateList = array();
2011-01-14 21:42:38 +00:00
wfProfileOut( $fname . '-globals' );
wfProfileIn( $fname . '-extensions' );
2004-06-04 02:44:58 +00:00
# Skin setup functions
# Entries can be added to this variable during the inclusion
# of the extension file. Skins can then perform any necessary initialisation.
foreach ( $wgSkinExtensionFunctions as $func ) {
call_user_func( $func );
}
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
# any necessary initialisation in the fully initialised environment
foreach ( $wgExtensionFunctions as $func ) {
# Allow closures in PHP 5.3+
if ( is_object( $func ) && $func instanceof Closure ) {
2011-01-14 21:42:38 +00:00
$profName = $fname . '-extensions-closure';
} elseif ( is_array( $func ) ) {
if ( is_object( $func[0] ) )
2011-01-14 21:42:38 +00:00
$profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1];
else
2011-01-14 21:42:38 +00:00
$profName = $fname . '-extensions-' . implode( '::', $func );
} else {
2011-01-14 21:42:38 +00:00
$profName = $fname . '-extensions-' . strval( $func );
}
wfProfileIn( $profName );
call_user_func( $func );
wfProfileOut( $profName );
}
// For compatibility
wfRunHooks( 'LogPageValidTypes', array( &$wgLogTypes ) );
wfRunHooks( 'LogPageLogName', array( &$wgLogNames ) );
wfRunHooks( 'LogPageLogHeader', array( &$wgLogHeaders ) );
wfRunHooks( 'LogPageActionText', array( &$wgLogActions ) );
Merged localisation-work branch: * Made lines from initialiseMessages() appear as list items during installation * Moved the bulk of the localisation data from the Language*.php files to the Messages*.php files. Deleted most of the Languages*.php files. * Introduced "stub global" framework to provide deferred initialisation of core modules. * Removed placeholder values for $wgTitle and $wgArticle, these variables will now be null during the initialisation process, until they are set by index.php or another entry point. * Added DBA cache type, for BDB-style caches. * Removed custom date format functions, replacing them with a format string in the style of PHP's date(). Used string identifiers instead of integer identifiers, in both the language files and user preferences. Migration should be transparent in most cases. * Simplified the initialisation API for LoadBalancer objects. * Removed the broken altencoding feature. * Moved default user options and toggles from Language to User. Language objects are still able to define default preference overrides and extra user toggles, via a slightly different interface. * Don't include the date option in the parser cache rendering hash unless $wgUseDynamicDates is enabled. * Merged LanguageUtf8 with Language. Removed LanguageUtf8.php. * Removed inclusion of language files from the bottom of Language.php. This is now consistently done from Language::factory(). * Add the name of the executing maintenance script to the debug log. Start the profiler during maintenance scripts. * Added "serialized" directory, for storing precompiled data in serialized form.
2006-07-26 07:15:39 +00:00
wfDebug( "Fully initialised\n" );
$wgFullyInitialised = true;
2011-01-14 21:42:38 +00:00
wfProfileOut( $fname . '-extensions' );
wfProfileOut( $fname );