Handbuch:Config.php

This page is a translated version of the page Manual:Config.php and the translation is 45% complete.

Config is the base interface for implementations that provide access to read various configuration settings. Um die Standardimplementierung zu erhalten, verwende MediaWiki\MediaWikiServices::getInstance()->getMainConfig(), MediaWiki\MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'main' ) oder RequestContext::getMain()->getConfig().

Verfügbare implementierungen in core sind:

  • GlobalVarConfigcan access settings in the $GLOBALS superglobal array.
  • MultiConfigcan contain multiple config objects that are acting as fallback sequence.
  • HashConfigstores the configuration in a member variable, allowing values to be set, rather than only get.

Methoden

  • get( $name )returns the value of the configuration value named, $name; throws a ConfigException if not set.
  • has( $name )returns true or false depending if the config object has the configuration value named, $name stored.

Siehe auch