MediaWiki  1.30.0
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 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

◆ clearCache()

ConfiguredReadOnlyMode::clearCache ( )

Clear the cache of the read only file.

Definition at line 70 of file ConfiguredReadOnlyMode.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 37 of file ConfiguredReadOnlyMode.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 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: