+ /**
+ * @param string|bool|null $reason Current reason for read-only mode, if known. null means look
+ * in $reasonFile instead.
+ * @param string|null $reasonFile A file to look in for a reason, if $reason is null. If it
+ * exists and is non-empty, its contents are treated as the reason for read-only mode.
+ * Otherwise, the wiki is not read-only.
+ */
+ public function __construct( $reason, $reasonFile = null ) {
+ if ( $reason instanceof Config ) {
+ // Before 1.34 we passed a whole Config object, which was overkill
+ wfDeprecated( __METHOD__ . ' with Config passed to constructor', '1.34' );
+ $reason = $reason->get( 'ReadOnly' );
+ $reasonFile = $reason->get( 'ReadOnlyFile' );
+ }
+ $this->reason = $reason;
+ $this->reasonFile = $reasonFile;