From c44bde8840519058095a0cfa576d220926bfa550 Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 24 Oct 2018 21:34:40 +0200 Subject: [PATCH] Release 1.4.0 Some clean-up and documentation --- README.md | 18 +++++++++++++++--- extension.json | 2 +- release-notes.md | 9 ++++++++- src/SimpleBatchUpload.php | 5 +++-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d7396fb..682b52b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Latest Stable Version](https://poser.pugx.org/mediawiki/simple-batch-upload/v/stable)](https://packagist.org/packages/mediawiki/simple-batch-upload) [![Packagist download count](https://poser.pugx.org/mediawiki/simple-batch-upload/downloads)](https://packagist.org/packages/mediawiki/simple-batch-upload) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/s7eph4n/SimpleBatchUpload/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/s7eph4n/SimpleBatchUpload/?branch=master) -[![Dependency Status](https://www.versioneye.com/php/mediawiki:simple-batch-upload/badge.png)](https://www.versioneye.com/php/mediawiki:simple-batch-upload) The [SimpleBatchUpload][mw-simple-batch-upload] extension provides basic, no-frills uploading of multiple files to MediaWiki. @@ -23,7 +22,7 @@ installation directory. ```json { "require": { - "mediawiki/simple-batch-upload": "~1.0" + "mediawiki/simple-batch-upload": "~1.4" } } ``` @@ -88,7 +87,20 @@ Pics | These pics were uploaded using [[mw:Extension:SimpleBatchUpload{{!}}Simpl Available configuration options: -* `$wgSimpleBatchUploadMaxFilesPerBatch` - defines maximum number of files that could be uploaded at time. +* `$wgSimpleBatchUploadMaxFilesPerBatch` - Array defining the maximum number of +files that can be uploaded each time depending on the user group.
Default: +``` php +$wgSimpleBatchUploadMaxFilesPerBatch = [ + '*' => 1000, +]; +``` + +**Note:** Be aware that this is not the right setting to completely block file +uploads! Users can still use the normal file upload or the MediaWiki API. See +the paragraph on user permissions on +[Configuring file uploads](https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads#Upload_permissions) +on mediawiki.org. + ## License diff --git a/extension.json b/extension.json index 3118e00..fda5503 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "SimpleBatchUpload", - "version": "1.3.2", + "version": "1.4.0", "author": [ "[http://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]" ], diff --git a/release-notes.md b/release-notes.md index 6282f84..a49612a 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,5 +1,12 @@ ## Release Notes +### SimpleBatchUpload 1.4.0 + +Released on 24-Oct-2018 + +Changes: +* New configuration setting `$wgSimpleBatchUploadMaxFilesPerBatch` + ### SimpleBatchUpload 1.3.2 Released on 12-Oct-2018 @@ -21,7 +28,7 @@ Changes: Released on 30-Mar-2018 Changes: -* Add parser function #batchupload +* Add parser function `#batchupload` * Improved error messages ### SimpleBatchUpload 1.2.0 diff --git a/src/SimpleBatchUpload.php b/src/SimpleBatchUpload.php index 4f538ee..d9c4e1b 100644 --- a/src/SimpleBatchUpload.php +++ b/src/SimpleBatchUpload.php @@ -152,10 +152,11 @@ public function onSetupAfterCache() { * @return array */ public function getMaxFilesPerBatchConfig() { - global $wgSimpleBatchUploadMaxFilesPerBatch; + if ( $this->maxFilesPerBatchConfig === null ) { - $this->maxFilesPerBatchConfig = $wgSimpleBatchUploadMaxFilesPerBatch; + $this->maxFilesPerBatchConfig = $GLOBALS[ 'wgSimpleBatchUploadMaxFilesPerBatch' ]; } + return $this->maxFilesPerBatchConfig; }