MediaWiki master
|
Determine whether a site is statically configured as read-only. More...
Public Member Functions | |
__construct ( $reason, ?string $reasonFile=null) | |
getReason () | |
isReadOnly () | |
Check whether the site 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. | |
Determine whether a site is statically configured as read-only.
Unlike ReadOnlyMode, this only checks site configuration. It does not confirm whether the primary database host actively accepts writes.
To obtain an instance, use \MediaWiki\MediaWikiServices::getConfiguredReadOnlyMode(). This service can be configured via $wgReadOnly and $wgReadOnlyFile.
Definition at line 16 of file ConfiguredReadOnlyMode.php.
Wikimedia\Rdbms\ConfiguredReadOnlyMode::__construct | ( | $reason, | |
?string | $reasonFile = null ) |
string | false | null | $reason | Current reason for read-only mode, if known. null means look in $reasonFile instead. |
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 site is not read-only. |
Definition at line 30 of file ConfiguredReadOnlyMode.php.
Wikimedia\Rdbms\ConfiguredReadOnlyMode::getReason | ( | ) |
Definition at line 47 of file ConfiguredReadOnlyMode.php.
Wikimedia\Rdbms\ConfiguredReadOnlyMode::isReadOnly | ( | ) |
Check whether the site is in read-only mode.
Definition at line 40 of file ConfiguredReadOnlyMode.php.
Wikimedia\Rdbms\ConfiguredReadOnlyMode::setReason | ( | $msg | ) |
Set the read-only mode, which will apply for the remainder of the request or until a service reset.
string | false | null | $msg |
Definition at line 69 of file ConfiguredReadOnlyMode.php.