Extension:CreateWiki

MediaWiki extensions manual
CreateWiki
Release status: stable
Description Provides a function that allows wiki creators to create new wiki sites within another wiki site. Creates 3 additional 'special pages' (RequestWiki, RequestWikiQueue, and CreateWiki).
Author(s) Southparkfan, John Lewis, Paladox, Universal Omega
Maintainer(s) Miraheze system administrators
Latest version continuous updates
MediaWiki 1.37.0+
PHP 7.4+
Database changes Yes
Composer miraheze/create-wiki
Tables cw_comments
cw_requests
cw_wikis
License GNU General Public License 3.0
Download
  • $wgCreateWikiUseExperimental
  • $wgCreateWikiCacheDirectory
  • $wgCreateWikiDatabase
  • $wgCreateWikiCollation
  • $wgCreateWikiContainers
  • $wgCreateWikiDatabaseClusters
  • $wgCreateWikiStateDays
  • $wgCreateWikiNotificationEmail
  • $wgCreateWikiAIThreshold
  • $wgCreateWikiUseJobQueue
  • $wgCreateWikiGlobalWiki
  • $wgCreateWikiUseInactiveWikis
  • $wgCreateWikiCategories
  • $wgCreateWikiAutoApprovalFilter
  • $wgCreateWikiUseCustomDomains
  • $wgCreateWikiUseEchoNotifications
  • $wgCreateWikiUseClosedWikis
  • $wgCreateWikiUseCategories
  • $wgCreateWikiPersistentModelFile
  • $wgCreateWikiSQLfiles
  • $wgCreateWikiDatabaseClustersInactive
  • $wgCreateWikiSubdomain
  • $wgCreateWikiDisallowedSubdomains
  • $wgCreateWikiShowBiographicalOption
  • $wgCreateWikiInactiveExemptReasonOptions
  • $wgCreateWikiUsePrivateWikis
  • $wgCreateWikiEmailNotifications
  • $wgCreateWikiPurposes
  • $wgCreateWikiCustomDomainPage
  • $wgCreateWikiEnableManageInactiveWikis
  • $wgCreateWikiDatabaseSuffix
  • $wgCreateWikiCannedResponses

  • createwiki
  • requestwiki
Translate the CreateWiki extension

CreateWiki is an extension which allows registered users of one wiki site on a wiki farm to request new wiki sites or create new wiki sites on that wiki farm. It provides three additional special pages:

  • Special:RequestWiki — for requesting new wikis
  • Special:RequestWikiQueue — for viewing the new wiki request queue and handling new wiki requests
  • Special:CreateWiki — which allows some users to create new wiki sites

This particular version of CreateWiki is based on the earlier Checkuser extension by Tim Starling and Aaron Schulz, and another CreateWiki extension by KuduIO.

Warning Warning: CreateWiki was designed and created specifically for the Miraheze wiki farm, and as such, may not always work on different sites or configurations. While efforts have been made to make it more usable by non-Miraheze wiki sites, this extension is still a primarily Miraheze-focused extension and aligns to Miraheze's configuration and style.

Issues and bug reporting

For reporting an issue or a bug, please use Miraheze Phabricator. See here for the workboard.

Installation

  • Download and place the file(s) in a directory called CreateWiki in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'CreateWiki' );
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

All users (those in the User group by default) can request new wiki sites at Special:RequestWiki. Once they have requested a new wiki, they will be assigned a queue number and can check the status of their request at Special:RequestWikiQueue.

Those with the 'Wiki Creators' (createwiki) user right are able to check Special:RequestWikiQueue, and handle all wiki creation requests. At that page, they can either approve or decline wiki requests, and also change the visibility of a request. Everyone can check RequestWikiQueue at any time to see all requests ever submitted or filter by approved, declined, or in review tasks. Users can also filter by user.

Those with the 'Wiki Creators' (createwiki) user right can also bypass Special:RequestWiki, and manually create new wiki sites themselves at Special:CreateWiki.

Configuration

parameter default comment
$wgCreateWikiDisallowedSubdomains [] Regex to match for disallowed subdomains.
$wgCreateWikiCacheDirectory "" The path to store CreateWiki cache files at. This configuration variable is required.
$wgCreateWikiCannedResponses false Array of default responses to give. If this is enabled, free-text options are removed.
$wgCreateWikiCategories false An array of categories used for wiki categorization.
$wgCreateWikiCollation "" Sets the collation to use when creating the wiki database. Example is 'DEFAULT SET utf8mb4 COLLATE utf8mb4_unicode_ci'
$wgCreateWikiCustomDomainPage false Page name to link to for more information on custom domains.
$wgCreateWikiDatabase false Database name of where cw_wikis is stored.
$wgCreateWikiDatabaseClusters [] Array. LBFactory clusters which CreateWiki considers active.
$wgCreateWikiDatabaseClustersInactive [] Array. LBFactory clusters which are not considered active for use of automatic load-balancing.
$wgCreateWikiStateDays
 'inactive' => 45,
 'closed' => 15,
 'removed' => 120,
 'deleted' => 7,
Array. Integer values in days when a wiki is deemed inactive, closed, removed (hidden), and deleted. Number of days passed since last change - not from initial inactivity.
$wgCreateWikiEmailNotifications false Whether to send emails (or not) for new wiki creations.
$wgCreateWikiNotificationEmail root@localhost Email address to send internally generated notification emails to. Does not depend on $wgCreateWikiEmailNotifications!
$wgCreateWikiGlobalWiki false Database name of the global wiki. (Where RequestWiki should be enabled and Special:CreateWiki available.)
$wgCreateWikiInactiveExemptReasonOptions [] Array of possible options for marking an individual wiki as exempt from inactivity.
$wgCreateWikiPurposes [] Array. List of identified purposes to show when requesting a new wiki.
$wgCreateWikiShowBiographicalOption false Boolean. Whether to show a biographical person option when requesting a new wiki.
$wgCreateWikiSQLfiles false SQL files which you want to be created by default when a new wiki is created. This configuration variable is required.
$wgCreateWikiSubdomain false The master part of subdomains, e.g. wiki.miraheze.org, miraheze.org is the master part.
$wgCreateWikiUseCategories false Whether to use categories to categorise wikis.
$wgCreateWikiUseClosedWikis false Whether to implement front-end logic for closing wiki.
$wgCreateWikiUseCustomDomains false Whether to implement front-end logic to handle requesting custom domains for wikis in RequestWiki.
$wgCreateWikiUseEchoNotifications false Whether to use Echo notifications (beta feature).
$wgCreateWikiUseExperimental false Whether to implement front-end logic for marking wikis as experimental.
$wgCreateWikiUseInactiveWikis false Whether to implement front-end logic for inactive wikis.
$wgCreateWikiUseJobQueue false Whether to defer intensive tasks to the jobqueue.
$wgCreateWikiUsePrivateWikis false Whether to implement front-end logic for marking wikis as private.

REST API

wiki_request

This is an experimental API and is not production-ready!

Route: /createwiki/v0/wiki_request/{id}

Method: GET

Description

Request example

curl https://example.com/w/rest.php/createwiki/v0/wiki_request/1

Request parameters

parameter required example description
id Yes 1 The ID of the wiki request whose data you want to retrieve

Responses

200 Success
Response example
{
  "comment": "Purpose:  None of the above\ntest",
  "dbname": "testwiki",
  "language": "en",
  "sitename": "TestWiki",
  "status": "approved",
  "timestamp": "20230426042416",
  "url": "test.example.com",
  "requester": "Example",
  "category": "uncategorised",
  "bio": "0",
  "comments": [
    {
      "comment": "Request approved.",
      "timestamp": "20231129035014",
      "user": "Admin"
    }
  ]
}
400 Wiki request ID does not exist, or the request has been suppressed
Response example
{
  "message": "Invalid request ID",
  "httpCode": 400,
  "httpReason": "Bad Request"
}

Response schema

TODO

See also