MediaWiki file: addSite.php
Location: maintenance/
Source code: master 1.40.0 1.39.4 1.35.11
Classes: AddSite

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

Usage

php maintenance/addSite.php globalid group [ --language| --interwiki-id| --navigation-id| --pagepath| --filepath ]

Adding site with basic config

Terminal
$ php maintenance/addSite.php wikisite1 mywikigroup

Done. Reload the web server and other long-running PHP processes to refresh the local-server cache of the sites table.

Adding site with language

Terminal
$ php maintenance/addSite.php wikisite1 mywikigroup --language hi

Done. Reload the web server and other long-running PHP processes to refresh the local-server cache of the sites table.

Adding site with filepath and pagepath

Terminal
$ php maintenance/addSite.php wikisite1 mywikigroup --filepath "https://www.wikisite1.org/$1" --pagepath "https://www.wikisite1.org/index.php/$1"

Done. Reload the web server and other long-running PHP processes to refresh the local-server cache of the sites table.
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

This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.