Add IDatabase::isReadOnly() method
[lhc/web/wiklou.git] / includes / db / Database.php
index 49a53ef..2f135a4 100644 (file)
@@ -4286,11 +4286,14 @@ abstract class DatabaseBase implements IDatabase {
                // no-op
        }
 
+       public function isReadOnly() {
+               return ( $this->getReadOnlyReason() !== false );
+       }
+
        /**
         * @return string|bool Reason this DB is read-only or false if it is not
-        * @since 1.27
         */
-       public function getReadOnlyReason() {
+       protected function getReadOnlyReason() {
                $reason = $this->getLBInfo( 'readOnlyReason' );
 
                return is_string( $reason ) ? $reason : false;