User:Daniel Mietchen/Sandbox/PHP/1

<?php


 * 1) Citizendium's master control file
 * 2) Don't edit unless you really know what you are doing.
 * 3) (The following text changed by dnessett)
 * 4) This file is kept in phase3/config and the subversion
 * 5) repository is set up to ignore LocalSettings.php in phase3.
 * 6) Consequently, for a fresh install, this file should be moved
 * 7) to phase3 and edited appropriately. If you make changes to this
 * 8) file and commiting to config, describe what you did and why you did it.
 * 9) Initial your changes. If you are changing this file on the live wiki
 * 10) (as opposed to a CZ clone), remember to copy it to the both servers.
 * 11) 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";

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

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";

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

$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 = '';

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


 * 1) Not working yet: current error is:
 * 2) FIXED Call to undefined method Xml::textarea in ...SpecialNewsletterMassMailer.php on line 192
 * 3) FIXED Call to undefined method OutputPage::buildCssLinks in ..Newsletter.body.php
 * 4) 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" );


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

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

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

$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";

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

$wgAllowUserJs     = true; $wgAllowUserCss    = true; $wgUseSiteJs       = true;
 * 1) Turned on 3-12-07 for WikiED

$wgEnableEmail        = true; $wgEnableUserEmail    = true; $wgEnotifUserTalk     = true; $wgEnotifWatchlist    = true; $wgEmailAuthentication = true; $wgEmailConfirmToEdit = true;
 * 1) Enable email notifications

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

$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;

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

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

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

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

$wgLocalInterwiki  = $wgSitename;

$wgSecretKey = "eddffd9daa080f2235966482f645399338bf968ff73596a214733f610feebfdf";
 * 1) $wgProxyKey deprecated since MW 1.4. Using $wgSecretKey instead. -dnessett
 * 2) $wgProxyKey = "ccfe740e0734927437d104f513a2e35c4401771cf6bbcbeca7baef794052dad1";

$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";

$configdate = gmdate( 'YmdHis', @filemtime( __FILE__ ) ); $wgCacheEpoch = max( $wgCacheEpoch, $configdate );
 * 1) When you make changes to this configuration file, this will make
 * 2) sure that cached pages are cleared.

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

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

$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;
 * 1) Implicit group for all logged-in accounts

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

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

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

$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;
 * 1) Group for all logged-in accounts who had their email confirmed and have been
 * 2) accepted as editors.

$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;

$wgGroupPermissions['sysop']['checkuser']      = true;
 * 1) CheckUser stuff

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

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


 * 1) Temporary turn off all editing
 * 2) $wgGroupPermissions['*' ]['edit']      = false;
 * 3) $wgGroupPermissions['*' ]['createpage'] = false;
 * 4) $wgGroupPermissions['*' ]['createtalk'] = false;
 * 5) $wgGroupPermissions['*' ]['upload'] = false;
 * 6) $wgGroupPermissions['*' ]['reupload'] = false;

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

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

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

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

$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;

$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', );
 * 1) This was so broken it is not even funny


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

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

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

$wgTrivialMimeDetection= true;

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

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

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

$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' ";
 * 1) We don't want to count some things as 'short' pages

$wgShowCompleteCategoryCount = true;

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

$wgAccountRequestTypes = array(  0 => array( 'authors', 'user',  ),  1 => array( 'editors', 'wikieditor',  )  );

$wgMinimalPasswordLength = 5;

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

$wgEnableMWSuggest = true;


 * 1) DEBUGGING
 * 2) Keep at bottom please, and leave turned off except when absolutely needed
 * 3) for live debugging purposes

$wgShowExceptionDetails = 0;


 * 1) $wgDebugLogFile       = "/tmp/mwdebug.log";


 * 1) $wgReadOnlyFile        = "$IP/readonly";

?>