Multiple Mediawiki Installations on the Same Codebase/w/LocalSettings.php

From Charlie.Huggardlee.Net

Jump to: navigation, search
<?php
 
#Standard initialization
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 ) . PATH_SEPARATOR . get_include_path() );
 
require_once( "$IP/includes/DefaultSettings.php" );
 
if ( $wgCommandLineMode ) {
	if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
		die( "This script must be run from the command line\n" );
	}
	#Check to make sure we established what the base directory is
	if (! isset ( $baseIP ) ) {
		die("This script must be run using the command line wrapper\n"); 
	}
} else {
        #Figure out what the base directory is from the request
	$baseIP = substr($IP,0,strrpos($IP,'/')+1) . strtolower($_SERVER[SERVER_NAME]);  
}
 
 
##Set the wiki for pretty urls
$wgScriptPath       = "/w";
$wgArticlePath      = "{$wgScript}/$1";
$wgScriptExtension  = ".php";
 
## Establish a non-default style directory if one exists
if( is_dir( "${baseIP}/skins" ) ) {
	$wgStylePath   = "/skins"; /// defaults to "{$wgScriptPath}/skins"
	$wgStyleDirectory = "{$baseIP}/skins"; /// defaults to "{$IP}/skins"
}
 
## Anonymous emailer
$wgPasswordSender = "mediawiki@example.com";
 
## For a detailed description of the following switches see
## http://meta.wikimedia.org/Enotif and http://meta.wikimedia.org/Eauthent
## There are many more options for fine tuning available see
## /includes/DefaultSettings.php
## UPO means: this is also a user preference option
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true; 
 
##Shared Database settings
$wgDBtype           = "mysql";
$wgDBserver         = "mysql.example.com";
 
# Postgres specific settings
$wgDBport           = "5432";
$wgDBmwschema       = "mediawiki";
$wgDBts2schema      = "public";
 
## Shared memory settings
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();
 
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true; 
$wgUploadDirectory = "{$baseIP}/images";
$wgUploadPath = "/images";
 
$wgUseImageMagick = true; 
$wgImageMagickConvertCommand = "/usr/bin/convert"; 
 
## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
$wgUseTeX           = false;
 
$wgLanguageCode = "en";
 
 
# A default licensing for all wikis
 
## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation 
## License and Creative Commons licenses are supported so far.
$wgEnableCreativeCommonsRdf = true;
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "http://creativecommons.org/licenses/by-nc-nd/3.0/";
$wgRightsText = "Attribution-Noncommercial-No Derivative Works 3.0 Unported";
$wgRightsIcon = "http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png";
# $wgRightsCode = "[license_code]"; # Not yet used
 
$wgDiff3 = "/usr/bin/diff3";
 
#Display the default uninitialized page if the site specific settings aren't present
if( !file_exists( "{$baseIP}/LocalSettings.php" ) ) {
	require_once( "{$IP}/includes/templates/NoLocalSettings.php" );
	die();  
}
 
# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
# Modified so that it checks the local wiki settings are also checked 
$wgCacheEpoch = max( $wgCacheEpoch, 
			gmdate( 'YmdHis', @filemtime( __FILE__ ) ), 
			gmdate( 'YmdHis', @filemtime( "{$baseIP}/LocalSettings.php" ) )
			); 
 
# Make sure that noone else can edit the wiki by default
$wgGroupPermissions['*'    ]['createaccount']   = false;
$wgGroupPermissions['*'    ]['edit']            = false;
$wgShowIPinHeader = false;
 
if(!isset($acwgDefaultExtensions)) {
	$acwgDefaultExtensions = true;
}
 
#Timezone Fix
$wgLocaltimezone = "America/Chicago";
$oldtz = getenv("TZ");
putenv("TZ=$wgLocaltimezone");
$wgLocalTZoffset = date("Z") / 60;
putenv("TZ=$oldtz");
 
#Load Specific Wiki Settings
require_once("{$baseIP}/LocalSettings.php");
 
#If things aren't set, default them
if(!isset($wgLocalInterwiki) ) {
	$wgLocalInterwiki   = $wgSitename;
}
 
if(!isset($wgDBadminuser)) {
	$wgDBadminuser      = $wgDBuser;
	$wgDBadminpassword  = $wgDBpassword;
}
 
if(!isset($wgDefaultSkin)) {
	$wgDefaultSkin = 'monobook';
}
 
#A fairly good set of extensions
if($acwgDefaultExtensions) {
	require_once("${IP}/extensions/Cite/Cite.php");  
	require_once("${IP}/extensions/Logo/Logo.php");
	require_once("${IP}/extensions/Newuserlog/Newuserlog.php");
	require_once("${IP}/extensions/ParserFunctions/ParserFunctions.php"); 
	require_once("${IP}/extensions_local/charlie/Missing404.php");
	require_once("${IP}/extensions_local/charlie/HttpStatus.php");
	require_once("${IP}/extensions_local/jimbojw/ArticleComments.php");
	require_once("${IP}/extensions/SubpageList/SubpageList.php");
}
Web Search
Google
Personal tools