MediaWiki  1.34.0
MainConfigDependency.php
Go to the documentation of this file.
1 <?php
24 
29  private $name;
30  private $value;
31 
32  function __construct( $name ) {
33  $this->name = $name;
34  $this->value = $this->getConfig()->get( $this->name );
35  }
36 
37  private function getConfig() {
38  return MediaWikiServices::getInstance()->getMainConfig();
39  }
40 
44  function isExpired() {
45  if ( !$this->getConfig()->has( $this->name ) ) {
46  return true;
47  }
48 
49  return $this->getConfig()->get( $this->name ) != $this->value;
50  }
51 }
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:117
MainConfigDependency\$value
$value
Definition: MainConfigDependency.php:30
value
if( $inline) $status value
Definition: SyntaxHighlight.php:346
MainConfigDependency
Definition: MainConfigDependency.php:28
MainConfigDependency\isExpired
isExpired()
Definition: MainConfigDependency.php:44
MainConfigDependency\getConfig
getConfig()
Definition: MainConfigDependency.php:37
MainConfigDependency\__construct
__construct( $name)
Definition: MainConfigDependency.php:32
CacheDependency
Definition: CacheDependency.php:27
MainConfigDependency\$name
$name
Definition: MainConfigDependency.php:29