(part of bug 6100) Set the directionality based on user language instead of content...
[lhc/web/wiklou.git] / includes / DefaultSettings.php
index 7bc56f8..b41a7f5 100644 (file)
@@ -26,10 +26,9 @@ if( !defined( 'MEDIAWIKI' ) ) {
        die( 1 );
 }
 
-# Create a site configuration object. Not used for much in a default install
-if ( !defined( 'MW_COMPILED' ) ) {
-       require_once( "$IP/includes/SiteConfiguration.php" );
-}
+# Create a site configuration object. Not used for much in a default install.
+# Note: this (and other things) will break if the autoloader is not enabled. 
+# Please include includes/AutoLoader.php before including this file.
 $wgConf = new SiteConfiguration;
 /** @endcond */
 
@@ -51,38 +50,7 @@ $wgSitename         = 'MediaWiki';
  * wrong server, it will redirect incorrectly after you save a page. In that
  * case, set this variable to fix it.
  */
-$wgServer = '';
-
-/** @cond file_level_code */
-if( isset( $_SERVER['SERVER_NAME'] )
-       # additionially, for requests made directly to an IPv6 address we have
-       # to make sure the server enclose it in either [] or nothing at all
-       && (strpos($_SERVER['SERVER_NAME'], '[')
-           xor strpos( $_SERVER['SERVER_NAME'], ']'))
-       ) {
-       $serverName = $_SERVER['SERVER_NAME'];
-} elseif( isset( $_SERVER['HOSTNAME'] ) ) {
-       $serverName = $_SERVER['HOSTNAME'];
-} elseif( isset( $_SERVER['HTTP_HOST'] ) ) {
-       $serverName = $_SERVER['HTTP_HOST'];
-} elseif( isset( $_SERVER['SERVER_ADDR'] ) ) {
-       $serverName = $_SERVER['SERVER_ADDR'];
-} else {
-       $serverName = 'localhost';
-}
-
-$wgProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
-
-$wgServer = $wgProto.'://' . $serverName;
-# If the port is a non-standard one, add it to the URL
-if(    isset( $_SERVER['SERVER_PORT'] )
-       && !strpos( $serverName, ':' )
-       && (    ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 )
-        || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) {
-
-       $wgServer .= ":" . $_SERVER['SERVER_PORT'];
-}
-/** @endcond */
+$wgServer = WebRequest::detectServer();
 
 /************************************************************************//**
  * @name   Script path settings
@@ -316,7 +284,7 @@ $wgImgAuthPublicTest = true;
  *   - class            The class name for the repository. May come from the core or an extension.
  *                      The core repository classes are LocalRepo, ForeignDBRepo, FSRepo.
  *
- *   - name                A unique name for the repository.
+ *   - name                A unique name for the repository (but $wgLocalFileRepo should be 'local').
  *
  * For most core repos:
  *   - url              Base public URL
@@ -434,7 +402,7 @@ $wgCacheSharedUploads = true;
 $wgAllowCopyUploads = false;
 /**
  * Allow asynchronous copy uploads.
- * This feature is experimental is broken as of r81612.
+ * This feature is experimental and broken as of r81612.
  */
 $wgAllowAsyncCopyUploads = false;
 
@@ -552,8 +520,8 @@ $wgMimeTypeBlacklist = array(
 
 /**
  * Allow Java archive uploads.
- * This is not recommended for public wikis since a maliciously-constructed 
- * applet running on the same domain as the wiki can steal the user's cookies. 
+ * This is not recommended for public wikis since a maliciously-constructed
+ * applet running on the same domain as the wiki can steal the user's cookies.
  */
 $wgAllowJavaUploads = false;
 
@@ -676,7 +644,7 @@ $wgSVGConverterPath = '';
 $wgSVGMaxSize = 2048;
 /** Don't read SVG metadata beyond this point.
  * Default is 1024*256 bytes */
-$wgSVGMetadataCutoff = 262144; 
+$wgSVGMetadataCutoff = 262144;
 
 /**
  * MediaWiki will reject HTMLesque tags in uploaded files due to idiotic browsers which can't
@@ -988,6 +956,8 @@ $wgDjvuOutputExtension = 'jpg';
  * @{
  */
 
+$serverName = substr( $wgServer, strrpos( $wgServer, '/' ) + 1 );
+
 /**
  * Site admin email address.
  */
@@ -1483,7 +1453,7 @@ $wgCacheDirectory = false;
  *   - CACHE_DBA:        Use PHP's DBA extension to store in a DBM-style
  *                       database. This is slow, and is not recommended for
  *                       anything other than debugging.
- *   - (other):          A string may be used which identifies a cache 
+ *   - (other):          A string may be used which identifies a cache
  *                       configuration in $wgObjectCaches.
  *
  * @see $wgMessageCacheType, $wgParserCacheType
@@ -1509,13 +1479,13 @@ $wgParserCacheType = CACHE_ANYTHING;
 /**
  * Advanced object cache configuration.
  *
- * Use this to define the class names and constructor parameters which are used 
- * for the various cache types. Custom cache types may be defined here and 
+ * Use this to define the class names and constructor parameters which are used
+ * for the various cache types. Custom cache types may be defined here and
  * referenced from $wgMainCacheType, $wgMessageCacheType or $wgParserCacheType.
  *
- * The format is an associative array where the key is a cache identifier, and 
+ * The format is an associative array where the key is a cache identifier, and
  * the value is an associative array of parameters. The "class" parameter is the
- * class name which will be used. Alternatively, a "factory" parameter may be 
+ * class name which will be used. Alternatively, a "factory" parameter may be
  * given, giving a callable function which will generate a suitable cache object.
  *
  * The other parameters are dependent on the class used.
@@ -1534,6 +1504,7 @@ $wgObjectCaches = array(
        'xcache' => array( 'class' => 'XCacheBagOStuff' ),
        'wincache' => array( 'class' => 'WinCacheBagOStuff' ),
        'memcached-php' => array( 'class' => 'MemcachedPhpBagOStuff' ),
+       'hash' => array( 'class' => 'HashBagOStuff' ),
 );
 
 /**
@@ -1867,6 +1838,7 @@ $wgDummyLanguageCodes = array(
        'iu',
        'nb',
        'qqq',
+       'roa-rup',
        'simple',
 );
 
@@ -2109,17 +2081,7 @@ $wgLocaltimezone = null;
  * This setting is used for most date/time displays in the software, and is
  * overrideable in user preferences. It is *not* used for signature timestamps.
  *
- * You can set it to match the configured server timezone like this:
- *   $wgLocalTZoffset = date("Z") / 60;
- *
- * If your server is not configured for the timezone you want, you can set
- * this in conjunction with the signature timezone and override the PHP default
- * timezone like so:
- *   $wgLocaltimezone="Europe/Berlin";
- *   date_default_timezone_set( $wgLocaltimezone );
- *   $wgLocalTZoffset = date("Z") / 60;
- *
- * Leave at NULL to show times in universal time (UTC/GMT).
+ * By default, this will be set to match $wgLocaltimezone.
  */
 $wgLocalTZoffset = null;
 
@@ -2526,6 +2488,19 @@ $wgResourceLoaderMinifierMaxLineLength = 1000;
  */
 $wgIncludeLegacyJavaScript = true;
 
+/**
+ * Whether or not to assing configuration variables to the global window object.
+ * If this is set to false, old code using deprecated variables like:
+ * " if ( window.wgRestrictionEdit ) ..."
+ * or:
+ * " if ( wgIsArticle ) ..."
+ * will no longer work and needs to use mw.config instead. For example:
+ * " if ( mw.config.exists('wgRestrictionEdit') )"
+ * or
+ * " if ( mw.config.get('wgIsArticle') )".
+ */
+$wgLegacyJavaScriptGlobals = true;
+
 /**
  * If set to a positive number, ResourceLoader will not generate URLs whose
  * query string is more than this many characters long, and will instead use
@@ -2794,6 +2769,7 @@ $wgUrlProtocols = array(
        'https://',
        'ftp://',
        'irc://',
+       'ircs://',  // @bug 28503
        'gopher://',
        'telnet://', // Well if we're going to support the above.. -ævar
        'nntp://', // @bug 3808 RFC 1738
@@ -2936,6 +2912,7 @@ $wgExpensiveParserFunctionLimit = 100;
 
 /**
  * Preprocessor caching threshold
+ * Setting it to 'false' will disable the preprocessor cache.
  */
 $wgPreprocessorCacheThreshold = 1000;
 
@@ -2957,14 +2934,30 @@ $wgTranscludeCacheExpiry = 3600;
  */
 
 /**
- * Under which condition should a page in the main namespace be counted
- * as a valid article? If $wgUseCommaCount is set to true, it will be
- * counted if it contains at least one comma. If it is set to false
- * (default), it will only be counted if it contains at least one [[wiki
- * link]]. See http://www.mediawiki.org/wiki/Manual:Article_count
+ * Method used to determine if a page in a content namespace should be counted
+ * as a valid article.
+ *
+ * Redirect pages will never be counted as valid articles.
+ *
+ * This variable can have the following values:
+ * - 'any': all pages as considered as valid articles
+ * - 'comma': the page must contain a comma to be considered valid
+ * - 'link': the page must contain a [[wiki link]] to be considered valid
+ * - null: the value will be set at run time depending on $wgUseCommaCount:
+ *         if $wgUseCommaCount is false, it will be 'link', if it is true
+ *         it will be 'comma'
+ *
+ * See also See http://www.mediawiki.org/wiki/Manual:Article_count
  *
- * Retroactively changing this variable will not affect
- * the existing count (cf. maintenance/recount.sql).
+ * Retroactively changing this variable will not affect the existing count,
+ * to update it, you will need to run the maintenance/updateArticleCount.php
+ * script.
+ */
+$wgArticleCountMethod = null;
+
+/**
+ * Backward compatibility setting, will set $wgArticleCountMethod if it is null.
+ * @deprecated since 1.19; use $wgArticleCountMethod instead
  */
 $wgUseCommaCount = false;
 
@@ -3117,7 +3110,7 @@ $wgDefaultUserOptions = array(
 
 /**
  * Whether or not to allow and use real name fields.
- * @deprecated in 1.16, use $wgHiddenPrefs[] = 'realname' below to disable real
+ * @deprecated since 1.16, use $wgHiddenPrefs[] = 'realname' below to disable real
  * names
  */
 $wgAllowRealName = true;
@@ -3723,13 +3716,34 @@ $wgCookieExpiration = 30*86400;
  * or ".any.subdomain.net"
  */
 $wgCookieDomain = '';
+
+
+/**
+ * Set this variable if you want to restrict cookies to a certain path within 
+ * the domain specified by $wgCookieDomain.
+ */
 $wgCookiePath = '/';
-$wgCookieSecure = ($wgProto == 'https');
+
+/**
+ * Whether the "secure" flag should be set on the cookie. This can be:
+ *   - true:      Set secure flag
+ *   - false:     Don't set secure flag
+ *   - "detect":  Set the secure flag if $wgServer is set to an HTTPS URL
+ */
+$wgCookieSecure = 'detect';
+
+/**
+ * By default, MediaWiki checks if the client supports cookies during the 
+ * login process, so that it can display an informative error message if 
+ * cookies are disabled. Set this to true if you want to disable this cookie
+ * check.
+ */
 $wgDisableCookieCheck = false;
 
 /**
- * Set $wgCookiePrefix to use a custom one. Setting to false sets the default of
- * using the database name.
+ * Cookies generated by MediaWiki have names starting with this prefix. Set it
+ * to a string to use a custom prefix. Setting it to false causes the database
+ * name to be used as a prefix.
  */
 $wgCookiePrefix = false;
 
@@ -3802,7 +3816,7 @@ $wgDebugLogPrefix       = '';
 $wgDebugRedirects              = false;
 
 /**
- * If true, log debugging data from action=raw.
+ * If true, log debugging data from action=raw and load.php.
  * This is normally false to avoid overlapping debug entries due to gen=css and
  * gen=js requests.
  */
@@ -3926,7 +3940,7 @@ $wgDebugProfiling = false;
 /** Output debug message on every wfProfileIn/wfProfileOut */
 $wgDebugFunctionEntry = 0;
 
-/*
+/**
  * Destination for wfIncrStats() data...
  * 'cache' to go into the system cache, if enabled (memcached)
  * 'udp' to be sent to the UDP profiler (see $wgUDPProfilerHost)
@@ -3935,7 +3949,7 @@ $wgDebugFunctionEntry = 0;
 $wgStatsMethod = 'cache';
 
 /**
- * When $wgStatsMethod is 'udp', setting this to a string allows statistics to 
+ * When $wgStatsMethod is 'udp', setting this to a string allows statistics to
  * be aggregated over more than one wiki. The string will be used in place of
  * the DB name in outgoing UDP packets. If this is set to false, the DB name
  * will be used.
@@ -4385,10 +4399,6 @@ $wgUseTagFilter = true;
  * @{
  */
 
-/** RDF metadata toggles */
-$wgEnableDublinCoreRdf = false;
-$wgEnableCreativeCommonsRdf = false;
-
 /** Override for copyright metadata.
  * TODO: these options need documentation
  */
@@ -4411,10 +4421,6 @@ $wgCopyrightIcon = null;
 /** Set this to true if you want detailed copyright information forms on Upload. */
 $wgUseCopyrightUpload = false;
 
-/** Set this to false if you want to disable checking that detailed copyright
- * information values are not empty. */
-$wgCheckCopyrightUpload = true;
-
 /**
  * Set this to the number of authors that you want to be credited below an
  * article text. Set it to zero to hide the attribution block, and a negative
@@ -4618,15 +4624,15 @@ $wgJobClasses = array(
 );
 
 /**
- * Extensions of "thumbnails" that are very expensive to regenerate and should be 
- * excluded from normal action=purge thumbnail removal. 
+ * Extensions of "thumbnails" that are very expensive to regenerate and should be
+ * excluded from normal action=purge thumbnail removal.
  */
 $wgExcludeFromThumbnailPurge = array();
 
 /**
 
  * Jobs that must be explicitly requested, i.e. aren't run by job runners unless special flags are set.
- * 
+ *
  * These can be:
  * - Very long-running jobs.
  * - Jobs that you would never want to run as part of a page rendering request.
@@ -5013,13 +5019,16 @@ $wgMaxRedirectLinksRetrieved = 500;
  */
 $wgActions = array(
        'credits' => true,
+       'deletetrackback' => true,
+       'markpatrolled' => true,
        'purge' => true,
+       'revisiondelete' => true,
        'unwatch' => true,
        'watch' => true,
 );
 
 /**
- * Array of disabled article actions, e.g. view, edit, dublincore, delete, etc.
+ * Array of disabled article actions, e.g. view, edit, delete, etc.
  * @deprecated since 1.18; just set $wgActions['action'] = false instead
  */
 $wgDisabledActions = array();
@@ -5159,7 +5168,7 @@ $wgUseAjax = true;
  * List of Ajax-callable functions.
  * Extensions acting as Ajax callbacks must register here
  */
-$wgAjaxExportList = array( 'wfAjaxGetFileUrl' );
+$wgAjaxExportList = array();
 
 /**
  * Enable watching/unwatching pages using AJAX.
@@ -5291,6 +5300,56 @@ $wgUpdateRowsPerQuery = 100;
 
 /** @} */ # End job queue }
 
+/************************************************************************//**
+ * @name   HipHop compilation
+ * @{
+ */
+
+/**
+ * The build directory for HipHop compilation. 
+ * Defaults to $IP/maintenance/hiphop/build.
+ */
+$wgHipHopBuildDirectory = false;
+
+/**
+ * The HipHop build type. Can be either "Debug" or "Release".
+ */
+$wgHipHopBuildType = 'Debug';
+
+/**
+ * Number of parallel processes to use during HipHop compilation, or "detect"
+ * to guess from system properties.
+ */
+$wgHipHopCompilerProcs = 'detect';
+
+/**
+ * Filesystem extensions directory. Defaults to $IP/../extensions.
+ *
+ * To compile extensions with HipHop, set $wgExtensionsDirectory correctly, 
+ * and use code like:
+ *    
+ *    require( MWInit::extensionSetupPath( 'Extension/Extension.php' ) );
+ *
+ * to include the extension setup file from LocalSettings.php. It is not 
+ * necessary to set this variable unless you use MWInit::extensionSetupPath().
+ */
+$wgExtensionsDirectory = false;
+
+/**
+ * A list of files that should be compiled into a HipHop build, in addition to 
+ * those listed in $wgAutoloadClasses. Add to this array in an extension setup 
+ * file in order to add files to the build. 
+ *
+ * The files listed here must either be either absolute paths under $IP or 
+ * under $wgExtensionsDirectory, or paths relative to the virtual source root
+ * "$IP/..", i.e. starting with "phase3" for core files, and "extensions" for 
+ * extension files.
+ */
+$wgCompiledFiles = array();
+
+/** @} */ # End of HipHop compilation }
+
+
 /************************************************************************//**
  * @name   Miscellaneous
  * @{