+ $readOnly = wfConfiguredReadOnlyReason();
+ if ( $readOnly !== false ) {
+ return $readOnly;
+ }
+
+ static $lbReadOnly = null;
+ if ( $lbReadOnly === null ) {
+ // Callers use this method to be aware that data presented to a user
+ // may be very stale and thus allowing submissions can be problematic.
+ $lbReadOnly = wfGetLB()->getReadOnlyReason();
+ }
+
+ return $lbReadOnly;
+}
+
+/**
+ * Get the value of $wgReadOnly or the contents of $wgReadOnlyFile.
+ *
+ * @return string|bool String when in read-only mode; false otherwise
+ * @since 1.27
+ */
+function wfConfiguredReadOnlyReason() {