Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P6911
LocalSettings.php
Active
Public
Actions
Authored by
Huji
on Mar 28 2018, 2:29 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F16291300: LocalSettings.php
Mar 28 2018, 2:29 AM
2018-03-28 02:29:54 (UTC+0)
Subscribers
None
<?php
# Protect against web entry
if
(
!
defined
(
'MEDIAWIKI'
)
)
{
exit
;
}
# Choose the right wiki to show
if
(
defined
(
'MW_DB'
)
)
{
$wikiId
=
MW_DB
;
}
elseif
(
isset
(
$_SERVER
[
'SERVER_NAME'
])
&&
$_SERVER
[
'SERVER_NAME'
]
==
'en.localhost'
)
{
$wikiId
=
'enwiki'
;
}
elseif
(
isset
(
$_SERVER
[
'SERVER_NAME'
])
&&
$_SERVER
[
'SERVER_NAME'
]
==
'meta.localhost'
)
{
$wikiId
=
'metawiki'
;
}
else
{
echo
'Unable to determine $wikiId'
.
"
\n
"
;
exit
(
1
);
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
$wgSitename
=
$wikiId
;
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath
=
""
;
## The protocol and server name to use in fully-qualified URLs
$wgServer
=
"http://"
.
str_replace
(
"wiki"
,
""
,
$wikiId
)
.
".localhost"
;
## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath
=
$wgScriptPath
;
## The URL path to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogo
=
"$wgResourceBasePath/resources/assets/wiki.png"
;
## ...
## Database settings
$wgDBtype
=
"mysql"
;
$wgDBserver
=
"localhost"
;
$wgDBname
=
$wikiId
;
$wgDBuser
=
"root"
;
$wgDBpassword
=
"password"
;
# MySQL specific settings
$wgDBprefix
=
""
;
# MySQL table options to use during installation or update
$wgDBTableOptions
=
"ENGINE=InnoDB, DEFAULT CHARSET=binary"
;
# Experimental charset support for MySQL 5.0.
$wgDBmysql5
=
false
;
## Vector skin
wfLoadSkin
(
'Vector'
);
# Site language code, should be one of the list in ./languages/data/Names.php
if
(
$wikiId
==
'enwiki'
)
{
$wgLanguageCode
=
"en"
;
$wgSecretKey
=
"704352ff89c1d2ef72156e8da04620de85dc56d69dcfe180c82e0794df6e0e20"
;
$wgAuthenticationTokenVersion
=
"1"
;
$wgUpgradeKey
=
"ee0cdab2beb9cba5"
;
}
else
{
#metawiki
$wgLanguageCode
=
"en"
;
$wgSecretKey
=
"e905f7281e9071388db40d841133e7115820934ee602f89ba403619d4ae5ba50"
;
$wgAuthenticationTokenVersion
=
"1"
;
$wgUpgradeKey
=
"7812b3852e18f46d"
;
}
## CentralAuth
require_once
"$IP/extensions/CentralAuth/CentralAuth.php"
;
# General CentralAuth configuration
# $wgCentralAuthAutoNew = true;
$wgCentralAuthAutoMigrate
=
true
;
$wgCentralAuthCookies
=
true
;
# $wgCentralAuthCookieDomain = '*.localhost';
# Create the local account on pageview, set false to require a local login to create it.
$wgCentralAuthCreateOnView
=
true
;
# Skips the "login success" page
# $wgCentralAuthSilentLogin = true;
# Auto-login
$wgCentralAuthAutoLoginWikis
=
[
'en.localhost'
=>
'enwiki'
,
'meta.localhost'
=>
'metawiki'
];
$wgCentralAuthLoginWiki
=
'metawiki'
;
// You can't just set wgConf values to the globals defined in Setup.php for your
// local wiki, because it hasn't run yet. You could hard-code $wgConf settings
// here, but instead we set the wgConf values in a hook that runs later.
$wgConf
=
new
SiteConfiguration
;
# Read wiki lists
$wgLocalDatabases
=
array
(
'enwiki'
,
'metawiki'
);
$wgConf
->
wikis
=
$wgLocalDatabases
;
$wgConf
->
suffixes
=
array
(
'wiki'
);
//We have the same suffix of wiki
//all databases have suffix wiki
$wgConf
->
suffixes
=
$wgLocalDatabases
;
$wgConf
->
localVHosts
=
array
(
'localhost'
);
//your database server. could be example.com or IP address. no http://
$wgConf
->
siteParamsCallback
=
'efGetSiteParams'
;
$wgConf
->
extractAllGlobals
(
$wgDBname
);
$wgConf
->
settings
=
array
(
'wgServer'
=>
array
(
'enwiki'
=>
'http://en.localhost'
,
'metawiki'
=>
'http://meta.localhost'
,
),
'wgCanonicalServer'
=>
array
(
'enwiki'
=>
'http://en.localhost'
,
'metawiki'
=>
'http://meta.localhost'
,
),
'wgScriptPath'
=>
array
(
'default'
=>
''
,
),
'wgArticlePath'
=>
array
(
'default'
=>
'/index.php?title=$1'
,
),
'wgLanguageCode'
=>
array
(
'enwiki'
=>
'en'
,
'metawiki'
=>
'meta'
,
),
'wgLocalInterwiki'
=>
array
(
'enwiki'
=>
'en'
,
'metawiki'
=>
'meta'
,
),
'wgAddGroups'
=>
array
(
'default'
=>
array
(
'bureaucract'
=>
[
'sysop'
,
'bureaucrat'
],
),
),
);
function
efGetSiteParams
(
$conf
,
$wiki
)
{
$site
=
null
;
$lang
=
null
;
foreach
(
$conf
->
suffixes
as
$suffix
)
{
if
(
substr
(
$wiki
,
-
strlen
(
$suffix
)
)
==
$suffix
)
{
$site
=
$suffix
;
$lang
=
substr
(
$wiki
,
0
,
-
strlen
(
$suffix
)
);
break
;
}
}
return
array
(
'suffix'
=>
$site
,
'lang'
=>
$lang
,
'params'
=>
array
(
'lang'
=>
$lang
,
'site'
=>
$site
,
'wiki'
=>
$wiki
,
),
'tags'
=>
array
(),
);
}
## Error reporting
error_reporting
(
-
1
);
ini_set
(
'display_errors'
,
1
);
$wgShowSQLErrors
=
true
;
$wgDebugDumpSql
=
true
;
$wgShowExceptionDetails
=
true
;
$wgShowDBErrorBacktrace
=
true
;
## Group rights
$wgGroupPermissions
[
'steward'
][
'userrights'
]
=
true
;
$wgGroupPermissions
[
'steward'
][
'userrights-interwiki'
]
=
true
;
# $wgGroupPermissions['steward']['centralauth-lock'] = true;
Event Timeline
Huji
created this paste.
Mar 28 2018, 2:29 AM
2018-03-28 02:29:54 (UTC+0)
Huji
mentioned this in
T190898: CentralAuth makes phpunit.php crash with an exception
.
Log In to Comment