defaultsettings.php
来自「php 开发的内容管理系统」· PHP 代码 · 共 1,966 行 · 第 1/5 页
PHP
1,966 行
<?php/** * * NEVER EDIT THIS FILE * * * To customize your installation, edit "LocalSettings.php". If you make * changes here, they will be lost on next upgrade of MediaWiki! * * Note that since all these string interpolations are expanded * before LocalSettings is included, if you localize something * like $wgScriptPath, you must also localize everything that * depends on it. * * Documentation is in the source and on: * http://www.mediawiki.org/wiki/Help:Configuration_settings * * @package MediaWiki */# This is not a valid entry point, perform no further processing unless MEDIAWIKI is definedif( !defined( 'MEDIAWIKI' ) ) { echo "This file is part of MediaWiki and is not a valid entry point\n"; die( -1 );}/** * Create a site configuration object * Not used for much in a default install */// Modified for mediawiki for XOOPS - by D.J.require_once( dirname(__FILE__).'/SiteConfiguration.php' );$wgConf = new SiteConfiguration;/** MediaWiki version number */$wgVersion = '1.7.1';/** Name of the site. It must be changed in LocalSettings.php */$wgSitename = 'MediaWiki';/** Will be same as you set @see $wgSitename */$wgMetaNamespace = FALSE;/** URL of the server. It will be automatically built including https mode */$wgServer = '';if( isset( $_SERVER['SERVER_NAME'] ) ) { $wgServerName = $_SERVER['SERVER_NAME'];} elseif( isset( $_SERVER['HOSTNAME'] ) ) { $wgServerName = $_SERVER['HOSTNAME'];} elseif( isset( $_SERVER['HTTP_HOST'] ) ) { $wgServerName = $_SERVER['HTTP_HOST'];} elseif( isset( $_SERVER['SERVER_ADDR'] ) ) { $wgServerName = $_SERVER['SERVER_ADDR'];} else { $wgServerName = 'localhost';}# check if server use https:$wgProto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';$wgServer = $wgProto.'://' . $wgServerName;# If the port is a non-standard one, add it to the URLif( isset( $_SERVER['SERVER_PORT'] ) && !strpos( $wgServerName, ':' ) && ( ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 ) || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) { $wgServer .= ":" . $_SERVER['SERVER_PORT'];}/** * The path we should point to. * It might be a virtual path in case with use apache mod_rewrite for example */$wgScriptPath = '/wiki';/** * Whether to support URLs like index.php/Page_title * @global bool $wgUsePathInfo */$wgUsePathInfo = ( strpos( php_sapi_name(), 'cgi' ) === false );/**#@+ * Script users will request to get articles * ATTN: Old installations used wiki.phtml and redirect.phtml - * make sure that LocalSettings.php is correctly set! * @deprecated *//** * @global string $wgScript */$wgScript = "{$wgScriptPath}/index.php";/** * @global string $wgRedirectScript */$wgRedirectScript = "{$wgScriptPath}/redirect.php";/**#@-*//**#@+ * @global string *//** * style path as seen by users * @global string $wgStylePath */$wgStylePath = "{$wgScriptPath}/skins";/** * filesystem stylesheets directory * @global string $wgStyleDirectory */$wgStyleDirectory = "{$IP}/skins";$wgStyleSheetPath = &$wgStylePath;$wgArticlePath = "{$wgScript}?title=$1";$wgUploadPath = "{$wgScriptPath}/upload";$wgUploadDirectory = "{$IP}/upload";$wgHashedUploadDirectory = true;$wgLogo = "{$wgUploadPath}/wiki.png";$wgFavicon = '/favicon.ico';$wgMathPath = "{$wgUploadPath}/math";$wgMathDirectory = "{$wgUploadDirectory}/math";$wgTmpDirectory = "{$wgUploadDirectory}/tmp";$wgUploadBaseUrl = "";/**#@-*//** * By default deleted files are simply discarded; to save them and * make it possible to undelete images, create a directory which * is writable to the web server but is not exposed to the internet. * * Set $wgSaveDeletedFiles to true and set up the save path in * $wgFileStore['deleted']['directory']. */$wgSaveDeletedFiles = false;/** * New file storage paths; currently used only for deleted files. * Set it like this: * * $wgFileStore['deleted']['directory'] = '/var/wiki/private/deleted'; * */$wgFileStore = array();$wgFileStore['deleted']['directory'] = null; // Don't forget to set this.$wgFileStore['deleted']['url'] = null; // Private$wgFileStore['deleted']['hash'] = 3; // 3-level subdirectory split/** * Allowed title characters -- regex character class * Don't change this unless you know what you're doing * * Problematic punctuation: * []{}|# Are needed for link syntax, never enable these * % Enabled by default, minor problems with path to query rewrite rules, see below * + Doesn't work with path to query rewrite rules, corrupted by apache * ? Enabled by default, but doesn't work with path to PATH_INFO rewrites * * All three of these punctuation problems can be avoided by using an alias, instead of a * rewrite rule of either variety. * * The problem with % is that when using a path to query rewrite rule, URLs are * double-unescaped: once by Apache's path conversion code, and again by PHP. So * %253F, for example, becomes "?". Our code does not double-escape to compensate * for this, indeed double escaping would break if the double-escaped title was * passed in the query string rather than the path. This is a minor security issue * because articles can be created such that they are hard to view or edit. * * Theoretically 0x80-0x9F of ISO 8859-1 should be disallowed, but * this breaks interlanguage links */$wgLegalTitleChars = " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF";/** * The external URL protocols */$wgUrlProtocols = array( 'http://', 'https://', 'ftp://', 'irc://', 'gopher://', 'telnet://', // Well if we're going to support the above.. -忙var 'nntp://', // @bug 3808 RFC 1738 'worldwind://', 'mailto:', 'news:');/** internal name of virus scanner. This servers as a key to the $wgAntivirusSetup array. * Set this to NULL to disable virus scanning. If not null, every file uploaded will be scanned for viruses. * @global string $wgAntivirus */$wgAntivirus= NULL;/** Configuration for different virus scanners. This an associative array of associative arrays: * it contains on setup array per known scanner type. The entry is selected by $wgAntivirus, i.e. * valid values for $wgAntivirus are the keys defined in this array. * * The configuration array for each scanner contains the following keys: "command", "codemap", "messagepattern"; * * "command" is the full command to call the virus scanner - %f will be replaced with the name of the * file to scan. If not present, the filename will be appended to the command. Note that this must be * overwritten if the scanner is not in the system path; in that case, plase set * $wgAntivirusSetup[$wgAntivirus]['command'] to the desired command with full path. * * "codemap" is a mapping of exit code to return codes of the detectVirus function in SpecialUpload. * An exit code mapped to AV_SCAN_FAILED causes the function to consider the scan to be failed. This will pass * the file if $wgAntivirusRequired is not set. * An exit code mapped to AV_SCAN_ABORTED causes the function to consider the file to have an usupported format, * which is probably imune to virusses. This causes the file to pass. * An exit code mapped to AV_NO_VIRUS will cause the file to pass, meaning no virus was found. * All other codes (like AV_VIRUS_FOUND) will cause the function to report a virus. * You may use "*" as a key in the array to catch all exit codes not mapped otherwise. * * "messagepattern" is a perl regular expression to extract the meaningful part of the scanners * output. The relevant part should be matched as group one (\1). * If not defined or the pattern does not match, the full message is shown to the user. * * @global array $wgAntivirusSetup */$wgAntivirusSetup= array( #setup for clamav 'clamav' => array ( 'command' => "clamscan --no-summary ", 'codemap'=> array ( "0"=> AV_NO_VIRUS, #no virus "1"=> AV_VIRUS_FOUND, #virus found "52"=> AV_SCAN_ABORTED, #unsupported file format (probably imune) "*"=> AV_SCAN_FAILED, #else scan failed ), 'messagepattern'=> '/.*?:(.*)/sim', ), #setup for f-prot 'f-prot' => array ( 'command' => "f-prot ", 'codemap'=> array ( "0"=> AV_NO_VIRUS, #no virus "3"=> AV_VIRUS_FOUND, #virus found "6"=> AV_VIRUS_FOUND, #virus found "*"=> AV_SCAN_FAILED, #else scan failed ), 'messagepattern'=> '/.*?Infection:(.*)$/m', ),);/** Determines if a failed virus scan (AV_SCAN_FAILED) will cause the file to be rejected. * @global boolean $wgAntivirusRequired*/$wgAntivirusRequired= true;/** Determines if the mime type of uploaded files should be checked * @global boolean $wgVerifyMimeType*/$wgVerifyMimeType= true;/** Sets the mime type definition file to use by MimeMagic.php.* @global string $wgMimeTypeFile*/#$wgMimeTypeFile= "/etc/mime.types";$wgMimeTypeFile= "includes/mime.types";#$wgMimeTypeFile= NULL; #use built-in defaults only./** Sets the mime type info file to use by MimeMagic.php.* @global string $wgMimeInfoFile*/$wgMimeInfoFile= "includes/mime.info";#$wgMimeInfoFile= NULL; #use built-in defaults only./** Switch for loading the FileInfo extension by PECL at runtime.* This should be used only if fileinfo is installed as a shared object / dynamic libary* @global string $wgLoadFileinfoExtension*/$wgLoadFileinfoExtension= false;/** Sets an external mime detector program. The command must print only the mime type to standard output.* the name of the file to process will be appended to the command given here.* If not set or NULL, mime_content_type will be used if available.*/$wgMimeDetectorCommand= NULL; # use internal mime_content_type function, available since php 4.3.0#$wgMimeDetectorCommand= "file -bi"; #use external mime detector (Linux)/** Switch for trivial mime detection. Used by thumb.php to disable all fance things,* because only a few types of images are needed and file extensions can be trusted.*/$wgTrivialMimeDetection= false;/** * To set 'pretty' URL paths for actions other than * plain page views, add to this array. For instance: * 'edit' => "$wgScriptPath/edit/$1" * * There must be an appropriate script or rewrite rule * in place to handle these URLs. */$wgActionPaths = array();/** * 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 * $wgUploadDirectory. * If $wgUseSharedUploads is set, the wiki will look in the shared repository if * no file of the given name is found in the local repository (for [[Image:..]], * [[Media:..]] links). Thumbnails will also be looked for and generated in this * directory. */$wgUseSharedUploads = false;/** Full path on the web server where shared uploads can be found */$wgSharedUploadPath = "http://commons.wikimedia.org/shared/images";/** Fetch commons image description pages and display them on the local wiki? */$wgFetchCommonsDescriptions = false;/** Path on the file system where shared uploads can be found. */$wgSharedUploadDirectory = "/var/www/wiki3/images";/** DB name with metadata about shared directory. Set this to false if the uploads do not come from a wiki. */$wgSharedUploadDBname = false;/** Optional table prefix used in database. */$wgSharedUploadDBprefix = '';/** Cache shared metadata in memcached. Don't do this if the commons wiki is in a different memcached domain */$wgCacheSharedUploads = true;/** * Point the upload navigation link to an external URL * Useful if you want to use a shared repository by default * without disabling local uploads (use $wgEnableUploads = false for that) * e.g. $wgUploadNavigationUrl = 'http://commons.wikimedia.org/wiki/Special:Upload';*/$wgUploadNavigationUrl = false;/** * Give a path here to use thumb.php for thumbnail generation on client request, instead of * generating them on render and outputting a static URL. This is necessary if some of your * apache servers don't have read/write access to the thumbnail path. * * Example: * $wgThumbnailScriptPath = "{$wgScriptPath}/thumb.php"; */$wgThumbnailScriptPath = false;$wgSharedThumbnailScriptPath = false;/** * Set the following to false especially if you have a set of files that need to * be accessible by all wikis, and you do not want to use the hash (path/a/aa/) * directory layout. */$wgHashedSharedUploadDirectory = true;/** * Base URL for a repository wiki. Leave this blank if uploads are just stored * in a shared directory and not meant to be accessible through a separate wiki. * Otherwise the image description pages on the local wiki will link to the * image description page on this wiki. * * Please specify the namespace, as in the example below. */$wgRepositoryBaseUrl="http://commons.wikimedia.org/wiki/Image:";## Email settings#/** * Site admin email address * Default to wikiadmin@SERVER_NAME * @global string $wgEmergencyContact */$wgEmergencyContact = 'wikiadmin@' . $wgServerName;/** * Password reminder email address * The address we should use as sender when a user is requesting his password * Default to apache@SERVER_NAME * @global string $wgPasswordSender */$wgPasswordSender = 'MediaWiki Mail <apache@' . $wgServerName . '>';/** * dummy address which should be accepted during mail send action * It might be necessay to adapt the address or to set it equal * to the $wgEmergencyContact address */#$wgNoReplyAddress = $wgEmergencyContact;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?