MediaWiki
REL1_24
|
00001 <?php 00028 class MultiConfig implements Config { 00029 00038 private $configs; 00039 00043 public function __construct( array $configs ) { 00044 $this->configs = $configs; 00045 } 00046 00050 public function get( $name ) { 00051 foreach ( $this->configs as $config ) { 00052 if ( $config->has( $name ) ) { 00053 return $config->get( $name ); 00054 } 00055 } 00056 00057 throw new ConfigException( __METHOD__ . ": undefined option: '$name'" ); 00058 } 00059 00063 public function has( $name ) { 00064 foreach ( $this->configs as $config ) { 00065 if ( $config->has( $name ) ) { 00066 return true; 00067 } 00068 } 00069 00070 return false; 00071 } 00072 }