User:Daniel Mietchen/Sandbox/PHP/1

From Citizendium
Jump to navigation Jump to search


The account of this former contributor was not re-activated after the server upgrade of March 2022.


<?php

## Citizendium's master control file
## Don't edit unless you really know what you are doing.
## (The following text changed by dnessett)
## This file is kept in phase3/config and the subversion
## repository is set up to ignore LocalSettings.php in phase3.
## Consequently, for a fresh install, this file should be moved
## to phase3 and edited appropriately. If you make changes to this
## file and commiting to config, describe what you did and why you did it.
## Initial your changes. If you are changing this file on the live wiki
## (as opposed to a CZ clone), remember to copy it to the both servers.
## By convention, changes are made to locke and copied to reid.

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( "includes/DefaultSettings.php" );

$wgUploadDirectory  = "$IP/images";

## Need this off to force pngs for math, otherwise anon math looks funny
$wgDefaultUserOptions['math'] = 0;

if ( $wgCommandLineMode ) {
    if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
        die( "This script must be run from the command line\n" );
    }
} elseif ( empty( $wgNoOutputBuffer ) ) {
    ## Compress output if the browser supports it
      if( !ini_get( 'zlib.output_compression' ) ) @ob_start( 'ob_gzhandler' );
}

require_once( "$IP/extensions/Cite/Cite.php" );
require_once( "$IP/extensions/CategoryTree/CategoryTree.php" );
require_once( "$IP/extensions/CharInsert.php" );
require_once( "$IP/extensions/Hieroglyphs/wikihiero.php" );
require_once( "$IP/extensions/inputbox.php" );
require_once( "$IP/extensions/ParserFunctions.php" );
require_once( "$IP/extensions/Templates/ExpandTemplates.php" );
require_once( "$IP/extensions/Timeline/Timeline.php" );

require_once( "$IP/extensions/CheckUser/CheckUser.php" );

$wgCheckUserLog = "$IP/cz_checkuser.log";

# Needed by ConfirmEdit/FancyCaptcha.php. -dnessett
$wgCaptchaDirectory = "$IP/images/captcha_cz";

$wgCUDMaxAge = 5 * 12 * 30 * 24 * 3600; ## Approxmiately 5 years

require_once( "$IP/extensions/Newuserlog/Newuserlog.php" );

require_once( "$IP/extensions/ConfirmAccount/SpecialConfirmAccount.php" );
$wgConfirmAccountSortkey = array( '/^(.+) ([^ ]+)$/', '$2, $1' );
$wgAutoUserBioText = '[[Category:CZ Authors]]';

require_once( "$IP/extensions/ImageMap/ImageMap.php" );
require_once( "$IP/extensions/Renameuser/SpecialRenameuser.php" );
require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" );
require_once( "$IP/extensions/ConfirmEdit/FancyCaptcha.php" );

$wgTreeViewImages = array();
require_once( "$IP/extensions/Treeview4.php" );
$wgTreeViewImages['minus']  = '/images/icons/Minus.gif';
$wgTreeViewImages['plus']   = '/images/icons/Plus.gif';
$wgTreeViewImages['opened'] = '/images/icons/Folder_opn_sml_yel.gif';
$wgTreeViewImages['closed'] = '/images/icons/Folder_sml_yel.gif';
$wgTreeViewImages['doc']    = '/images/icons/Doc-icon.gif';
$wgTreeViewImages['spacer'] = '/images/icons/Blank.gif';
$wgTreeViewImages['vert']   = '/images/icons/Vertline.gif';
$wgTreeViewImages['node']   = '/images/icons/Node.gif';
$wgTreeViewImages['last']   = '/images/icons/Lastnode.gif';

require_once( "$IP/extensions/EmbedVideo/embedvideo.php" );

## Not working yet: current error is:
## FIXED Call to undefined method Xml::textarea() in ...SpecialNewsletterMassMailer.php on line 192
## FIXED Call to undefined method OutputPage::buildCssLinks() in ..Newsletter.body.php
## Class 'UserMailer' not found in ...Newsletter.body.php

require_once( "$IP/extensions/Newsletter/Newsletter.setup.php" );
$wgNewsletterSalt = "AhoySaltyCrackerzz";
$wgNewsletterExcludedNamespaces = array(NS_USER, NS_USER_TALK, NS_TALK, 101);
$wgGroupPermissions['*']['newslettermassmailer'] = false;
$wgGroupPermissions['*']['newslettermembers'] = false;
$wgGroupPermissions['bureaucrat']['newslettermassmailer'] = true; // Only bureaucrats can send mass e-mails
$wgGroupPermissions['bureaucrat']['newslettermembers'] = true; // Only bureaucrats can send mass e-mails

require_once( "$IP/extensions/LabeledSectionTransclusion/lst.php" );
require_once( "$IP/extensions/LabeledSectionTransclusion/lsth.php" );

#require_once( "$IP/extensions/Bad-Behavior/bad-behavior-mediawiki.php" );
#define('BB2_NO_CREATE', true);

# If PHP's memory limit is very low, some operations may fail.
  ini_set( 'memory_limit', '80M' );

# Changed Sitename, reflecting that this file may be used in a CZ clone.
# For live wiki, "Citizendium, the Citizens' Compendium" is the appropriate
# sitename. -dnessett
$wgSitename          = "CZ Clone";
$wgMetaNamespace     = "Citizendium_Pilot";
$wgMetaNamespaceTalk = "Citizendium_Pilot_Talk";
$wgDefaultSkin       = 'pinkwich5';
$wgLanguageCode      = "en";
$wgEmergencyContact  = "";
# For generic clone, using root@localhost. Installer should change to
# approrpiate user. For live wiki, should be:
# constables@citizendium.org. -dnessett
$wgPasswordSender    = "root@localhost";
$wgNoReplyAddress    = 'reply@not.possible';
$wgVersion           = '1.13.2 (modified)';

$wgScriptPath        = "";
$wgScript            = "/wiki";
$wgRedirectScript    = "$wgScriptPath/redirect.php";
$wgArticlePath       = "$wgScript/$1";
$wgStylePath         = "$wgScriptPath/skins";
$wgStyleDirectory    = "$IP/skins";
$wgLogo              = "/czlogo.png";
$wgUploadPath        = "$wgScriptPath/images";
$wgDiff3             = "/usr/bin/diff3";

# turned on for upload wizard - 11 Nov 2007 - emg
$wgForceUIMsgAsContentMsg = array( 'licenses' ); 

#Turned on 3-12-07 for WikiED
$wgAllowUserJs      = true;
$wgAllowUserCss     = true;
$wgUseSiteJs        = true;

# Enable email notifications
$wgEnableEmail         = true;
$wgEnableUserEmail     = true;
$wgEnotifUserTalk      = true;
$wgEnotifWatchlist     = true;
$wgEmailAuthentication = true;
$wgEmailConfirmToEdit  = true;

# Database connection information
$wgDBtype           = "postgres";
$wgDBserver         = "localhost";
$wgDBmwschema       = "mediawiki";
$wgDBts2schema      = "public";
$wgDBuser           = "cz";
$wgDBport           = "5432";
$wgDBname           = "cz";
$wgDBpassword        = "";

$wgExtraNamespaces =
       array(100 => "CZ",
             101 => "CZ_Talk",
             102 => "TI",
             103 => "TI_Talk",
             104 => "WYA",
             105 => "WYA_Talk"
             );

$wgNamespacesWithSubpages += array(
        100               => true,
        101               => true,
        102               => true,
        103               => true,
        104               => true,
        105               => true,
        NS_MAIN           => true,
        NS_TALK           => true,
        NS_MEDIAWIKI      => true,
        NS_SPECIAL        => true,
        NS_TEMPLATE       => true,
);

$wgMainCacheType      = CACHE_ACCEL;
$wgParserCacheType    = CACHE_ACCEL;
$wgMessageCacheType   = CACHE_ACCEL;
$wgEnableParserCache  = false;
$wgUseFileCache       = true;

$wgFileCacheDirectory = "$IP/images/reidcache";

$wgUseGzip            = false;
$wgCachePages         = true;
$wgShowIPinHeader     = false;
$wgUseSquid           = false;
$wgSquidServers       = array("localhost");

$wgDisableCounters    = false;

## This setting is to extend watchlists from 7 days to 30 days.
$wgRCMaxAge = 30 * 24 * 3600;

$wgEnableUploads       = true;
$wgUseImageResize      = true;
$wgUseImageMagick      = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

# enable TeX
$wgUseTeX           = true;
$wgMathPath         = "{$wgUploadPath}/math";
$wgMathDirectory    = "{$wgUploadDirectory}/math";
$wgTmpDirectory     = "{$wgUploadDirectory}/tmp";

# Probaly should move texvc to /usr/bin. For now grab it from /math/. -dnessett
$wgTexvc ="$IP/math/texvc";
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = '/usr/bin/convert';

$wgLocalInterwiki   = $wgSitename;

# $wgProxyKey deprecated since MW 1.4. Using $wgSecretKey instead. -dnessett
#$wgProxyKey = "ccfe740e0734927437d104f513a2e35c4401771cf6bbcbeca7baef794052dad1";
$wgSecretKey = "eddffd9daa080f2235966482f645399338bf968ff73596a214733f610feebfdf";

$wgEnableCreativeCommonsRdf = true;
$wgRightsPage               = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl                = "http://www.gnu.org/copyleft/fdl.html";
$wgRightsText               = "GNU Free Documentation License 1.2";

# 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 );

# This snippet prevents new registrations from anonymous users
# (Sysops can still create user accounts)
$wgGroupPermissions['*']['createaccount'] = false;

# Implicit group for all visitors
$wgGroupPermissions['*']['createaccount']   = false;
$wgGroupPermissions['*']['read']            = true;
$wgGroupPermissions['*']['edit']            = false;
$wgGroupPermissions['*']['move']            = false;
$wgGroupPermissions['*']['createpage']      = false;
$wgGroupPermissions['*']['createtalk']      = false;

# Implicit group for all logged-in accounts
$wgGroupPermissions['user']['move']            = true;
$wgGroupPermissions['emailconfirmed']['move']  = true;
$wgGroupPermissions['user']['read']            = true;
$wgGroupPermissions['user']['edit']            = true;
$wgGroupPermissions['user']['createpage']      = true;
$wgGroupPermissions['user']['createtalk']      = true;
$wgGroupPermissions['user']['upload']          = true;
$wgGroupPermissions['user']['reupload']        = true;
$wgGroupPermissions['user']['reupload-shared'] = true;
$wgGroupPermissions['user']['minoredit']       = true;

# Implicit group for accounts that pass $wgAutoConfirmAge
$wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true;

# Implicit group for accounts with confirmed email addresses
$wgGroupPermissions['emailconfirmed']['emailconfirmed'] = true;

# Permission to change users' group assignments
$wgGroupPermissions['*']['userrights']          = false;
$wgGroupPermissions['bureaucrat']['userrights'] = true;

# Group for all logged-in accounts who had their email confirmed and have been
# accepted as editors.
$wgGroupPermissions['wikieditor']['move']            = true;
$wgGroupPermissions['wikieditor']['read']            = true;
$wgGroupPermissions['wikieditor']['edit']            = true;
$wgGroupPermissions['wikieditor']['createpage']      = true;
$wgGroupPermissions['wikieditor']['createtalk']      = true;
$wgGroupPermissions['wikieditor']['upload']          = true;
$wgGroupPermissions['wikieditor']['reupload']        = true;
$wgGroupPermissions['wikieditor']['reupload-shared'] = true;
$wgGroupPermissions['wikieditor']['minoredit']       = true;

$wgGroupPermissions['sysop']['move']            = true;
$wgGroupPermissions['sysop']['read']            = true;
$wgGroupPermissions['sysop']['edit']            = true;
$wgGroupPermissions['sysop']['createpage']      = true;
$wgGroupPermissions['sysop']['createtalk']      = true;
$wgGroupPermissions['sysop']['upload']          = true;
$wgGroupPermissions['sysop']['reupload']        = true;
$wgGroupPermissions['sysop']['reupload-shared'] = true;
$wgGroupPermissions['sysop']['minoredit']       = true;
$wgGroupPermissions['sysop']['setstatus']       = true;
$wgGroupPermissions['sysop']['checkuser']       = true;

## CheckUser stuff
$wgGroupPermissions['sysop']['checkuser']       = true;

$wgCheckUserLog = "$IP/cz_checkuser.log";

$wgCUDMaxAge = 5 * 12 * 30 * 24 * 3600; ## Approxmiately 5 years

## Temporary turn off all editing
#$wgGroupPermissions['*' ]['edit']       = false;
#$wgGroupPermissions['*' ]['createpage']  = false;
#$wgGroupPermissions['*' ]['createtalk']  = false;
#$wgGroupPermissions['*' ]['upload']  = false;
#$wgGroupPermissions['*' ]['reupload']  = false;

## Handle with care
$wgGroupPermissions['*']['nukerevision'] = false;
$wgGroupPermissions['Dark Knight']['nukerevision'] = true;

## Who can set the "from Wikipedia" flag?
$wgGroupPermissions['*']['setwpfrom'] = true;

$wgWhitelistRead = array ( "Main Page", "Special:Userlogin", "Special:Preferences","Special:Specialpages","Special:Confirmemail", "Special:Userlogout", "SITENAME:Help","MediaWiki:Monobook.css","-" );

## What file types are we allowed to upload?
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'svg' );

$wgCategoryPagingLimit = 400;

/** Enable for more detailed by-function times in debug log */
$wgProfiling    = true;
/** Only record profiling info for pages that took longer than this */
$wgProfileLimit = 1.0;
/** Don't put non-profiling info into log file */
$wgProfileOnly  = false;
/** Log sums from profiling into "profiling" table in db. */
$wgProfileToDatabase = true;
/** Only profile every n requests when profiling is turned on */
$wgProfileSampleRate = 1;
/** If true, print a raw call tree instead of per-function report */
$wgProfileCallTree = false;
/** If not empty, specifies profiler type to load */
$wgProfilerType = '';

$wgJobRunRate = 0;

$wgNoFollowLinks = false;

## This was so broken it is not even funny
$wgMediaHandlers = array(
    'jpeg' => 'BitmapHandler',
    'image/jpeg' => 'BitmapHandler',
    'image/png' => 'BitmapHandler',
    'png' => 'BitmapHandler',
    'image/gif' => 'BitmapHandler',
    'gif' => 'BitmapHandler',
    'image/x-ms-bmp' => 'BmpHandler',
    'image/svg+xml' => 'SvgHandler',
    'image/svg' => 'SvgHandler',
    'image/vnd.djvu' => 'DjVuHandler',
);

# The following three lines contradict settings later in thie file. moved to here
# for clarification. -emg
## This is causing problems uploading pngs, which come across as text/plain for some reason
#$wgVerifyMimeType= false;
#$wgLoadFileinfoExtension = true;

## Argh - the builtin is not detecting this well, so we need to go external:
# note I'm trying to use the builtin fileinfo PHP module, because 
# using file is not allowing svg or ogg to be uploaded -emg
$wgVerifyMimeType = true;

# commented out by me on 21 Oct 2007 -emg
## This was causing a large mess: the internal routines were not detecting pngs, 
## and the /usr/bin/file was failing at other things, such as svg.
## Final workaround is to use this, which detects both:
## /usr/bin/gnomevfs-info FILE | grep -m1 MIME | cut -c21-
## This is hardcoded into MimeMagic.php -Greg, Nov. 3, 2007
## Although the below is not used, it must be set to something so that 
## the section in MimeMagic.php is called.
$wgMimeDetectorCommand= "/usr/bin/file -bi"; ## Uses /usr/share/file/magic.mime

$wgTrivialMimeDetection= true;

## Confirm Account page rights
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['confirmaccount'] = false;
$wgGroupPermissions['bureaucrat']['confirmaccount'] = true;
$wgGroupPermissions['sysop']['confirmaccount'] = true;
$wgGroupPermissions['epa']['confirmaccount'] = true;
$wgGroupPermissions['epa']['requestips'] = true;

## Allow some other people to rename users
$wgGroupPermissions['Linnaeus']['renameuser'] = true;
$wgGroupPermissions['bureaucrat']['renameuser'] = true;

# 'Approv' covers "Approval" and "Approved"
#$wgExtraRandompageSQL = "NOT page_title ~ '/Approv' AND NOT page_title ~ '/Unused' AND NOT page_title ~ '/Bibliography'";
$wgExtraRandompageSQL = "NOT page_title ~ '/' AND page_len > 20000";

# We don't want to count some things as 'short' pages
$wgExtraShortpageSQL = "
  NOT page_title ~ '/Approv' AND 
  NOT page_title ~ '/Unused' AND 
  NOT page_title ~ '/Bibliography' AND
  NOT page_title ~ '/Related' AND
  NOT page_title ~ '/External' 
";

$wgShowCompleteCategoryCount = true;

## Per Zach's request on November 13, 2007 - Greg
$wgMaxArticleSize = 4096; # Maximum article size in kilobytes

$wgAccountRequestTypes = array( 
  0 => array( 'authors', 'user', '' ),
  1 => array( 'editors', 'wikieditor', '[[Category:CZ Editors]]' )
  );

$wgMinimalPasswordLength = 5;

$wgUploadNavigationUrl = 'http://localhost/wiki/CZ:Upload';

$wgEnableMWSuggest = true;

## DEBUGGING
## Keep at bottom please, and leave turned off except when absolutely needed 
## for live debugging purposes

$wgShowExceptionDetails = 0;

#$wgDebugLogFile        = "/tmp/mwdebug.log";

#$wgReadOnlyFile         = "$IP/readonly";


?>