Fix fixme on r107328, attempting to use $this in a static method
[lhc/web/wiklou.git] / includes / Setup.php
index afde02f..724e868 100644 (file)
@@ -114,6 +114,19 @@ $wgNamespaceProtection[NS_MEDIAWIKI] = 'editinterface';
 $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
  */
@@ -163,7 +176,7 @@ if ( $wgUseSharedUploads ) {
                );
        } else {
                $wgForeignFileRepos[] = array(
-                       'class' => 'FSRepo',
+                       'class' => 'FileRepo',
                        'name' => 'shared',
                        'directory' => $wgSharedUploadDirectory,
                        'url' => $wgSharedUploadPath,
@@ -179,13 +192,29 @@ if ( $wgUseInstantCommons ) {
        $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
@@ -328,6 +357,8 @@ 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" );
@@ -392,6 +423,7 @@ if ( $wgCommandLineMode ) {
                }
        }
        wfDebug( "$debug\n" );
+       MWDebug::processRequest( $wgRequest );
 }
 
 wfProfileOut( $fname . '-misc1' );