Go to the documentation of this file.
55 $confItems = array_merge(
57 'wgServer',
'wgScriptPath',
'wgScriptExtension',
58 'wgPasswordSender',
'wgImageMagickConvertCommand',
'wgShellLocale',
59 'wgLanguageCode',
'wgEnableEmail',
'wgEnableUserEmail',
'wgDiff3',
60 'wgEnotifUserTalk',
'wgEnotifWatchlist',
'wgEmailAuthentication',
61 'wgDBtype',
'wgSecretKey',
'wgRightsUrl',
'wgSitename',
'wgRightsIcon',
62 'wgRightsText',
'wgMainCacheType',
'wgEnableUploads',
63 'wgMainCacheType',
'_MemCachedServers',
'wgDBserver',
'wgDBuser',
64 'wgDBpassword',
'wgUseInstantCommons',
'wgUpgradeKey',
'wgDefaultSkin',
65 'wgMetaNamespace',
'wgResourceLoaderMaxQueryLength',
'wgLogo',
70 $unescaped =
array(
'wgRightsIcon',
'wgLogo' );
72 'wgEnableEmail',
'wgEnableUserEmail',
'wgEnotifUserTalk',
73 'wgEnotifWatchlist',
'wgEmailAuthentication',
'wgEnableUploads',
'wgUseInstantCommons'
76 foreach ( $confItems
as $c ) {
79 if ( in_array( $c, $boolItems ) ) {
83 if ( !in_array( $c, $unescaped ) && $val !==
null ) {
90 $this->dbSettings = $db->getLocalSettings();
92 $this->
values[
'wgEmergencyContact'] = $this->
values[
'wgPasswordSender'];
102 $this->groupPermissions[$group] = $rightsArr;
113 if ( is_array( $string ) || is_object( $string ) ) {
139 if ( count( $this->extensions ) ) {
141 # Enabled Extensions. Most extensions are enabled by including the base extension file here
142 # but check specific extension documentation for more details
143 # The following extensions were automatically enabled:\n";
145 foreach ( $this->extensions
as $extName ) {
147 $localSettings .=
"require_once \"\$IP/extensions/$encExtName/$encExtName.php\";\n";
151 $localSettings .=
"\n\n# End of automatically generated settings.
152 # Add more configuration options below.\n\n";
154 return $localSettings;
163 file_put_contents( $fileName, $this->
getText() );
170 $servers = $this->
values[
'_MemCachedServers'];
176 $servers = explode(
',', $servers );
178 foreach ( $servers
as $srv ) {
183 return rtrim(
$ret,
', ' ) .
' )';
191 if ( !$this->
values[
'wgImageMagickConvertCommand'] ) {
192 $this->
values[
'wgImageMagickConvertCommand'] =
'/usr/bin/convert';
198 if ( !$this->
values[
'wgShellLocale'] ) {
199 $this->
values[
'wgShellLocale'] =
'en_US.UTF-8';
206 $hashedUploads = $this->safeMode ?
'' :
'#';
208 if ( $this->
values[
'wgMetaNamespace'] !== $this->
values[
'wgSitename'] ) {
209 $metaNamespace =
"\$wgMetaNamespace = \"{$this->values['wgMetaNamespace']}\";\n";
214 if ( $this->groupPermissions ) {
215 $groupRights .=
"# The following permissions were set based on your choice in the installer\n";
216 foreach ( $this->groupPermissions
as $group => $rightArr ) {
218 foreach ( $rightArr
as $right => $perm ) {
220 $groupRights .=
"\$wgGroupPermissions['$group']['$right'] = " .
224 if ( $this->groupPermissions[
'*'][
'edit'] ===
false
225 && $this->groupPermissions[
'*'][
'createaccount'] ===
false
226 && $this->groupPermissions[
'*'][
'read'] !==
false
228 $noFollow =
"\n# Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n"
229 .
"# the general public and wish to apply nofollow to external links as a\n"
230 .
"# deterrent to spammers. Nofollow is not a comprehensive anti-spam solution\n"
231 .
"# and open wikis will generally require other anti-spam measures; for more\n"
232 .
"# information, see https://www.mediawiki.org/wiki/Manual:Combating_spam\n"
233 .
"\$wgNoFollowLinks = false;";
238 if ( array_key_exists(
'wgServer', $this->
values ) && $this->
values[
'wgServer'] !==
null ) {
239 $serverSetting =
"\n## The protocol and server name to use in fully-qualified URLs\n";
240 $serverSetting .=
"\$wgServer = \"{$this->values['wgServer']}\";\n";
243 switch ( $this->
values[
'wgMainCacheType'] ) {
248 $cacheType =
'CACHE_' . strtoupper( $this->
values[
'wgMainCacheType'] );
252 $cacheType =
'CACHE_NONE';
258 # This file was automatically generated by the MediaWiki {$GLOBALS['wgVersion']}
259 # installer. If you make manual changes, please keep track in case you
260 # need to recreate them later.
262 # See includes/DefaultSettings.php for all configurable settings
263 # and their default values, but don't forget to make changes in _this_
266 # Further documentation for configuration settings may be found at:
267 # https://www.mediawiki.org/wiki/Manual:Configuration_settings
269 # Protect against web entry
270 if ( !defined( 'MEDIAWIKI' ) ) {
274 ## Uncomment this to disable output compression
275 # \$wgDisableOutputCompression = true;
277 \$wgSitename = \"{$this->values['wgSitename']}\";
279 ## The URL base path to the directory containing the wiki;
280 ## defaults for all runtime URL paths are based off of this.
281 ## For more information on customizing the URLs
282 ## (like /w/index.php/Page_title to /wiki/Page_title) please see:
283 ## https://www.mediawiki.org/wiki/Manual:Short_URL
284 \$wgScriptPath = \"{$this->values['wgScriptPath']}\";
285 \$wgScriptExtension = \"{$this->values['wgScriptExtension']}\";
287 ## The relative URL path to the skins directory
288 \$wgStylePath = \"\$wgScriptPath/skins\";
290 ## The relative URL path to the logo. Make sure you change this from the default,
291 ## or else you'll overwrite your logo when you upgrade!
292 \$wgLogo = \"{$this->values['wgLogo']}\";
294 ## UPO means: this is also a user preference option
296 \$wgEnableEmail = {$this->values['wgEnableEmail']};
297 \$wgEnableUserEmail = {$this->values['wgEnableUserEmail']}; # UPO
299 \$wgEmergencyContact = \"{$this->values['wgEmergencyContact']}\";
300 \$wgPasswordSender = \"{$this->values['wgPasswordSender']}\";
302 \$wgEnotifUserTalk = {$this->values['wgEnotifUserTalk']}; # UPO
303 \$wgEnotifWatchlist = {$this->values['wgEnotifWatchlist']}; # UPO
304 \$wgEmailAuthentication = {$this->values['wgEmailAuthentication']};
307 \$wgDBtype = \"{$this->values['wgDBtype']}\";
308 \$wgDBserver = \"{$this->values['wgDBserver']}\";
309 \$wgDBname = \"{$this->values['wgDBname']}\";
310 \$wgDBuser = \"{$this->values['wgDBuser']}\";
311 \$wgDBpassword = \"{$this->values['wgDBpassword']}\";
315 ## Shared memory settings
316 \$wgMainCacheType = $cacheType;
317 \$wgMemCachedServers = $mcservers;
319 ## To enable image uploads, make sure the 'images' directory
320 ## is writable, then set this to true:
321 \$wgEnableUploads = {$this->values['wgEnableUploads']};
322 {$magic}\$wgUseImageMagick = true;
323 {$magic}\$wgImageMagickConvertCommand = \"{$this->values['wgImageMagickConvertCommand']}\";
325 # InstantCommons allows wiki to use images from http://commons.wikimedia.org
326 \$wgUseInstantCommons = {$this->values['wgUseInstantCommons']};
328 ## If you use ImageMagick (or any other shell command) on a
329 ## Linux server, this will need to be set to the name of an
330 ## available UTF-8 locale
331 {$locale}\$wgShellLocale = \"{$this->values['wgShellLocale']}\";
333 ## If you want to use image uploads under safe mode,
334 ## create the directories images/archive, images/thumb and
335 ## images/temp, and make them all writable. Then uncomment
336 ## this, if it's not already uncommented:
337 {$hashedUploads}\$wgHashedUploadDirectory = false;
339 ## Set \$wgCacheDirectory to a writable directory on the web server
340 ## to make your wiki go slightly faster. The directory should not
341 ## be publically accessible from the web.
342 #\$wgCacheDirectory = \"\$IP/cache\";
344 # Site language code, should be one of the list in ./languages/Names.php
345 \$wgLanguageCode = \"{$this->values['wgLanguageCode']}\";
347 \$wgSecretKey = \"{$this->values['wgSecretKey']}\";
349 # Site upgrade key. Must be set to a string (default provided) to turn on the
350 # web installer while LocalSettings.php is in place
351 \$wgUpgradeKey = \"{$this->values['wgUpgradeKey']}\";
353 ## Default skin: you can change the default skin. Use the internal symbolic
354 ## names, ie 'cologneblue', 'monobook', 'vector':
355 \$wgDefaultSkin = \"{$this->values['wgDefaultSkin']}\";
357 ## For attaching licensing metadata to pages, and displaying an
358 ## appropriate copyright notice / icon. GNU Free Documentation
359 ## License and Creative Commons licenses are supported so far.
360 \$wgRightsPage = \"\"; # Set to the title of a wiki page that describes your license/copyright
361 \$wgRightsUrl = \"{$this->values['wgRightsUrl']}\";
362 \$wgRightsText = \"{$this->values['wgRightsText']}\";
363 \$wgRightsIcon = \"{$this->values['wgRightsIcon']}\";
365 # Path to the GNU diff3 utility. Used for conflict resolution.
366 \$wgDiff3 = \"{$this->values['wgDiff3']}\";
368 {$groupRights}{$noFollow}";
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
writeFile( $fileName)
Write the generated LocalSettings to a file.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
return false if a UserGetRights hook might remove the named right $right
wfBoolToStr( $value)
Convenience function converts boolean values into "true" or "false" (string) values.
buildMemcachedServerList()
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
__construct(Installer $installer)
Constructor.
getText()
Return the full text of the generated LocalSettings.php file, including the extensions.
getVar( $name, $default=null)
Get an MW configuration variable, or internal installer configuration variable.
getDBInstaller( $type=false)
Get an instance of DatabaseInstaller for the specified DB type.
Class for generating LocalSettings.php file.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static escapePhpString( $string)
Returns the escaped version of a string of php code.
setGroupRights( $group, $rightsArr)
For $wgGroupPermissions, set a given ['group']['permission'] value.
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible values