+ /**
+ * @return bool Whether all the default insertion stores are marked as read-only
+ * @since 1.31
+ */
+ public static function defaultStoresAreReadOnly() {
+ global $wgDefaultExternalStore;
+
+ $tryStores = (array)$wgDefaultExternalStore;
+ if ( !$tryStores ) {
+ return false; // no stores exists which can be "read only"
+ }
+
+ foreach ( $tryStores as $storeUrl ) {
+ list( $proto, $path ) = explode( '://', $storeUrl, 2 );
+ $store = self::getStoreObject( $proto, [] );
+ if ( !$store->isReadOnly( $path ) ) {
+ return false; // at least one store is not read-only
+ }
+ }
+
+ return true; // all stores are read-only
+ }
+