Manual:$wgReadOnly

Details
If set to a string (e.g., in LocalSettings.php), $wgReadOnly disallows editing, displaying the string given as the reason. Functionally the same as $wgReadOnlyFile, but using a variable instead of a file.