filebackend: let any specific backend value of "readOnly" override the default
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 19 Jul 2018 16:11:39 +0000 (17:11 +0100)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 19 Jul 2018 16:11:39 +0000 (17:11 +0100)
Previously, only different reason strings could override, but there was
no way to override the read-only mode to being off.

Change-Id: I4266694034bfbdada90d4be96bcbc1a37f5b5409

includes/filebackend/FileBackendGroup.php

index dc6dbe8..503acdc 100644 (file)
@@ -123,9 +123,7 @@ class FileBackendGroup {
                        }
                        $class = $config['class'];
 
-                       $config['readOnly'] = !empty( $config['readOnly'] )
-                               ? $config['readOnly']
-                               : $readOnlyReason;
+                       $config['readOnly'] = $config['readOnly'] ?? $readOnlyReason;
 
                        unset( $config['class'] ); // backend won't need this
                        $this->backends[$name] = [