return $readOnly;
}
- static $autoReadOnly = null;
- if ( $autoReadOnly === null ) {
+ 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.
- try {
- if ( wfGetLB()->getLaggedSlaveMode() ) {
- $autoReadOnly = 'The database has been automatically locked ' .
- 'while the slave database servers catch up to the master';
- } else {
- $autoReadOnly = false;
- }
- } catch ( DBConnectionError $e ) {
- $autoReadOnly = 'The database has been automatically locked ' .
- 'until the slave database servers become available';
- }
+ $lbReadOnly = wfGetLB()->getReadOnlyReason();
}
- return $autoReadOnly;
+ return $lbReadOnly;
}
/**