MediaWiki REL1_33
ConfiguredReadOnlyMode Class Reference

A read-only mode service which does not depend on LoadBalancer. More...

Collaboration diagram for ConfiguredReadOnlyMode:

Public Member Functions

 __construct (Config $config)
 
 getReason ()
 Get the value of $wgReadOnly or the contents of $wgReadOnlyFile.
 
 isReadOnly ()
 Check whether the wiki is in read-only mode.
 
 setReason ( $msg)
 Set the read-only mode, which will apply for the remainder of the request or until a service reset.
 

Private Attributes

Config $config
 
string bool null $fileReason
 
string null $overrideReason
 

Detailed Description

A read-only mode service which does not depend on LoadBalancer.

To obtain an instance, use MediaWikiServices::getInstance()->getConfiguredReadOnlyMode().

Since
1.29

Definition at line 9 of file ConfiguredReadOnlyMode.php.

Constructor & Destructor Documentation

◆ __construct()

ConfiguredReadOnlyMode::__construct ( Config $config)

Definition at line 19 of file ConfiguredReadOnlyMode.php.

References $config.

Member Function Documentation

◆ getReason()

ConfiguredReadOnlyMode::getReason ( )

Get the value of $wgReadOnly or the contents of $wgReadOnlyFile.

Returns
string|bool String when in read-only mode; false otherwise

Definition at line 37 of file ConfiguredReadOnlyMode.php.

References $fileReason, $overrideReason, and and().

Referenced by MWLBFactory\applyDefaultConfig(), and isReadOnly().

◆ isReadOnly()

ConfiguredReadOnlyMode::isReadOnly ( )

Check whether the wiki is in read-only mode.

Returns
bool

Definition at line 28 of file ConfiguredReadOnlyMode.php.

References getReason().

◆ setReason()

ConfiguredReadOnlyMode::setReason ( $msg)

Set the read-only mode, which will apply for the remainder of the request or until a service reset.

Parameters
string | null$msg

Definition at line 63 of file ConfiguredReadOnlyMode.php.

Member Data Documentation

◆ $config

Config ConfiguredReadOnlyMode::$config
private

Definition at line 11 of file ConfiguredReadOnlyMode.php.

Referenced by __construct().

◆ $fileReason

string bool null ConfiguredReadOnlyMode::$fileReason
private

Definition at line 14 of file ConfiguredReadOnlyMode.php.

Referenced by getReason().

◆ $overrideReason

string null ConfiguredReadOnlyMode::$overrideReason
private

Definition at line 17 of file ConfiguredReadOnlyMode.php.

Referenced by getReason().


The documentation for this class was generated from the following file: