MediaWiki  1.23.6
GlobalVarConfig.php
Go to the documentation of this file.
1 <?php
28 class GlobalVarConfig implements Config {
29 
34  private $prefix;
35 
40  public static function newInstance() {
41  return new GlobalVarConfig();
42  }
43 
44  public function __construct( $prefix = 'wg' ) {
45  $this->prefix = $prefix;
46  }
47 
51  public function get( $name ) {
52  return $this->getWithPrefix( $this->prefix, $name );
53  }
54 
58  public function set( $name, $value ) {
59  $this->setWithPrefix( $this->prefix, $name, $value );
60  }
61 
70  protected function getWithPrefix( $prefix, $name ) {
71  $var = $prefix . $name;
72  if ( !array_key_exists( $var, $GLOBALS ) ) {
73  throw new ConfigException( __METHOD__ . ": undefined variable: '$var'" );
74  }
75  return $GLOBALS[ $var ];
76  }
77 
85  protected function setWithPrefix( $prefix, $name, $value ) {
87  }
88 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
GlobalVarConfig\$prefix
string $prefix
Prefix to use for configuration variables.
Definition: GlobalVarConfig.php:33
GlobalVarConfig\getWithPrefix
getWithPrefix( $prefix, $name)
Get a variable with a given prefix, if not the defaults.
Definition: GlobalVarConfig.php:69
Config
Interface for configuration instances.
Definition: Config.php:28
ConfigException
Exceptions for config failures.
Definition: ConfigException.php:28
GlobalVarConfig
Accesses configuration settings from $GLOBALS.
Definition: GlobalVarConfig.php:28
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
$value
$value
Definition: styleTest.css.php:45
GlobalVarConfig\newInstance
static newInstance()
Default builder function.
Definition: GlobalVarConfig.php:39
GlobalVarConfig\__construct
__construct( $prefix='wg')
Definition: GlobalVarConfig.php:43
GlobalVarConfig\setWithPrefix
setWithPrefix( $prefix, $name, $value)
Get a variable with a given prefix, if not the defaults.
Definition: GlobalVarConfig.php:84
$GLOBALS
$GLOBALS['IP']
Definition: ComposerHookHandler.php:6