MediaWiki  1.29.2
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)
 
 clearCache ()
 Clear the cache of the read only file. More...
 
 getReason ()
 Get the value of $wgReadOnly or the contents of $wgReadOnlyFile. More...
 
 isReadOnly ()
 Check whether the wiki is in read-only mode. More...
 
 setReason ( $msg)
 Set the read-only mode, which will apply for the remainder of the request or until a service reset. More...
 

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::getConfiguredReadOnlyMode().

Since
1.29

Definition at line 76 of file ReadOnlyMode.php.

Constructor & Destructor Documentation

◆ __construct()

ConfiguredReadOnlyMode::__construct ( Config  $config)

Definition at line 86 of file ReadOnlyMode.php.

References $config.

Member Function Documentation

◆ clearCache()

ConfiguredReadOnlyMode::clearCache ( )

Clear the cache of the read only file.

Definition at line 137 of file ReadOnlyMode.php.

◆ 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 104 of file ReadOnlyMode.php.

References $fileReason, and $overrideReason.

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

◆ isReadOnly()

ConfiguredReadOnlyMode::isReadOnly ( )

Check whether the wiki is in read-only mode.

Returns
bool

Definition at line 95 of file ReadOnlyMode.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 130 of file ReadOnlyMode.php.

Member Data Documentation

◆ $config

Config ConfiguredReadOnlyMode::$config
private

Definition at line 78 of file ReadOnlyMode.php.

Referenced by __construct().

◆ $fileReason

string bool null ConfiguredReadOnlyMode::$fileReason
private

Definition at line 81 of file ReadOnlyMode.php.

Referenced by getReason().

◆ $overrideReason

string null ConfiguredReadOnlyMode::$overrideReason
private

Definition at line 84 of file ReadOnlyMode.php.

Referenced by getReason().


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