The goal is to use SettingsBuilder to load settings from JSON files instead of relying on PHP files that manipulate global variables. To allow for a smooth transition to the new system, config settings read from JSON files will be applied to global variables, and it will be possible to load JSON files programmatically from inside traditional settings files. Bug: T294740 Bug: T295500 Bug: T294741 Change-Id: Ibf52c660715fd0e6e67fea5169811ece9ed67cf7
33 lines
1,006 B
PHP
33 lines
1,006 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Settings;
|
|
|
|
use RuntimeException;
|
|
use Throwable;
|
|
use Wikimedia\NormalizedException\INormalizedException;
|
|
use Wikimedia\NormalizedException\NormalizedExceptionTrait;
|
|
|
|
class SettingsBuilderException extends RuntimeException implements INormalizedException {
|
|
use NormalizedExceptionTrait;
|
|
|
|
/**
|
|
* @param string $normalizedMessage The exception message, with PSR-3 style placeholders.
|
|
* @param array $messageContext Message context, with values for the placeholders.
|
|
* @param int $code The exception code.
|
|
* @param Throwable|null $previous The previous throwable used for the exception chaining.
|
|
*/
|
|
public function __construct(
|
|
string $normalizedMessage = '',
|
|
array $messageContext = [],
|
|
int $code = 0,
|
|
Throwable $previous = null
|
|
) {
|
|
$this->normalizedMessage = $normalizedMessage;
|
|
$this->messageContext = $messageContext;
|
|
parent::__construct(
|
|
self::getMessageFromNormalizedMessage( $normalizedMessage, $messageContext ),
|
|
$code,
|
|
$previous
|
|
);
|
|
}
|
|
}
|