$wgActionPaths['view'] = $wgArticlePath;
}
+if ( !empty($wgActionPaths) && !isset($wgActionPaths['view']) ) {
+ # 'view' is assumed the default action path everywhere in the code
+ # but is rarely filled in $wgActionPaths
+ $wgActionPaths['view'] = $wgArticlePath ;
+}
+
if ( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins";
if ( $wgLocalStylePath === false ) $wgLocalStylePath = "$wgScriptPath/skins";
if ( $wgStyleDirectory === false ) $wgStyleDirectory = "$IP/skins";
$wgNamespaceAliases['Image'] = NS_FILE;
$wgNamespaceAliases['Image_talk'] = NS_FILE_TALK;
+/**
+ * Initialise $wgLockManagers to include basic FS version
+ */
+$wgLockManagers[] = array(
+ 'name' => 'fsLockManager',
+ 'class' => 'FSLockManager',
+ 'lockDirectory' => "{$wgUploadDirectory}/lockdir",
+);
+$wgLockManagers[] = array(
+ 'name' => 'nullLockManager',
+ 'class' => 'NullLockManager',
+);
+
/**
* Initialise $wgLocalFileRepo from backwards-compatible settings
*/
);
} else {
$wgForeignFileRepos[] = array(
- 'class' => 'FSRepo',
+ 'class' => 'FileRepo',
'name' => 'shared',
'directory' => $wgSharedUploadDirectory,
'url' => $wgSharedUploadPath,
$wgForeignFileRepos[] = array(
'class' => 'ForeignAPIRepo',
'name' => 'wikimediacommons',
- 'apibase' => 'http://commons.wikimedia.org/w/api.php',
+ 'apibase' => '//commons.wikimedia.org/w/api.php',
'hashLevels' => 2,
'fetchDescription' => true,
'descriptionCacheExpiry' => 43200,
'apiThumbCacheExpiry' => 86400,
);
}
+/*
+ * Add on default file backend config for file repos.
+ * FileBackendGroup will handle initializing the backends.
+ */
+if ( !isset( $wgLocalFileRepo['backend'] ) ) {
+ $wgLocalFileRepo['backend'] = $wgLocalFileRepo['name'] . '-backend';
+}
+foreach ( $wgForeignFileRepos as &$repo ) {
+ if ( !isset( $repo['directory'] ) && $repo['class'] === 'ForeignAPIRepo' ) {
+ $repo['directory'] = $wgUploadDirectory; // b/c
+ }
+ if ( !isset( $repo['backend'] ) ) {
+ $repo['backend'] = $repo['name'] . '-backend';
+ }
+}
+unset( $repo ); // no global pollution; destroy reference
+
+if ( is_null( $wgEnableAutoRotation ) ) {
+ // Only enable auto-rotation when the bitmap handler can rotate
+ $wgEnableAutoRotation = BitmapHandler::canRotate();
+}
if ( $wgRCFilterByAge ) {
# # Trim down $wgRCLinkDays so that it only lists links which are valid
$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';
+ # newusers, create, create2, autocreate
+ $wgLogActionsHandlers['newusers/*'] = 'NewUsersLogFormatter';
+}
+
+if ( $wgCookieSecure === 'detect' ) {
+ $wgCookieSecure = ( substr( $wgServer, 0, 6 ) === 'https:' );
}
+MWDebug::init();
+
if ( !defined( 'MW_COMPILED' ) ) {
if ( !MWInit::classExists( 'AutoLoader' ) ) {
require_once( "$IP/includes/AutoLoader.php" );
}
wfProfileIn( $fname . '-exception' );
- require_once( "$IP/includes/Exception.php" );
- wfInstallExceptionHandler();
+ MWExceptionHandler::installHandler();
wfProfileOut( $fname . '-exception' );
wfProfileIn( $fname . '-includes' );
require_once( "$IP/includes/normal/UtfNormalUtil.php" );
require_once( "$IP/includes/GlobalFunctions.php" );
- require_once( "$IP/includes/Hooks.php" );
require_once( "$IP/includes/ProxyTools.php" );
require_once( "$IP/includes/ImageFunctions.php" );
+ require_once( "$IP/includes/normal/UtfNormalDefines.php" );
wfProfileOut( $fname . '-includes' );
}
-require_once( MWInit::compiledPath( 'includes/normal/UtfNormalDefines.php' ) );
+
+# Now that GlobalFunctions is loaded, set the default for $wgCanonicalServer
+if ( $wgCanonicalServer === false ) {
+ $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
+}
wfProfileIn( $fname . '-misc1' );
$wgLocalTZoffset = date( 'Z' ) / 60;
}
-# Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
-$wgRequest = new WebRequest;
-
# Useful debug output
global $wgCommandLineMode;
if ( $wgCommandLineMode ) {
+ $wgRequest = new FauxRequest( array() );
+
wfDebug( "\n\nStart command line script $self\n" );
} else {
+ # Can't stub this one, it sets up $_GET and $_REQUEST in its constructor
+ $wgRequest = new WebRequest;
+
$debug = "Start request\n\n{$_SERVER['REQUEST_METHOD']} {$wgRequest->getRequestURL()}";
if ( $wgDebugPrintHttpHeaders ) {
}
}
wfDebug( "$debug\n" );
+ MWDebug::processRequest( $wgRequest );
}
wfProfileOut( $fname . '-misc1' );
# Placeholders in case of DB error
$wgTitle = null;
-$wgArticle = null;
$wgDeferredUpdateList = array();
-// We need to check for safe_mode, because mail() willl throws an E_NOTICE
+// We need to check for safe_mode, because mail() will throw an E_NOTICE
// on additional parameters
-if( !is_null($wgAdditionalMailParams) && wgIniGetBool('safe_mode') ) {
+if( !is_null($wgAdditionalMailParams) && wfIniGetBool('safe_mode') ) {
$wgAdditionalMailParams = null;
}