Page MenuHomeWickedGov Phorge

MainConfigDependency.php
No OneTemporary

Size
774 B
Referenced Files
None
Subscribers
None

MainConfigDependency.php

<?php
/**
* @license GPL-2.0-or-later
* @file
*/
use MediaWiki\Config\Config;
use MediaWiki\MediaWikiServices;
/**
* Depend on a MediaWiki configuration variable from the global config.
*
* @ingroup Language
*/
class MainConfigDependency extends CacheDependency {
/** @var string */
private $name;
/** @var mixed */
private $value;
public function __construct( string $name ) {
$this->name = $name;
$this->value = $this->getConfig()->get( $this->name );
}
private function getConfig(): Config {
return MediaWikiServices::getInstance()->getMainConfig();
}
/** @inheritDoc */
public function isExpired() {
if ( !$this->getConfig()->has( $this->name ) ) {
return true;
}
return $this->getConfig()->get( $this->name ) != $this->value;
}
}

File Metadata

Mime Type
text/x-php
Expires
Aug 17 2026, 18:35 (10 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3b/e5/a106ec603b79b221a2ff3dfffa9b
Default Alt Text
MainConfigDependency.php (774 B)

Event Timeline