Manual:AddSite.php

Category:MediaWiki code#AddSite.php

Details

addSite.php is a maintenance script that adds a site definition to the sites database table.

Options/Arguments

OptionDescriptionRequiredDefault value
globalidGlobal id of the site to addRequired
groupWhich group this site should be sorted inRequired
--languageLanguage code of the site, for example: "hi"Optional
--interwiki-idInterwiki ID of the siteOptional
--navigation-idNavigation ID of the siteOptional
--pagepathURL to pages of this site, for example: https://example.com/wiki/$1Optional
--filepathURL to files of this site, for example: https://example.com/w/$1Optional

Note that if you are setting up a Wikibase, all the parameters are required.

Usage

php maintenance/run.php addSite globalid group [ --language| --interwiki-id| --navigation-id| --pagepath| --filepath ]
In MediaWiki version 1.39.12 and earlier, you must invoke maintenance scripts using php maintenance/scriptName.php instead of php maintenance/run.php scriptName.

Adding site with basic config

Terminal

Adding site with language

Terminal

Adding site with filepath and pagepath

Terminal
Tip: The sites table is cached in the local-server cache, so you should reload your webserver and other long-running MediaWiki PHP processes after running this script.

See also

Category:Maintenance scripts Category:Development maintenance scripts
Category:Development maintenance scripts Category:Maintenance scripts Category:MediaWiki code