Refactor the retrieval of the cache timestamp into getCachedTimestamp() so the future...
[lhc/web/wiklou.git] / includes / DefaultSettings.php
index 65276e9..3db8ece 100644 (file)
@@ -26,7 +26,6 @@ if( !defined( 'MEDIAWIKI' ) ) {
        die( 1 );
 }
 
-
 # Create a site configuration object. Not used for much in a default install
 if ( !defined( 'MW_PHP4' ) ) {
        require_once( "$IP/includes/SiteConfiguration.php" );
@@ -35,7 +34,7 @@ if ( !defined( 'MW_PHP4' ) ) {
 /** @endcond */
 
 /** MediaWiki version number */
-$wgVersion = '1.17alpha';
+$wgVersion = '1.18alpha';
 
 /** Name of the site. It must be changed in LocalSettings.php */
 $wgSitename         = 'MediaWiki';
@@ -56,24 +55,24 @@ $wgServer = '';
 
 /** @cond file_level_code */
 if( isset( $_SERVER['SERVER_NAME'] ) ) {
-       $wgServerName = $_SERVER['SERVER_NAME'];
+       $serverName = $_SERVER['SERVER_NAME'];
 } elseif( isset( $_SERVER['HOSTNAME'] ) ) {
-       $wgServerName = $_SERVER['HOSTNAME'];
+       $serverName = $_SERVER['HOSTNAME'];
 } elseif( isset( $_SERVER['HTTP_HOST'] ) ) {
-       $wgServerName = $_SERVER['HTTP_HOST'];
+       $serverName = $_SERVER['HTTP_HOST'];
 } elseif( isset( $_SERVER['SERVER_ADDR'] ) ) {
-       $wgServerName = $_SERVER['SERVER_ADDR'];
+       $serverName = $_SERVER['SERVER_ADDR'];
 } else {
-       $wgServerName = 'localhost';
+       $serverName = 'localhost';
 }
 
 $wgProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
 
-$wgServer = $wgProto.'://' . $wgServerName;
+$wgServer = $wgProto.'://' . $serverName;
 # If the port is a non-standard one, add it to the URL
 if(    isset( $_SERVER['SERVER_PORT'] )
-       && !strpos( $wgServerName, ':' )
-    && (    ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 )
+       && !strpos( $serverName, ':' )
+       && (    ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 )
         || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) {
 
        $wgServer .= ":" . $_SERVER['SERVER_PORT'];
@@ -140,7 +139,6 @@ $wgScript           = false;
  * Defaults to "{$wgScriptPath}/redirect{$wgScriptExtension}".
  */
 $wgRedirectScript   = false; ///< defaults to
-/**@}*/
 
 /**
  * The URL path to load.php.
@@ -149,6 +147,8 @@ $wgRedirectScript   = false; ///< defaults to
  */
 $wgLoadScript           = false;
 
+/**@}*/
+
 /************************************************************************//**
  * @name   URLs and file paths
  *
@@ -258,6 +258,14 @@ $wgTmpDirectory     = false;
  */
 $wgUploadBaseUrl    = "";
 
+/**
+ * To enable remote on-demand scaling, set this to the thumbnail base URL.
+ * Full thumbnail URL will be like $wgUploadStashScalerBaseUrl/e/e6/Foo.jpg/123px-Foo.jpg
+ * where 'e6' are the first two characters of the MD5 hash of the file name.
+ * If $wgUploadStashScalerBaseUrl is set to false, thumbs are rendered locally as needed.
+ */
+$wgUploadStashScalerBaseUrl = false;
+
 /**
  * To set 'pretty' URL paths for actions other than
  * plain page views, add to this array. For instance:
@@ -393,13 +401,6 @@ $wgUseInstantCommons = false;
  */
 $wgShowEXIF = function_exists( 'exif_read_data' );
 
-/**
- * Set to true to enable the upload _link_ while local uploads are disabled.
- * Assumes that the special page link will be bounced to another server where
- * uploads do work.
- */
-$wgRemoteUploads = false;
-
 /**
  * If you operate multiple wikis, you can define a shared upload path here.
  * Uploads to this wiki will NOT be put there - they will be put into
@@ -503,9 +504,9 @@ $wgRepositoryBaseUrl = "http://commons.wikimedia.org/wiki/File:";
  * This is the list of preferred extensions for uploading files. Uploading files
  * with extensions not in this list will trigger a warning.
  *
- * WARNING: If you add any OpenOffice or Microsoft Office file formats here, 
- * such as odt or doc, and untrusted users are allowed to upload files, then 
- * your wiki will be vulnerable to cross-site request forgery (CSRF). 
+ * WARNING: If you add any OpenOffice or Microsoft Office file formats here,
+ * such as odt or doc, and untrusted users are allowed to upload files, then
+ * your wiki will be vulnerable to cross-site request forgery (CSRF).
  */
 $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );
 
@@ -543,7 +544,7 @@ $wgMimeTypeBlacklist = array(
        'application/x-opc+zip',
 );
 
-/** 
+/**
  * This is a flag to determine whether or not to check file extensions on upload.
  *
  * WARNING: setting this to false is insecure for public wikis.
@@ -554,7 +555,7 @@ $wgCheckFileExtensions = true;
  * If this is turned off, users may override the warning for files not covered
  * by $wgFileExtensions.
  *
- * WARNING: setting this to false is insecure for public wikis. 
+ * WARNING: setting this to false is insecure for public wikis.
  */
 $wgStrictFileExtensions = true;
 
@@ -893,7 +894,7 @@ $wgThumbLimits = array(
  * Default parameters for the <gallery> tag
  */
 $wgGalleryOptions = array (
-       'imagesPerRow' => 4, // Default number of images per-row in the gallery
+       'imagesPerRow' => 0, // Default number of images per-row in the gallery. 0 -> Adapt to screensize
        'imageWidth' => 120, // Width of the cells containing images in galleries (in "px")
        'imageHeight' => 120, // Height of the cells containing images in galleries (in "px")
        'captionLength' => 20, // Length of caption to truncate (in characters)
@@ -968,21 +969,28 @@ $wgDjvuOutputExtension = 'jpg';
 /**
  * Site admin email address.
  */
-$wgEmergencyContact = 'wikiadmin@' . $wgServerName;
+$wgEmergencyContact = 'wikiadmin@' . $serverName;
 
 /**
  * Password reminder email address.
  *
  * The address we should use as sender when a user is requesting his password.
  */
-$wgPasswordSender      = 'MediaWiki Mail <apache@' . $wgServerName . '>';
+$wgPasswordSender = 'apache@' . $serverName;
+
+unset( $serverName ); # Don't leak local variables to global scope
+
+/**
+ * Password reminder name
+ */
+$wgPasswordSenderName = 'MediaWiki Mail';
 
 /**
  * Dummy address which should be accepted during mail send action.
  * It might be necessary to adapt the address or to set it equal
  * to the $wgEmergencyContact address.
  */
-$wgNoReplyAddress      = 'reply@not.possible';
+$wgNoReplyAddress = 'reply@not.possible';
 
 /**
  * Set to true to enable the e-mail basic features:
@@ -1033,8 +1041,11 @@ $wgNewPasswordExpiry  = 3600 * 24 * 7;
  */
 $wgSMTP                                = false;
 
-/** For email notification on page changes */
-$wgPasswordSender = $wgEmergencyContact;
+/**
+ * Additional email parameters, will be passed as the last argument to mail() call.
+ * If using safe_mode this has no effect
+ */
+$wgAdditionalMailParams = null;
 
 /**
  * True: from page editor if s/he opted-in. False: Enotif mails appear to come
@@ -1442,7 +1453,7 @@ $wgCacheDirectory = false;
  *   - CACHE_ANYTHING:   Use anything, as long as it works
  *   - CACHE_NONE:       Do not cache
  *   - CACHE_DB:         Store cache objects in the DB
- *   - CACHE_MEMCACHED:  MemCached, must specify servers in $wgMemCacheServers
+ *   - CACHE_MEMCACHED:  MemCached, must specify servers in $wgMemCachedServers
  *   - CACHE_ACCEL:      eAccelerator, APC, XCache or WinCache
  *   - CACHE_DBA:        Use PHP's DBA extension to store in a DBM-style
  *                       database. This is slow, and is not recommended for
@@ -1591,6 +1602,14 @@ $wgUseFileCache = false;
  */
 $wgFileCacheDirectory = false;
 
+/**
+ * Depth of the subdirectory hierarchy to be created under
+ * $wgFileCacheDirectory.  The subdirectories will be named based on
+ * the MD5 hash of the title.  A value of 0 means all cache files will
+ * be put directly into the main file cache directory.
+ */
+$wgFileCacheDepth = 2;
+
 /**
  * Keep parsed pages in a cache (objectcache table or memcached)
  * to speed up output of the same page viewed by another user with the
@@ -1634,7 +1653,10 @@ $wgSidebarCacheExpiry = 86400;
  */
 $wgUseGzip = false;
 
-/** Whether MediaWiki should send an ETag header */
+/**
+ * Whether MediaWiki should send an ETag header. Seems to cause
+ * broken behavior with Squid 2.6, see bug 7098.
+ */
 $wgUseETag = false;
 
 /** Clock skew or the one-second resolution of time() can occasionally cause cache
@@ -1645,36 +1667,15 @@ $wgUseETag = false;
 $wgClockSkewFudge = 5;
 
 /**
- * Maximum time in seconds to cache versioned resources served by the resource
- * loader on the client side (e.g. in the browser cache).
- */
-$wgResourceLoaderVersionedClientMaxage = 30 * 24 * 60 * 60; // 30 days
-
-/**
- * Maximum time in seconds to cache versioned resources served by the resource
- * loader on the server side. This means Squid/Varnish but also any other public
- * proxy cache between the client and MediaWiki.
- */
-$wgResourceLoaderVersionedServerMaxage = 30 * 24 * 60 * 60; // 30 days
-
-/**
- * Maximum time in seconds to cache unversioned resources served by the resource
- * loader on the client.
- */
-$wgResourceLoaderUnversionedClientMaxage = 5 * 60; // 5 minutes
-
-/**
- * Maximum time in seconds to cache unversioned resources served by the resource
- * loader on the server. This means Squid/Varnish but also any other public
- * proxy cache between the client and MediaWiki.
- */
-$wgResourceLoaderUnversionedServerMaxage = 5 * 60; // 5 minutes
-
-/**
- * Enable data URL embedding (experimental). This variable is very temporary and
- * will be removed once we get this feature stable.
+ * Invalidate various caches when LocalSettings.php changes. This is equivalent
+ * to setting $wgCacheEpoch to the modification time of LocalSettings.php, as
+ * was previously done in the default LocalSettings.php file.
+ *
+ * On high-traffic wikis, this should be set to false, to avoid the need to 
+ * check the file modification time, and to avoid the performance impact of
+ * unnecessary cache invalidations. 
  */
-$wgUseDataURLs = false;
+$wgInvalidateCacheOnLocalSettingsChange = true;
 
 /** @} */ # end of cache settings
 
@@ -1800,7 +1801,18 @@ $wgExtraLanguageNames = array();
  * These codes are leftoffs from renames, or other legacy things.
  * Also, qqq is a dummy "language" for documenting messages.
  */
-$wgDummyLanguageCodes = array( 'qqq', 'als', 'be-x-old', 'dk', 'fiu-vro', 'iu', 'nb', 'simple', 'tp' );
+$wgDummyLanguageCodes = array(
+       'als',
+       'bat-smg',
+       'be-x-old',
+       'dk',
+       'fiu-vro',
+       'iu',
+       'nb',
+       'qqq',
+       'simple',
+       'tp',
+);
 
 /** @deprecated Since MediaWiki 1.5, this must always be set to UTF-8. */
 $wgInputEncoding  = 'UTF-8';
@@ -1957,6 +1969,9 @@ $wgDisableLangConversion = false;
 /** Whether to enable language variant conversion for links. */
 $wgDisableTitleConversion = false;
 
+/** Whether to enable cononical language links in meta data. */
+$wgCanonicalLanguageLinks = true;
+
 /** Default variant code, if false, the default will be the language code */
 $wgDefaultLanguageVariant = false;
 
@@ -2267,6 +2282,44 @@ $wgDisableOutputCompression = false;
  */
 $wgExperimentalHtmlIds = true;
 
+/**
+ * Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code
+ * You can add new icons to the built in copyright or poweredby, or you can create
+ * a new block. Though note that you may need to add some custom css to get good styling
+ * of new blocks in monobook. vector and modern should work without any special css.
+ * 
+ * $wgFooterIcons itself is a key/value array.
+ * The key is the name of a block that the icons will be wrapped in. The final id varies 
+ * by skin; Monobook and Vector will turn poweredby into f-poweredbyico while Modern 
+ * turns it into mw_poweredby.  The value is a key/value array of icons. The key may or 
+ * may not be used by the skin but it can be used to find the icon and unset it or 
+ * change the icon if needed. This is useful for disabling icons that are set by extensions.
+ * The value should be either a string or an array. If it is a string it will be output 
+ * directly, however some skins may choose to ignore it. An array is the preferred format 
+ * for the icon, the following keys are used:
+ *   src: An absolute url to the image to use for the icon, this is recommended
+ *        but not required, however some skins will ignore icons without an image
+ *   url: The url to use in the <a> arround the text or icon, if not set an <a> will not be outputted
+ *   alt: This is the text form of the icon, it will be displayed without an image in
+ *        skins like Modern or if src is not set, and will otherwise be used as
+ *        the alt="" for the image. This key is required.
+ *   width and height: If the icon specified by src is not of the standard size
+ *                     you can specify the size of image to use with these keys.
+ *                     Otherwise they will default to the standard 88x31.
+ */
+$wgFooterIcons = array(
+       "copyright" => array(
+               "copyright" => array(), // placeholder for the built in copyright icon
+       ),
+       "poweredby" => array(
+               "mediawiki" => array(
+                       "src" => null, // Defaults to "$wgStylePath/common/images/poweredby_mediawiki_88x31.png"
+                       "url" => "http://www.mediawiki.org/",
+                       "alt" => "Powered by MediaWiki",
+               )
+       ),
+);
+
 /**
  * Search form behavior for Vector skin only
  * true = use an icon search button
@@ -2299,6 +2352,65 @@ $wgBetterDirectionality = false;
 
 /** @} */ # End of output format settings }
 
+/*************************************************************************//**
+ * @name   Resource loader settings
+ * @{
+ */
+
+/**
+ * Client-side resource modules. Extensions should add their module definitions
+ * here.
+ *
+ * Example:
+ *   $wgResourceModules['ext.myExtension'] = array(
+ *      'scripts' => 'myExtension.js',
+ *      'styles' => 'myExtension.css',
+ *      'dependencies' => array( 'jquery.cookie', 'jquery.tabIndex' ),
+ *      'localBasePath' => dirname( __FILE__ ),
+ *      'remoteExtPath' => 'MyExtension',
+ *   );
+ */
+$wgResourceModules = array();
+
+/**
+ * Maximum time in seconds to cache resources served by the resource loader
+ */
+$wgResourceLoaderMaxage = array(
+       'versioned' => array(
+               // Squid/Varnish but also any other public proxy cache between the client and MediaWiki
+               'server' => 30 * 24 * 60 * 60, // 30 days
+               // On the client side (e.g. in the browser cache).
+               'client' => 30 * 24 * 60 * 60, // 30 days
+       ),
+       'unversioned' => array(
+               'server' => 5 * 60, // 5 minutes
+               'client' => 5 * 60, // 5 minutes
+       ),
+);
+
+/**
+ * Whether to embed private modules inline with HTML output or to bypass
+ * caching and check the user parameter against $wgUser to prevent
+ * unauthorized access to private modules.
+ */
+$wgResourceLoaderInlinePrivateModules = true;
+
+/**
+ * The default debug mode (on/off) for of ResourceLoader requests. This will still
+ * be overridden when the debug URL parameter is used.
+ */
+$wgResourceLoaderDebug = false;
+
+/**
+ * Enable embedding of certain resources using Edge Side Includes. This will
+ * improve performance but only works if there is something in front of the
+ * web server (e..g a Squid or Varnish server) configured to process the ESI.
+ */
+$wgResourceLoaderUseESI = false;
+
+/** @} */ # End of resource loader settings }
+
+
 /*************************************************************************//**
  * @name   Page title and interwiki link settings
  * @{
@@ -2385,8 +2497,15 @@ $wgNamespaceAliases = array();
  */
 $wgLegalTitleChars = " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+";
 
-$wgLocalInterwiki   = 'w';
-$wgInterwikiExpiry = 10800; # Expiry time for cache of interwiki table
+/**
+ * The interwiki prefix of the current wiki, or false if it doesn't have one.
+ */
+$wgLocalInterwiki   = false;
+
+/**
+ * Expiry time for cache of interwiki table
+ */
+$wgInterwikiExpiry = 10800;
 
 /** Interwiki caching settings.
        $wgInterwikiCache specifies path to constant database file
@@ -2756,6 +2875,12 @@ $wgMinimalPasswordLength = 1;
  */
 $wgLivePasswordStrengthChecks = false;
 
+/**
+ * List of weak passwords which shouldn't be allowed.
+ * The items should be in lowercase. The check is case insensitive.
+ */
+$wgWeakPasswords = array( 'password', 'passpass', 'passpass1' );
+
 /**
  * Maximum number of Unicode characters in signature
  */
@@ -2817,6 +2942,7 @@ $wgDefaultUserOptions = array(
        'imagesize'               => 2,
        'justify'                 => 0,
        'math'                    => 1,
+       'minordefault'            => 0,
        'newpageshidepatrolled'   => 0,
        'nocache'                 => 0,
        'noconvertlink'           => 0,
@@ -2940,6 +3066,19 @@ $wgAutocreatePolicy = 'login';
  */
 $wgAllowPrefChange = array();
 
+/**
+ * This is to let user authenticate using https when they come from http.
+ * Based on an idea by George Herbert on wikitech-l:
+ * http://lists.wikimedia.org/pipermail/wikitech-l/2010-October/050065.html
+ * @since 1.17
+ */
+$wgSecureLogin        = false;
+/**
+ * Default for 'use secure login' checkbox
+ * @since 1.17
+ */
+$wgSecureLoginStickHTTPS = false;
+
 /** @} */ # end user accounts }
 
 /************************************************************************//**
@@ -3107,6 +3246,7 @@ $wgGroupPermissions['sysop']['browsearchive']    = true;
 $wgGroupPermissions['sysop']['noratelimit']      = true;
 $wgGroupPermissions['sysop']['movefile']         = true;
 $wgGroupPermissions['sysop']['unblockself']      = true;
+$wgGroupPermissions['sysop']['suppressredirect'] = true;
 #$wgGroupPermissions['sysop']['mergehistory']     = true;
 
 // Permission to change users' group assignments
@@ -3125,6 +3265,11 @@ $wgGroupPermissions['bureaucrat']['noratelimit'] = true;
 // For private suppression log access
 #$wgGroupPermissions['suppress']['suppressionlog'] = true;
 
+// Permission to disable user accounts
+// Note that disabling an account is not reversible without a system administrator
+// who has direct access to the database
+#$wgGroupPermissions['bureaucrat']['disableaccount']  = true;
+
 /**
  * The developer group is deprecated, but can be activated if need be
  * to use the 'lockdb' and 'unlockdb' special pages. Those require
@@ -3407,8 +3552,6 @@ $wgRateLimitsExcludedGroups = array();
 /**
  * Array of IPs which should be excluded from rate limits.
  * This may be useful for whitelisting NAT gateways for conferences, etc.
- * Wiki administrators can add additional IP addresses via
- * [[MediaWiki:Ratelimit-excluded-ips]]
  */
 $wgRateLimitsExcludedIPs = array();
 
@@ -3522,7 +3665,7 @@ $wgSessionName = false;
  */
 $wgUseTeX = false;
 /** Location of the texvc binary */
-$wgTexvc = './math/texvc';
+$wgTexvc = $IP . '/math/texvc';
 /**
   * Texvc background color
   * use LaTeX color format as used in \special function
@@ -3727,8 +3870,8 @@ $wgUseTrackbacks = false;
  * Use full paths.
  */
 $wgParserTestFiles = array(
-       "$IP/maintenance/parserTests.txt",
-       "$IP/maintenance/ExtraParserTests.txt"
+       "$IP/tests/parser/parserTests.txt",
+       "$IP/tests/parser/extraParserTests.txt"
 );
 
 /**
@@ -3767,6 +3910,8 @@ $wgAdvancedSearchHighlighting = false;
 /**
  * Regexp to match word boundaries, defaults for non-CJK languages
  * should be empty for CJK since the words are not separate
+ *
+ * @todo FIXME: checks for lower than required PHP version (5.1.x).
  */
 $wgSearchHighlightBoundaries = version_compare("5.1", PHP_VERSION, "<")? '[\p{Z}\p{P}\p{C}]'
        : '[ ,.;:!?~!@#$%\^&*\(\)+=\-\\|\[\]"\'<>\n\r\/{}]'; // PHP 5.0 workaround
@@ -3977,7 +4122,7 @@ $wgMaintenanceScripts = array();
  */
 $wgReadOnly             = null;
 
-/***
+/**
  * If this lock file exists (size > 0), the wiki will be forced into read-only mode.
  * Its contents will be shown to users as part of the read-only warning
  * message.
@@ -3986,6 +4131,17 @@ $wgReadOnly             = null;
  */
 $wgReadOnlyFile         = false;
 
+/**
+ * When you run the web-based upgrade utility, it will tell you what to set 
+ * this to in order to authorize the upgrade process. It will subsequently be
+ * used as a password, to authorize further upgrades.
+ *
+ * For security, do not set this to a guessable string. Use the value supplied 
+ * by the install/upgrade process. To cause the upgrader to generate a new key, 
+ * delete the old key from LocalSettings.php.
+ */
+$wgUpgradeKey = false;
+
 /** @} */ # End of maintenance }
 
 /************************************************************************//**
@@ -4385,17 +4541,6 @@ $wgSpecialPageCacheUpdates = array(
  */
 $wgExceptionHooks = array();
 
-/**
- * List of page property names and descriptions of what they are.
- * This is used for the API prop=pageprops module to know which
- * page props to search for. The help message is only seen from
- * the API help page.
- */
-$wgPageProps = array(
-       'displaytitle' => 'Value of the {{DISPLAYTITLE}} tag',
-       'defaultsort' => 'Value of the {{DEFAULTSORT}} tag',
-       'hiddencat' => 'Whether or not the page has a category with the __HIDDENCAT__ magic word',
-);
 
 /**
  * Page property link table invalidation lists. When a page property
@@ -4558,6 +4703,7 @@ $wgLogActions = array(
        'protect/unprotect' => 'unprotectedarticle',
        'protect/move_prot' => 'movedarticleprotection',
        'rights/rights'     => 'rightslogentry',
+       'rights/disable'    => 'disableaccount-logentry',
        'delete/delete'     => 'deletedarticle',
        'delete/restore'    => 'undeletedarticle',
        'delete/revision'   => 'revdelete-logentry',
@@ -5085,43 +5231,12 @@ $wgPoolCounterConf = null;
  */
 $wgUploadMaintenance = false;
 
-/**
- * The location of the MediaWiki package repository to use.
- *
- * @since 1.17
- * @var string
- */
-$wgRepositoryApiLocation = 'http://www.mediawiki.org/w/api.php';
-
-/**
- * The location of the remote web interface for the selected repository.
- *
- * @since 1.17
- * @var string
- */
-$wgRepositoryLocation = 'http://www.mediawiki.org/wiki/Special:Repository';
-
-/**
- * List of package states to filter update detection and extension listing on.
- *
- * @since 1.17
- * @var array
- */
-$wgRepositoryPackageStates = array(
-       //'dev',
-       //'alpha',
-       'beta',
-       //'rc',
-       'stable',
-       //'deprecated',
-);
-
 /**
  * Allows running of selenium tests via maintenance/tests/RunSeleniumTests.php
  */
 $wgEnableSelenium = false;
-
-
+$wgSeleniumTestConfigs = array();
+$wgSeleniumConfigFile = null;
 
 /**
  * For really cool vim folding this needs to be at the end: