Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/243054

Change subject: Apply $wgReadOnly to all file backends
......................................................................

Apply $wgReadOnly to all file backends

Change-Id: I9e7ec95c4b2f763505166d2345d27abaef6257a3
---
M includes/filebackend/FileBackendGroup.php
1 file changed, 11 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/243054/1

diff --git a/includes/filebackend/FileBackendGroup.php 
b/includes/filebackend/FileBackendGroup.php
index 9bb1582..1620268 100644
--- a/includes/filebackend/FileBackendGroup.php
+++ b/includes/filebackend/FileBackendGroup.php
@@ -61,10 +61,7 @@
         * Register file backends from the global variables
         */
        protected function initFromGlobals() {
-               global $wgLocalFileRepo, $wgForeignFileRepos, $wgFileBackends;
-
-               // Register explicitly defined backends
-               $this->register( $wgFileBackends );
+               global $wgLocalFileRepo, $wgForeignFileRepos, $wgFileBackends, 
$wgReadOnly;
 
                $autoBackends = array();
                // Automatically create b/c backends for file repos...
@@ -105,8 +102,16 @@
                        );
                }
 
-               // Register implicitly defined backends
-               $this->register( $autoBackends );
+               $backends = array_merge( $autoBackends, $wgFileBackends );
+
+               // Apply $wgReadOnly to all backends if not already read-only
+               foreach ( $backends as &$backend ) {
+                       $backend['readOnly'] = !empty( $backend['readOnly'] )
+                               ? $backend['readOnly']
+                               : $wgReadOnly;
+               }
+
+               $this->register( $backends );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/243054
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e7ec95c4b2f763505166d2345d27abaef6257a3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to