Page MenuHomeWickedGov Phorge

CentralAuthWikiListService.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

CentralAuthWikiListService.php

<?php
namespace MediaWiki\Extension\CentralAuth;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\Extension\CentralAuth\Hooks\CentralAuthHookRunner;
use MediaWiki\HookContainer\HookContainer;
/**
* Handle knowledge of other wikis in this CentralAuth farm.
*
* @since 1.37
* @author Taavi "Majavah" Väänänen
*/
class CentralAuthWikiListService {
private ServiceOptions $options;
private CentralAuthHookRunner $hookRunner;
/** @var string[]|null Cached array of known wikis. */
private $wikiList = null;
/** @internal Only public for ServiceWiring use */
public const CONSTRUCTOR_OPTIONS = [
'LocalDatabases',
];
/**
* @param ServiceOptions $options Options used by this service, containing keys in ::CONSTRUCTOR_OPTIONS
* @param HookContainer $hookContainer
*/
public function __construct( ServiceOptions $options, HookContainer $hookContainer ) {
$options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
$this->options = $options;
$this->hookRunner = new CentralAuthHookRunner( $hookContainer );
}
/**
* @return string[] all database names of wikis in this CentralAuth farm
*/
public function getWikiList(): array {
if ( $this->wikiList === null ) {
$list = null;
$this->hookRunner->onCentralAuthWikiList( $list );
$this->wikiList = $list ?? $this->options->get( 'LocalDatabases' );
}
return $this->wikiList;
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Aug 18, 15:53 (3 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b4/0a/2aa35300d2c081c570e07376dfef
Default Alt Text
CentralAuthWikiListService.php (1 KB)

Event Timeline