Page MenuHomeWickedGov Phorge

MultiConfig.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

MultiConfig.php

<?php
/**
* Copyright 2014
*
* @license GPL-2.0-or-later
* @file
*/
namespace MediaWiki\Config;
/**
* Provides a fallback sequence for Config objects
*
* @since 1.24
*/
class MultiConfig implements Config {
/**
* Array of Config objects to use
* Order matters, the Config objects
* will be checked in order to see
* whether they have the requested setting
*
* @var Config[]
*/
private $configs;
/**
* @param Config[] $configs
*/
public function __construct( array $configs ) {
$this->configs = $configs;
}
/**
* @inheritDoc
*/
public function get( $name ) {
foreach ( $this->configs as $config ) {
if ( $config->has( $name ) ) {
return $config->get( $name );
}
}
throw new ConfigException( __METHOD__ . ": undefined option: '$name'" );
}
/**
* @inheritDoc
*/
public function has( $name ) {
foreach ( $this->configs as $config ) {
if ( $config->has( $name ) ) {
return true;
}
}
return false;
}
}
/** @deprecated class alias since 1.41 */
class_alias( MultiConfig::class, 'MultiConfig' );

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 22:07 (1 d, 3 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ca/2d/d855589e48d4378c09adcc5f7493
Default Alt Text
MultiConfig.php (1 KB)

Event Timeline