MediaWiki  REL1_24
HashConfig.php
Go to the documentation of this file.
00001 <?php
00028 class HashConfig implements Config, MutableConfig {
00029 
00035     private $settings;
00036 
00040     public static function newInstance() {
00041         return new HashConfig;
00042     }
00043 
00047     public function __construct( array $settings = array() ) {
00048         $this->settings = $settings;
00049     }
00050 
00054     public function get( $name ) {
00055         if ( !$this->has( $name ) ) {
00056             throw new ConfigException( __METHOD__ . ": undefined option: '$name'" );
00057         }
00058 
00059         return $this->settings[$name];
00060     }
00061 
00065     public function has( $name ) {
00066         return array_key_exists( $name, $this->settings );
00067     }
00068 
00072     public function set( $name, $value ) {
00073         $this->settings[$name] = $value;
00074     }
00075 }