Skip to content

Commit

Permalink
Add incident reporting virtual domain (#5743)
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Nov 19, 2024
1 parent a2332df commit 6e288b3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,9 @@
'virtual-importdump' => [
'db' => $wi->getCentralDatabase(),
],
'virtual-incidentreporting' => [
'db' => $wi->getIncidentsDatabase(),
],
'virtual-matomoanalytics' => [
'db' => $wi->getGlobalDatabase(),
],
Expand Down
12 changes: 12 additions & 0 deletions initialise/MirahezeFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class MirahezeFunctions {
'beta' => 'testglobal',
];

private const INCIDENTS_DATABASE = [
'default' => 'incidents',
'beta' => 'testglobal',
];

private const MEDIAWIKI_DIRECTORY = '/srv/mediawiki/';

private const TAGS = [
Expand Down Expand Up @@ -344,6 +349,13 @@ public function getGlobalDatabase(): string {
return self::GLOBAL_DATABASE[ array_flip( self::TAGS )[$this->realm] ];
}

/**
* @return string
*/
public function getIncidentsDatabase(): string {
return self::INCIDENTS_DATABASE[ array_flip( self::TAGS )[$this->realm] ];
}

public function setDatabase() {
global $wgConf, $wgDBname, $wgCreateWikiDatabase;

Expand Down

0 comments on commit 6e288b3

Please sign in to comment.