This is displayed instead of the regular sitenotice, if it exists. If not, the
regular sitenotice shows. If that doesn't exist, the value of $wgSiteNotice is used,
and if that's null, then nothing is shown.
+* Spit the generated LocalSettings code out during the installer as an aid
+ to debugging issues. (Keep this?)
+* Use __FILE__ to form path in new LocalSettings.php, so it stays accurate
+ when the directory is relocated for typical usage.
+* Auto-update $wgCacheEpoch when LocalSettings.php changes on new installs.
+ For typical usage this will be a light burden and should reduce confusion
+ when the configuration is edited.
+* Fix $wgCacheEpoch's effect on client-side caching.
+
=== Caveats ===
# Attempt to set up the include path, to fix problems with relative includes
$IP = dirname( dirname( __FILE__ ) );
+define( 'MW_INSTALL_PATH', $IP );
$sep = PATH_SEPARATOR;
if( !ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages" ) ) {
set_include_path( ".$sep$IP$sep$IP/includes$sep$IP/languages" );
/* Load up the settings and get installin' */
$local = writeLocalSettings( $conf );
+ echo "<p><b>Generating configuration file...</b></p>\n";
+ echo "<pre>" . htmlspecialchars( $local ) . "</pre>\n";
+
$wgCommandLineMode = false;
chdir( ".." );
eval($local);
# and their default values, but don't forget to make changes in _this_
# file, not there.
-\$IP = \"{$slconf['IP']}\";
-if( !ini_set( \"include_path\", \".$sep\$IP$sep\$IP/includes$sep\$IP/languages\" ) ) {
- set_include_path( \".$sep\$IP$sep\$IP/includes$sep\$IP/languages\" );
+# If you customize your file layout, set \$IP to the directory that contains
+# the other MediaWiki files. It will be used as a base to locate files.
+if( defined( 'MW_INSTALL_PATH' ) ) {
+ \$IP = MW_INSTALL_PATH;
+} else {
+ \$IP = dirname( __FILE__ );
}
+
+\$path = array( \$IP, \"\$IP/includes\", \"\$IP/languages\" );
+set_include_path( implode( PATH_SEPARATOR, \$path ) );
+
require_once( \"includes/DefaultSettings.php\" );
# If PHP's memory limit is very low, some operations may fail.
\$wgScript = \"\$wgScriptPath/index.php\";
\$wgRedirectScript = \"\$wgScriptPath/redirect.php\";
-## If using PHP as a CGI module, use the ugly URLs
+## For more information on customizing the URLs please see:
+## http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url
+## If using PHP as a CGI module, the ?title= style usually must be used.
{$pretty}\$wgArticlePath = \"\$wgScript/\$1\";
{$ugly}\$wgArticlePath = \"\$wgScript?title=\$1\";
\$wgMemCachedServers = $mcservers;
## To enable image uploads, make sure the 'images' directory
-## is writable, then uncomment this:
-# \$wgEnableUploads = true;
+## is writable, then set this to true:
+\$wgEnableUploads = false;
\$wgUseImageResize = {$conf->UseImageResize};
{$magic}\$wgUseImageMagick = true;
{$magic}\$wgImageMagickConvertCommand = \"{$convert}\";
## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
-# \$wgUseTeX = true;
+\$wgUseTeX = false;
\$wgMathPath = \"{\$wgUploadPath}/math\";
\$wgMathDirectory = \"{\$wgUploadDirectory}/math\";
\$wgTmpDirectory = \"{\$wgUploadDirectory}/tmp\";
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
-# \$wgDefaultSkin = 'monobook';
+\$wgDefaultSkin = 'monobook';
## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
# \$wgRightsCode = \"{$slconf['RightsCode']}\"; # Not yet used
\$wgDiff3 = \"{$slconf['diff3']}\";
+
+# When you make changes to this configuration file, this will make
+# sure that cached pages are cleared.
+\$configdate = gmdate( 'YmdHis', @filemtime( __FILE__ ) );
+\$wgCacheEpoch = max( \$wgCacheEpoch, \$configdate );
";
// Keep things in Unix line endings internally;
// the system will write out as local text type.
* returns true iff cache-ok headers was sent.
*/
function checkLastModified ( $timestamp ) {
- global $wgCachePages, $wgUser;
+ global $wgCachePages, $wgCacheEpoch, $wgUser;
if ( !$timestamp || $timestamp == '19700101000000' ) {
wfDebug( "CACHE DISABLED, NO TIMESTAMP\n" );
return;
}
$timestamp=wfTimestamp(TS_MW,$timestamp);
- $lastmod = wfTimestamp( TS_RFC2822, max( $timestamp, $wgUser->mTouched ) );
+ $lastmod = wfTimestamp( TS_RFC2822, max( $timestamp, $wgUser->mTouched, $wgCacheEpoch ) );
if( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
# IE sends sizes after the date like this:
$ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 );
wfDebug( "-- client send If-Modified-Since: " . $modsince . "\n", false );
wfDebug( "-- we might send Last-Modified : $lastmod\n", false );
- if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) ) {
+ if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) && $ismodsince >= $wgCacheEpoch ) {
# Make sure you're in a place you can leave when you call us!
header( "HTTP/1.0 304 Not Modified" );
$this->mLastModified = $lastmod;
$this->sendCacheControl();
- wfDebug( "CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp\n", false );
+ wfDebug( "CACHED client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
$this->disable();
@ob_end_clean(); // Don't output compressed blob
return true;
} else {
- wfDebug( "READY client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp\n", false );
+ wfDebug( "READY client: $ismodsince ; user: $wgUser->mTouched ; page: $timestamp ; site $wgCacheEpoch\n", false );
$this->mLastModified = $lastmod;
}
} else {