Merge "Create IResultWrapper interface for type-hints"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 10 Feb 2017 22:01:41 +0000 (22:01 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 10 Feb 2017 22:01:43 +0000 (22:01 +0000)
66 files changed:
.eslintrc.json
autoload.php
composer.json
includes/AjaxDispatcher.php
includes/FileDeleteForm.php
includes/WatchedItemStore.php
includes/api/i18n/ar.json
includes/api/i18n/es.json
includes/api/i18n/fr.json
includes/api/i18n/gl.json
includes/api/i18n/ko.json
includes/api/i18n/ru.json
includes/db/DatabaseMssql.php [deleted file]
includes/db/MWLBFactory.php
includes/filebackend/filejournal/DBFileJournal.php
includes/installer/MysqlUpdater.php
includes/installer/i18n/ko.json
includes/jobqueue/jobs/HTMLCacheUpdateJob.php
includes/libs/rdbms/ChronologyProtector.php
includes/libs/rdbms/database/DBConnRef.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMssql.php [new file with mode: 0644]
includes/libs/rdbms/database/DatabaseMysqlBase.php
includes/libs/rdbms/database/IDatabase.php
includes/libs/rdbms/database/position/DBMasterPos.php
includes/libs/rdbms/database/position/MySQLMasterPos.php
includes/libs/rdbms/loadbalancer/ILoadBalancer.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php
includes/revisiondelete/RevDelList.php
includes/specials/SpecialExport.php
languages/i18n/ar.json
languages/i18n/be-tarask.json
languages/i18n/bqi.json
languages/i18n/bs.json
languages/i18n/ca.json
languages/i18n/csb.json
languages/i18n/es.json
languages/i18n/et.json
languages/i18n/eu.json
languages/i18n/fi.json
languages/i18n/hr.json
languages/i18n/ia.json
languages/i18n/ko.json
languages/i18n/nb.json
languages/i18n/nn.json
languages/i18n/oc.json
languages/i18n/shn.json
languages/i18n/tt-cyrl.json
languages/i18n/zh-hant.json
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.CapsuleItemWidget.less
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterCapsuleMultiselectWidget.less
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterItemWidget.less
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.CapsuleItemWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterItemWidget.js
resources/src/mediawiki.special/mediawiki.special.apisandbox.js
resources/src/mediawiki/mediawiki.js
resources/src/startup.js
tests/phpunit/includes/db/DatabaseMysqlBaseTest.php
tests/phpunit/includes/db/LBFactoryTest.php
tests/qunit/suites/resources/mediawiki.rcfilters/dm.FiltersViewModel.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.test.js

index 044dd72..98d0f10 100644 (file)
@@ -9,7 +9,6 @@
                "require": false,
                "module": false,
                "mediaWiki": false,
-               "mwPerformance": false,
                "OO": false
        },
        "rules": {
index a6aebed..d4bd447 100644 (file)
@@ -313,7 +313,6 @@ $wgAutoloadLocalClasses = [
        'DBExpectedError' => __DIR__ . '/includes/libs/rdbms/exception/DBExpectedError.php',
        'DBFileJournal' => __DIR__ . '/includes/filebackend/filejournal/DBFileJournal.php',
        'DBLockManager' => __DIR__ . '/includes/libs/lockmanager/DBLockManager.php',
-       'DBMasterPos' => __DIR__ . '/includes/libs/rdbms/database/position/DBMasterPos.php',
        'DBQueryError' => __DIR__ . '/includes/libs/rdbms/exception/DBQueryError.php',
        'DBReadOnlyError' => __DIR__ . '/includes/libs/rdbms/exception/DBReadOnlyError.php',
        'DBReplicationWaitError' => __DIR__ . '/includes/libs/rdbms/exception/DBReplicationWaitError.php',
@@ -327,7 +326,7 @@ $wgAutoloadLocalClasses = [
        'DatabaseInstaller' => __DIR__ . '/includes/installer/DatabaseInstaller.php',
        'DatabaseLag' => __DIR__ . '/maintenance/lag.php',
        'DatabaseLogEntry' => __DIR__ . '/includes/logging/LogEntry.php',
-       'DatabaseMssql' => __DIR__ . '/includes/db/DatabaseMssql.php',
+       'DatabaseMssql' => __DIR__ . '/includes/libs/rdbms/database/DatabaseMssql.php',
        'DatabaseMysql' => __DIR__ . '/includes/libs/rdbms/database/DatabaseMysql.php',
        'DatabaseMysqlBase' => __DIR__ . '/includes/libs/rdbms/database/DatabaseMysqlBase.php',
        'DatabaseMysqli' => __DIR__ . '/includes/libs/rdbms/database/DatabaseMysqli.php',
@@ -982,7 +981,6 @@ $wgAutoloadLocalClasses = [
        'MutableContext' => __DIR__ . '/includes/context/MutableContext.php',
        'MwSql' => __DIR__ . '/maintenance/sql.php',
        'MySQLField' => __DIR__ . '/includes/libs/rdbms/field/MySQLField.php',
-       'MySQLMasterPos' => __DIR__ . '/includes/libs/rdbms/database/position/MySQLMasterPos.php',
        'MySqlLockManager' => __DIR__ . '/includes/filebackend/lockmanager/MySqlLockManager.php',
        'MysqlInstaller' => __DIR__ . '/includes/installer/MysqlInstaller.php',
        'MysqlUpdater' => __DIR__ . '/includes/installer/MysqlUpdater.php',
@@ -1584,6 +1582,7 @@ $wgAutoloadLocalClasses = [
        'WikiTextStructure' => __DIR__ . '/includes/content/WikiTextStructure.php',
        'Wikimedia\\Rdbms\\ChronologyProtector' => __DIR__ . '/includes/libs/rdbms/ChronologyProtector.php',
        'Wikimedia\\Rdbms\\ConnectionManager' => __DIR__ . '/includes/libs/rdbms/connectionmanager/ConnectionManager.php',
+       'Wikimedia\\Rdbms\\DBMasterPos' => __DIR__ . '/includes/libs/rdbms/database/position/DBMasterPos.php',
        'Wikimedia\\Rdbms\\DatabaseDomain' => __DIR__ . '/includes/libs/rdbms/database/DatabaseDomain.php',
        'Wikimedia\\Rdbms\\ILBFactory' => __DIR__ . '/includes/libs/rdbms/lbfactory/ILBFactory.php',
        'Wikimedia\\Rdbms\\ILoadBalancer' => __DIR__ . '/includes/libs/rdbms/loadbalancer/ILoadBalancer.php',
@@ -1597,6 +1596,7 @@ $wgAutoloadLocalClasses = [
        'Wikimedia\\Rdbms\\LoadMonitor' => __DIR__ . '/includes/libs/rdbms/loadmonitor/LoadMonitor.php',
        'Wikimedia\\Rdbms\\LoadMonitorMySQL' => __DIR__ . '/includes/libs/rdbms/loadmonitor/LoadMonitorMySQL.php',
        'Wikimedia\\Rdbms\\LoadMonitorNull' => __DIR__ . '/includes/libs/rdbms/loadmonitor/LoadMonitorNull.php',
+       'Wikimedia\\Rdbms\\MySQLMasterPos' => __DIR__ . '/includes/libs/rdbms/database/position/MySQLMasterPos.php',
        'Wikimedia\\Rdbms\\SessionConsistentConnectionManager' => __DIR__ . '/includes/libs/rdbms/connectionmanager/SessionConsistentConnectionManager.php',
        'Wikimedia\\Rdbms\\TransactionProfiler' => __DIR__ . '/includes/libs/rdbms/TransactionProfiler.php',
        'WikitextContent' => __DIR__ . '/includes/content/WikitextContent.php',
index 71338a4..d41492e 100644 (file)
@@ -55,7 +55,9 @@
                "nikic/php-parser": "2.1.0",
                "nmred/kafka-php": "0.1.5",
                "phpunit/phpunit": "4.8.31",
-               "wikimedia/avro": "1.7.7"
+               "wikimedia/avro": "1.7.7",
+               "hamcrest/hamcrest-php": "^2.0",
+               "wmde/hamcrest-html-matchers": "^0.1.0"
        },
        "suggest": {
                "ext-apc": "Local data and opcode cache",
                        "ComposerHookHandler": "includes/composer"
                }
        },
+       "autoload-dev": {
+               "files": [
+                       "vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php",
+                       "vendor/wmde/hamcrest-html-matchers/src/functions.php"
+               ]
+       },
        "scripts": {
                "lint": "parallel-lint --exclude vendor",
                "phpcs": "phpcs -p -s",
index d444a27..2adbc80 100644 (file)
@@ -21,6 +21,8 @@
  * @ingroup Ajax
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * @defgroup Ajax Ajax
  */
@@ -135,7 +137,8 @@ class AjaxDispatcher {
                                        }
 
                                        // Make sure DB commit succeeds before sending a response
-                                       wfGetLBFactory()->commitMasterChanges( __METHOD__ );
+                                       $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+                                       $lbFactory->commitMasterChanges( __METHOD__ );
 
                                        $result->sendHeaders();
                                        $result->printText();
index 82af081..f284d92 100644 (file)
@@ -206,7 +206,8 @@ class FileDeleteForm {
                                        $dbw->endAtomic( __METHOD__ );
                                } else {
                                        // Page deleted but file still there? rollback page delete
-                                       wfGetLBFactory()->rollbackMasterChanges( __METHOD__ );
+                                       $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+                                       $lbFactory->rollbackMasterChanges( __METHOD__ );
                                }
                        } else {
                                // Done; nothing changed
index 3cdc59c..858d87b 100644 (file)
@@ -2,6 +2,7 @@
 
 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
 use MediaWiki\Linker\LinkTarget;
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Assert\Assert;
 use Wikimedia\ScopedCallback;
 
@@ -734,7 +735,7 @@ class WatchedItemStore implements StatsdAwareInterface {
                                        global $wgUpdateRowsPerQuery;
 
                                        $dbw = $this->getConnectionRef( DB_MASTER );
-                                       $factory = wfGetLBFactory();
+                                       $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
                                        $ticket = $factory->getEmptyTransactionTicket( __METHOD__ );
 
                                        $watchersChunks = array_chunk( $watchers, $wgUpdateRowsPerQuery );
index 86078d4..1222195 100644 (file)
@@ -8,7 +8,8 @@
                        "Hiba Alshawi",
                        "Maroen1990",
                        "محمد أحمد عبد الفتاح",
-                       "ديفيد"
+                       "ديفيد",
+                       "ASHmed"
                ]
        },
        "apihelp-main-param-action": "أي فعل للعمل.",
        "apihelp-protect-example-protect": "حماية صفحة.",
        "apihelp-protect-example-unprotect": "إلغاء حماية الصفحة من خلال وضع قيود ل<kbd>all</kbd> (أي يُسمَح أي شخص باتخاذ الإجراءات).",
        "apihelp-protect-example-unprotect2": "إلغاء حماية الصفحة عن طريق عدم وضع أية قيود.",
+       "apihelp-purge-description": "مسح ذاكرة التخزين المؤقت للعناوين المعطاة",
        "apihelp-purge-param-forcelinkupdate": "تحديث جداول الروابط.",
        "apihelp-purge-param-forcerecursivelinkupdate": "تحديث جدول الروابط، وتحديث جداول الروابط لأية صفحة تستخدم هذه الصفحة كقالب.",
        "apihelp-purge-example-simple": "إفراغ كاش <kbd>Main Page</kbd> وصفحة <kbd>API</kbd>.",
index ae51f12..e7a9d2c 100644 (file)
        "apihelp-removeauthenticationdata-description": "Elimina los datos de autentificación del usuario actual.",
        "apihelp-removeauthenticationdata-example-simple": "Trata de eliminar los datos del usuario actual para <kbd>FooAuthenticationRequest</kbd>.",
        "apihelp-resetpassword-description": "Enviar un email de reinicialización de la contraseña a un usuario.",
+       "apihelp-resetpassword-param-user": "Usuario en proceso de reinicialización",
+       "apihelp-resetpassword-param-email": "Dirección de correo electrónico del usuario que se va a reinicializar",
        "apihelp-resetpassword-example-user": "Enviar un correo de recuperación de contraseña al usuario <kbd>Ejemplo</kbd>.",
        "apihelp-resetpassword-example-email": "Enviar un correo de recuperación de contraseña para todos los usuarios con dirección de correo electrónico <kbd>usuario@ejemplo.com</kbd>.",
        "apihelp-revisiondelete-description": "Eliminar y restaurar revisiones",
        "apihelp-watch-example-unwatch": "Dejar de vigilar la <kbd>Main Page</kbd>.",
        "apihelp-watch-example-generator": "Seguir las primeras páginas del espacio de nombres principal.",
        "apihelp-format-example-generic": "Devolver el resultado de la consulta en formato $1.",
+       "apihelp-format-param-wrappedhtml": "Devolver el HTML con resaltado sintáctico y los módulos ResourceLoader asociados en forma de objeto JSON.",
        "apihelp-json-description": "Extraer los datos de salida en formato JSON.",
        "apihelp-json-param-callback": "Si se especifica, envuelve la salida dentro de una llamada a una función dada. Por motivos de seguridad, cualquier dato específico del usuario estará restringido.",
        "apihelp-json-param-utf8": "Si se especifica, codifica la mayoría (pero no todos) de los caracteres no pertenecientes a ASCII como UTF-8 en lugar de reemplazarlos por secuencias de escape hexadecimal. Toma el comportamiento por defecto si <var>formatversion</var> no es <kbd>1</kbd>.",
        "apihelp-json-param-ascii": "Si se especifica, codifica todos los caracteres no pertenecientes a ASCII mediante secuencias de escape hexadecimal. Toma el comportamiento por defecto si <var>formatversion</var> no es <kbd>1</kbd>.",
        "apihelp-json-param-formatversion": "Formato de salida:\n;1: Formato retrocompatible (booleanos con estilo XML, claves <samp>*</samp> para nodos de contenido, etc.).\n;2: Formato moderno experimental. ¡Atención, las especificaciones pueden cambiar!\n;latest: Utiliza el último formato (actualmente <kbd>2</kbd>). Puede cambiar sin aviso.",
+       "apihelp-jsonfm-description": "Producir los datos de salida en formato JSON (con resaltado sintáctico en HTML).",
        "apihelp-none-description": "No extraer nada.",
        "apihelp-php-description": "Extraer los datos de salida en formato serializado PHP.",
+       "apihelp-php-param-formatversion": "Formato de salida:\n;1: Formato retrocompatible (booleanos con estilo XML, claves <samp>*</samp> para nodos de contenido, etc.).\n;2: Formato moderno experimental. ¡Atención, las especificaciones pueden cambiar!\n;latest: Utilizar el último formato (actualmente <kbd>2</kbd>). Puede cambiar sin aviso.",
+       "apihelp-phpfm-description": "Producir los datos de salida en formato PHP serializado (con resaltado sintáctico en HTML).",
        "apihelp-rawfm-description": "Extraer los datos de salida, incluidos los elementos de depuración, en formato JSON (embellecido en HTML).",
+       "apihelp-xml-description": "Producir los datos de salida en formato XML.",
        "apihelp-xml-param-xslt": "Si se especifica, añade la página nombrada como una hoja de estilo XSL. El valor debe ser un título en el espacio de nombres {{ns:MediaWiki}} que termine en <code>.xsl</code>.",
        "apihelp-xml-param-includexmlnamespace": "Si se especifica, añade un espacio de nombres XML.",
+       "apihelp-xmlfm-description": "Producir los datos de salida en formato XML (con resaltado sintáctico en HTML).",
        "api-format-title": "Resultado de la API de MediaWiki",
        "api-format-prettyprint-header": "Esta es la representación en HTML del formato $1. HTML es adecuado para realizar tareas de depuración, pero no para utilizarlo en aplicaciones.\n\nUtiliza el parámetro <var>format</var> para modificar el formato de salida. Para ver la representación no HTML del formato $1, emplea <kbd>format=$2</kbd>.\n\nPara obtener más información, consulta la [[mw:API|documentación completa]] o la [[Special:ApiHelp/main|ayuda de API]].",
        "api-format-prettyprint-status": "Esta respuesta se devolvería con el estado HTTP $1 $2.",
index b2d1100..23ef933 100644 (file)
        "apihelp-help-param-recursivesubmodules": "Inclure l’aide pour les sous-modules de façon récursive.",
        "apihelp-help-param-helpformat": "Format de sortie de l’aide.",
        "apihelp-help-param-wrap": "Inclut la sortie dans une structure de réponse API standard.",
-       "apihelp-help-param-toc": "Inclure une table des matières dans la sortir HTML.",
+       "apihelp-help-param-toc": "Inclure une table des matières dans la sortie HTML.",
        "apihelp-help-example-main": "Aide pour le module principal",
        "apihelp-help-example-submodules": "Aide pour <kbd>action=query</kbd> et tous ses sous-modules.",
-       "apihelp-help-example-recursive": "Toute l’aide sur une page",
-       "apihelp-help-example-help": "Aide pour le module d’aide lui-même",
-       "apihelp-help-example-query": "Aide pour deux sous-modules de recherche",
+       "apihelp-help-example-recursive": "Toute l’aide sur une page.",
+       "apihelp-help-example-help": "Aide pour le module d’aide lui-même.",
+       "apihelp-help-example-query": "Aide pour deux sous-modules de recherche.",
        "apihelp-imagerotate-description": "Faire pivoter une ou plusieurs images.",
        "apihelp-imagerotate-param-rotation": "Degrés de rotation de l’image dans le sens des aiguilles d’une montre.",
        "apihelp-imagerotate-param-tags": "Balises à appliquer à l’entrée dans le journal de téléchargement.",
        "apihelp-move-param-watchlist": "Ajouter ou supprimer sans condition la page de la liste de suivi de l'utilisateur actuel, utiliser les préférences ou ne pas changer le suivi.",
        "apihelp-move-param-ignorewarnings": "Ignorer tous les avertissements.",
        "apihelp-move-param-tags": "Modifier les balises à appliquer à l'entrée du journal des renommages et à la version zéro de la page de destination.",
-       "apihelp-move-example-move": "Déplacer <kbd>Badtitle</kbd> en <kbd>Goodtitle</kbd> sans garder de redirection.",
+       "apihelp-move-example-move": "Renommer <kbd>Badtitle</kbd> en <kbd>Goodtitle</kbd> sans garder de redirection.",
        "apihelp-opensearch-description": "Rechercher dans le wiki en utilisant le protocole OpenSearch.",
        "apihelp-opensearch-param-search": "Chaîne de caractères cherchée.",
        "apihelp-opensearch-param-limit": "Nombre maximal de résultats à renvoyer.",
        "apihelp-protect-param-expiry": "Horodatages d’expiration. Si un seul horodatage est fourni, il sera utilisé pour toutes les protections. Utiliser <kbd>infinite</kbd>, <kbd>indefinite</kbd>, <kbd>infinity</kbd> ou <kbd>never</kbd> pour une protection sans expiration.",
        "apihelp-protect-param-reason": "Motif de (dé)protection.",
        "apihelp-protect-param-tags": "Modifier les balises à appliquer à l’entrée dans le journal de protection.",
-       "apihelp-protect-param-cascade": "Activer la protection en cascade (c’est-à-dire protéger les modèles transclus et les images utilisées dans cette page). Ignoré si aucun des niveaux de protection fournis ne prend en charge la mise en cascade.",
+       "apihelp-protect-param-cascade": "Activer la protection en cascade (c’est-à-dire protéger les modèles transclus et les images utilisés dans cette page). Ignoré si aucun des niveaux de protection fournis ne prend en charge la mise en cascade.",
        "apihelp-protect-param-watch": "Si activé, ajouter la page (dé)protégée à la liste de suivi de l'utilisateur actuel.",
        "apihelp-protect-param-watchlist": "Ajouter ou supprimer sans condition la page de la liste de suivi de l'utilisateur actuel, utiliser les préférences ou ne pas modifier le suivi.",
        "apihelp-protect-example-protect": "Protéger une page",
        "apihelp-query+alllinks-paramvalue-prop-title": "Ajoute le titre du lien.",
        "apihelp-query+alllinks-param-namespace": "L’espace de noms à énumérer.",
        "apihelp-query+alllinks-param-limit": "Combien d’éléments renvoyer au total.",
-       "apihelp-query+alllinks-param-dir": "La direction dans laquelle lister.",
+       "apihelp-query+alllinks-param-dir": "L'ordre dans lequel lister.",
        "apihelp-query+alllinks-example-B": "Lister les titres liés, y compris les manquants, avec les IDs des pages d’où ils proviennent, en démarrant à <kbd>B</kbd>.",
        "apihelp-query+alllinks-example-unique": "Lister les titres liés uniques",
        "apihelp-query+alllinks-example-unique-generator": "Obtient tous les titres liés, en marquant les manquants",
index ab409e2..e2e7ae6 100644 (file)
        "apiwarn-invalidcategory": "\"$1\" non é unha categoría.",
        "apiwarn-invalidtitle": "\"$1\" non é un título válido.",
        "apiwarn-notfile": "\"$1\" non é un ficheiro.",
+       "apiwarn-parse-nocontentmodel": "Non se proporcionou <var>title</var> nin <var>contentmodel</var>, asúmese $1.",
+       "apiwarn-tokennotallowed": "A acción \"$1\" non está permitida para o usuario actual.",
+       "apiwarn-toomanyvalues": "Demasiados valores para o parámetro <var>$1</var>: o límite é $2.",
+       "apiwarn-truncatedresult": "Truncouse este resultado porque doutra maneira sobrepasaría o límite de $1 bytes.",
+       "apiwarn-validationfailed-badpref": "non é unha preferencia válida.",
+       "apiwarn-validationfailed-cannotset": "non pode ser establecido por este módulo.",
+       "apiwarn-validationfailed": "Erro de validación de <kbd>$1</kbd>: $2",
+       "apiwarn-wgDebugAPI": "<strong>Aviso de seguridade</strong>: <var>$wgDebugAPI</var> está habilitado.",
        "api-feed-error-title": "Erro ($1)",
        "api-usage-docref": "Consulte $1 para ver o uso da API.",
        "api-exception-trace": "$1 en $2($3)\n$4",
index 76db21e..38b4a67 100644 (file)
        "apihelp-protect-description": "문서의 보호 수준을 변경합니다.",
        "apihelp-protect-param-reason": "보호 또는 보호 해제의 이유.",
        "apihelp-protect-example-protect": "문서 보호",
+       "apihelp-purge-description": "주어진 제목을 위한 캐시를 새로 고침.",
        "apihelp-purge-param-forcelinkupdate": "링크 테이블을 업데이트합니다.",
        "apihelp-query-param-prop": "조회된 페이지에 대해 가져올 속성입니다.",
        "apihelp-query-param-list": "가져올 목록입니다.",
index 8be41e0..7960775 100644 (file)
        "apihelp-login-param-name": "Имя участника.",
        "apihelp-login-param-password": "Пароль.",
        "apihelp-login-param-domain": "Домен (необязательно).",
+       "apihelp-login-example-gettoken": "Получить токен входа.",
        "apihelp-login-example-login": "Войти",
        "apihelp-logout-description": "Выйти и очистить данные сессии.",
        "apihelp-mergehistory-description": "Объединение историй правок",
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
deleted file mode 100644 (file)
index d567d8b..0000000
+++ /dev/null
@@ -1,1384 +0,0 @@
-<?php
-/**
- * This is the MS SQL Server Native database abstraction layer.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Database
- * @author Joel Penner <a-joelpe at microsoft dot com>
- * @author Chris Pucci <a-cpucci at microsoft dot com>
- * @author Ryan Biesemeyer <v-ryanbi at microsoft dot com>
- * @author Ryan Schmidt <skizzerz at gmail dot com>
- */
-
-/**
- * @ingroup Database
- */
-class DatabaseMssql extends Database {
-       protected $mInsertId = null;
-       protected $mLastResult = null;
-       protected $mAffectedRows = null;
-       protected $mSubqueryId = 0;
-       protected $mScrollableCursor = true;
-       protected $mPrepareStatements = true;
-       protected $mBinaryColumnCache = null;
-       protected $mBitColumnCache = null;
-       protected $mIgnoreDupKeyErrors = false;
-       protected $mIgnoreErrors = [];
-
-       protected $mPort;
-
-       public function implicitGroupby() {
-               return false;
-       }
-
-       public function implicitOrderby() {
-               return false;
-       }
-
-       public function unionSupportsOrderAndLimit() {
-               return false;
-       }
-
-       /**
-        * Usually aborts on failure
-        * @param string $server
-        * @param string $user
-        * @param string $password
-        * @param string $dbName
-        * @throws DBConnectionError
-        * @return bool|resource|null
-        */
-       public function open( $server, $user, $password, $dbName ) {
-               # Test for driver support, to avoid suppressed fatal error
-               if ( !function_exists( 'sqlsrv_connect' ) ) {
-                       throw new DBConnectionError(
-                               $this,
-                               "Microsoft SQL Server Native (sqlsrv) functions missing.
-                               You can download the driver from: http://go.microsoft.com/fwlink/?LinkId=123470\n"
-                       );
-               }
-
-               global $wgDBport, $wgDBWindowsAuthentication;
-
-               # e.g. the class is being loaded
-               if ( !strlen( $user ) ) {
-                       return null;
-               }
-
-               $this->close();
-               $this->mServer = $server;
-               $this->mPort = $wgDBport;
-               $this->mUser = $user;
-               $this->mPassword = $password;
-               $this->mDBname = $dbName;
-
-               $connectionInfo = [];
-
-               if ( $dbName ) {
-                       $connectionInfo['Database'] = $dbName;
-               }
-
-               // Decide which auth scenerio to use
-               // if we are using Windows auth, then don't add credentials to $connectionInfo
-               if ( !$wgDBWindowsAuthentication ) {
-                       $connectionInfo['UID'] = $user;
-                       $connectionInfo['PWD'] = $password;
-               }
-
-               MediaWiki\suppressWarnings();
-               $this->mConn = sqlsrv_connect( $server, $connectionInfo );
-               MediaWiki\restoreWarnings();
-
-               if ( $this->mConn === false ) {
-                       throw new DBConnectionError( $this, $this->lastError() );
-               }
-
-               $this->mOpened = true;
-
-               return $this->mConn;
-       }
-
-       /**
-        * Closes a database connection, if it is open
-        * Returns success, true if already closed
-        * @return bool
-        */
-       protected function closeConnection() {
-               return sqlsrv_close( $this->mConn );
-       }
-
-       /**
-        * @param bool|MssqlResultWrapper|resource $result
-        * @return bool|MssqlResultWrapper
-        */
-       protected function resultObject( $result ) {
-               if ( !$result ) {
-                       return false;
-               } elseif ( $result instanceof MssqlResultWrapper ) {
-                       return $result;
-               } elseif ( $result === true ) {
-                       // Successful write query
-                       return $result;
-               } else {
-                       return new MssqlResultWrapper( $this, $result );
-               }
-       }
-
-       /**
-        * @param string $sql
-        * @return bool|MssqlResult
-        * @throws DBUnexpectedError
-        */
-       protected function doQuery( $sql ) {
-               if ( $this->getFlag( DBO_DEBUG ) ) {
-                       wfDebug( "SQL: [$sql]\n" );
-               }
-               $this->offset = 0;
-
-               // several extensions seem to think that all databases support limits
-               // via LIMIT N after the WHERE clause, but  MSSQL uses SELECT TOP N,
-               // so to catch any of those extensions we'll do a quick check for a
-               // LIMIT clause and pass $sql through $this->LimitToTopN() which parses
-               // the LIMIT clause and passes the result to $this->limitResult();
-               if ( preg_match( '/\bLIMIT\s*/i', $sql ) ) {
-                       // massage LIMIT -> TopN
-                       $sql = $this->LimitToTopN( $sql );
-               }
-
-               // MSSQL doesn't have EXTRACT(epoch FROM XXX)
-               if ( preg_match( '#\bEXTRACT\s*?\(\s*?EPOCH\s+FROM\b#i', $sql, $matches ) ) {
-                       // This is same as UNIX_TIMESTAMP, we need to calc # of seconds from 1970
-                       $sql = str_replace( $matches[0], "DATEDIFF(s,CONVERT(datetime,'1/1/1970'),", $sql );
-               }
-
-               // perform query
-
-               // SQLSRV_CURSOR_STATIC is slower than SQLSRV_CURSOR_CLIENT_BUFFERED (one of the two is
-               // needed if we want to be able to seek around the result set), however CLIENT_BUFFERED
-               // has a bug in the sqlsrv driver where wchar_t types (such as nvarchar) that are empty
-               // strings make php throw a fatal error "Severe error translating Unicode"
-               if ( $this->mScrollableCursor ) {
-                       $scrollArr = [ 'Scrollable' => SQLSRV_CURSOR_STATIC ];
-               } else {
-                       $scrollArr = [];
-               }
-
-               if ( $this->mPrepareStatements ) {
-                       // we do prepare + execute so we can get its field metadata for later usage if desired
-                       $stmt = sqlsrv_prepare( $this->mConn, $sql, [], $scrollArr );
-                       $success = sqlsrv_execute( $stmt );
-               } else {
-                       $stmt = sqlsrv_query( $this->mConn, $sql, [], $scrollArr );
-                       $success = (bool)$stmt;
-               }
-
-               // Make a copy to ensure what we add below does not get reflected in future queries
-               $ignoreErrors = $this->mIgnoreErrors;
-
-               if ( $this->mIgnoreDupKeyErrors ) {
-                       // ignore duplicate key errors
-                       // this emulates INSERT IGNORE in MySQL
-                       $ignoreErrors[] = '2601'; // duplicate key error caused by unique index
-                       $ignoreErrors[] = '2627'; // duplicate key error caused by primary key
-                       $ignoreErrors[] = '3621'; // generic "the statement has been terminated" error
-               }
-
-               if ( $success === false ) {
-                       $errors = sqlsrv_errors();
-                       $success = true;
-
-                       foreach ( $errors as $err ) {
-                               if ( !in_array( $err['code'], $ignoreErrors ) ) {
-                                       $success = false;
-                                       break;
-                               }
-                       }
-
-                       if ( $success === false ) {
-                               return false;
-                       }
-               }
-               // remember number of rows affected
-               $this->mAffectedRows = sqlsrv_rows_affected( $stmt );
-
-               return $stmt;
-       }
-
-       public function freeResult( $res ) {
-               if ( $res instanceof ResultWrapper ) {
-                       $res = $res->result;
-               }
-
-               sqlsrv_free_stmt( $res );
-       }
-
-       /**
-        * @param MssqlResultWrapper $res
-        * @return stdClass
-        */
-       public function fetchObject( $res ) {
-               // $res is expected to be an instance of MssqlResultWrapper here
-               return $res->fetchObject();
-       }
-
-       /**
-        * @param MssqlResultWrapper $res
-        * @return array
-        */
-       public function fetchRow( $res ) {
-               return $res->fetchRow();
-       }
-
-       /**
-        * @param mixed $res
-        * @return int
-        */
-       public function numRows( $res ) {
-               if ( $res instanceof ResultWrapper ) {
-                       $res = $res->result;
-               }
-
-               $ret = sqlsrv_num_rows( $res );
-
-               if ( $ret === false ) {
-                       // we cannot get an amount of rows from this cursor type
-                       // has_rows returns bool true/false if the result has rows
-                       $ret = (int)sqlsrv_has_rows( $res );
-               }
-
-               return $ret;
-       }
-
-       /**
-        * @param mixed $res
-        * @return int
-        */
-       public function numFields( $res ) {
-               if ( $res instanceof ResultWrapper ) {
-                       $res = $res->result;
-               }
-
-               return sqlsrv_num_fields( $res );
-       }
-
-       /**
-        * @param mixed $res
-        * @param int $n
-        * @return int
-        */
-       public function fieldName( $res, $n ) {
-               if ( $res instanceof ResultWrapper ) {
-                       $res = $res->result;
-               }
-
-               return sqlsrv_field_metadata( $res )[$n]['Name'];
-       }
-
-       /**
-        * This must be called after nextSequenceVal
-        * @return int|null
-        */
-       public function insertId() {
-               return $this->mInsertId;
-       }
-
-       /**
-        * @param MssqlResultWrapper $res
-        * @param int $row
-        * @return bool
-        */
-       public function dataSeek( $res, $row ) {
-               return $res->seek( $row );
-       }
-
-       /**
-        * @return string
-        */
-       public function lastError() {
-               $strRet = '';
-               $retErrors = sqlsrv_errors( SQLSRV_ERR_ALL );
-               if ( $retErrors != null ) {
-                       foreach ( $retErrors as $arrError ) {
-                               $strRet .= $this->formatError( $arrError ) . "\n";
-                       }
-               } else {
-                       $strRet = "No errors found";
-               }
-
-               return $strRet;
-       }
-
-       /**
-        * @param array $err
-        * @return string
-        */
-       private function formatError( $err ) {
-               return '[SQLSTATE ' . $err['SQLSTATE'] . '][Error Code ' . $err['code'] . ']' . $err['message'];
-       }
-
-       /**
-        * @return string|int
-        */
-       public function lastErrno() {
-               $err = sqlsrv_errors( SQLSRV_ERR_ALL );
-               if ( $err !== null && isset( $err[0] ) ) {
-                       return $err[0]['code'];
-               } else {
-                       return 0;
-               }
-       }
-
-       /**
-        * @return int
-        */
-       public function affectedRows() {
-               return $this->mAffectedRows;
-       }
-
-       /**
-        * SELECT wrapper
-        *
-        * @param mixed $table Array or string, table name(s) (prefix auto-added)
-        * @param mixed $vars Array or string, field name(s) to be retrieved
-        * @param mixed $conds Array or string, condition(s) for WHERE
-        * @param string $fname Calling function name (use __METHOD__) for logs/profiling
-        * @param array $options Associative array of options (e.g.
-        *   [ 'GROUP BY' => 'page_title' ]), see Database::makeSelectOptions
-        *   code for list of supported stuff
-        * @param array $join_conds Associative array of table join conditions
-        *   (optional) (e.g. [ 'page' => [ 'LEFT JOIN','page_latest=rev_id' ] ]
-        * @return mixed Database result resource (feed to Database::fetchObject
-        *   or whatever), or false on failure
-        * @throws DBQueryError
-        * @throws DBUnexpectedError
-        * @throws Exception
-        */
-       public function select( $table, $vars, $conds = '', $fname = __METHOD__,
-               $options = [], $join_conds = []
-       ) {
-               $sql = $this->selectSQLText( $table, $vars, $conds, $fname, $options, $join_conds );
-               if ( isset( $options['EXPLAIN'] ) ) {
-                       try {
-                               $this->mScrollableCursor = false;
-                               $this->mPrepareStatements = false;
-                               $this->query( "SET SHOWPLAN_ALL ON" );
-                               $ret = $this->query( $sql, $fname );
-                               $this->query( "SET SHOWPLAN_ALL OFF" );
-                       } catch ( DBQueryError $dqe ) {
-                               if ( isset( $options['FOR COUNT'] ) ) {
-                                       // likely don't have privs for SHOWPLAN, so run a select count instead
-                                       $this->query( "SET SHOWPLAN_ALL OFF" );
-                                       unset( $options['EXPLAIN'] );
-                                       $ret = $this->select(
-                                               $table,
-                                               'COUNT(*) AS EstimateRows',
-                                               $conds,
-                                               $fname,
-                                               $options,
-                                               $join_conds
-                                       );
-                               } else {
-                                       // someone actually wanted the query plan instead of an est row count
-                                       // let them know of the error
-                                       $this->mScrollableCursor = true;
-                                       $this->mPrepareStatements = true;
-                                       throw $dqe;
-                               }
-                       }
-                       $this->mScrollableCursor = true;
-                       $this->mPrepareStatements = true;
-                       return $ret;
-               }
-               return $this->query( $sql, $fname );
-       }
-
-       /**
-        * SELECT wrapper
-        *
-        * @param mixed $table Array or string, table name(s) (prefix auto-added)
-        * @param mixed $vars Array or string, field name(s) to be retrieved
-        * @param mixed $conds Array or string, condition(s) for WHERE
-        * @param string $fname Calling function name (use __METHOD__) for logs/profiling
-        * @param array $options Associative array of options (e.g. [ 'GROUP BY' => 'page_title' ]),
-        *   see Database::makeSelectOptions code for list of supported stuff
-        * @param array $join_conds Associative array of table join conditions (optional)
-        *    (e.g. [ 'page' => [ 'LEFT JOIN','page_latest=rev_id' ] ]
-        * @return string The SQL text
-        */
-       public function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__,
-               $options = [], $join_conds = []
-       ) {
-               if ( isset( $options['EXPLAIN'] ) ) {
-                       unset( $options['EXPLAIN'] );
-               }
-
-               $sql = parent::selectSQLText( $table, $vars, $conds, $fname, $options, $join_conds );
-
-               // try to rewrite aggregations of bit columns (currently MAX and MIN)
-               if ( strpos( $sql, 'MAX(' ) !== false || strpos( $sql, 'MIN(' ) !== false ) {
-                       $bitColumns = [];
-                       if ( is_array( $table ) ) {
-                               foreach ( $table as $t ) {
-                                       $bitColumns += $this->getBitColumns( $this->tableName( $t ) );
-                               }
-                       } else {
-                               $bitColumns = $this->getBitColumns( $this->tableName( $table ) );
-                       }
-
-                       foreach ( $bitColumns as $col => $info ) {
-                               $replace = [
-                                       "MAX({$col})" => "MAX(CAST({$col} AS tinyint))",
-                                       "MIN({$col})" => "MIN(CAST({$col} AS tinyint))",
-                               ];
-                               $sql = str_replace( array_keys( $replace ), array_values( $replace ), $sql );
-                       }
-               }
-
-               return $sql;
-       }
-
-       public function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds,
-               $fname = __METHOD__
-       ) {
-               $this->mScrollableCursor = false;
-               try {
-                       parent::deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname );
-               } catch ( Exception $e ) {
-                       $this->mScrollableCursor = true;
-                       throw $e;
-               }
-               $this->mScrollableCursor = true;
-       }
-
-       public function delete( $table, $conds, $fname = __METHOD__ ) {
-               $this->mScrollableCursor = false;
-               try {
-                       parent::delete( $table, $conds, $fname );
-               } catch ( Exception $e ) {
-                       $this->mScrollableCursor = true;
-                       throw $e;
-               }
-               $this->mScrollableCursor = true;
-       }
-
-       /**
-        * Estimate rows in dataset
-        * Returns estimated count, based on SHOWPLAN_ALL output
-        * This is not necessarily an accurate estimate, so use sparingly
-        * Returns -1 if count cannot be found
-        * Takes same arguments as Database::select()
-        * @param string $table
-        * @param string $vars
-        * @param string $conds
-        * @param string $fname
-        * @param array $options
-        * @return int
-        */
-       public function estimateRowCount( $table, $vars = '*', $conds = '',
-               $fname = __METHOD__, $options = []
-       ) {
-               // http://msdn2.microsoft.com/en-us/library/aa259203.aspx
-               $options['EXPLAIN'] = true;
-               $options['FOR COUNT'] = true;
-               $res = $this->select( $table, $vars, $conds, $fname, $options );
-
-               $rows = -1;
-               if ( $res ) {
-                       $row = $this->fetchRow( $res );
-
-                       if ( isset( $row['EstimateRows'] ) ) {
-                               $rows = (int)$row['EstimateRows'];
-                       }
-               }
-
-               return $rows;
-       }
-
-       /**
-        * Returns information about an index
-        * If errors are explicitly ignored, returns NULL on failure
-        * @param string $table
-        * @param string $index
-        * @param string $fname
-        * @return array|bool|null
-        */
-       public function indexInfo( $table, $index, $fname = __METHOD__ ) {
-               # This does not return the same info as MYSQL would, but that's OK
-               # because MediaWiki never uses the returned value except to check for
-               # the existence of indexes.
-               $sql = "sp_helpindex '" . $this->tableName( $table ) . "'";
-               $res = $this->query( $sql, $fname );
-
-               if ( !$res ) {
-                       return null;
-               }
-
-               $result = [];
-               foreach ( $res as $row ) {
-                       if ( $row->index_name == $index ) {
-                               $row->Non_unique = !stristr( $row->index_description, "unique" );
-                               $cols = explode( ", ", $row->index_keys );
-                               foreach ( $cols as $col ) {
-                                       $row->Column_name = trim( $col );
-                                       $result[] = clone $row;
-                               }
-                       } elseif ( $index == 'PRIMARY' && stristr( $row->index_description, 'PRIMARY' ) ) {
-                               $row->Non_unique = 0;
-                               $cols = explode( ", ", $row->index_keys );
-                               foreach ( $cols as $col ) {
-                                       $row->Column_name = trim( $col );
-                                       $result[] = clone $row;
-                               }
-                       }
-               }
-
-               return empty( $result ) ? false : $result;
-       }
-
-       /**
-        * INSERT wrapper, inserts an array into a table
-        *
-        * $arrToInsert may be a single associative array, or an array of these with numeric keys, for
-        * multi-row insert.
-        *
-        * Usually aborts on failure
-        * If errors are explicitly ignored, returns success
-        * @param string $table
-        * @param array $arrToInsert
-        * @param string $fname
-        * @param array $options
-        * @return bool
-        * @throws Exception
-        */
-       public function insert( $table, $arrToInsert, $fname = __METHOD__, $options = [] ) {
-               # No rows to insert, easy just return now
-               if ( !count( $arrToInsert ) ) {
-                       return true;
-               }
-
-               if ( !is_array( $options ) ) {
-                       $options = [ $options ];
-               }
-
-               $table = $this->tableName( $table );
-
-               if ( !( isset( $arrToInsert[0] ) && is_array( $arrToInsert[0] ) ) ) { // Not multi row
-                       $arrToInsert = [ 0 => $arrToInsert ]; // make everything multi row compatible
-               }
-
-               // We know the table we're inserting into, get its identity column
-               $identity = null;
-               // strip matching square brackets and the db/schema from table name
-               $tableRawArr = explode( '.', preg_replace( '#\[([^\]]*)\]#', '$1', $table ) );
-               $tableRaw = array_pop( $tableRawArr );
-               $res = $this->doQuery(
-                       "SELECT NAME AS idColumn FROM SYS.IDENTITY_COLUMNS " .
-                               "WHERE OBJECT_NAME(OBJECT_ID)='{$tableRaw}'"
-               );
-               if ( $res && sqlsrv_has_rows( $res ) ) {
-                       // There is an identity for this table.
-                       $identityArr = sqlsrv_fetch_array( $res, SQLSRV_FETCH_ASSOC );
-                       $identity = array_pop( $identityArr );
-               }
-               sqlsrv_free_stmt( $res );
-
-               // Determine binary/varbinary fields so we can encode data as a hex string like 0xABCDEF
-               $binaryColumns = $this->getBinaryColumns( $table );
-
-               // INSERT IGNORE is not supported by SQL Server
-               // remove IGNORE from options list and set ignore flag to true
-               if ( in_array( 'IGNORE', $options ) ) {
-                       $options = array_diff( $options, [ 'IGNORE' ] );
-                       $this->mIgnoreDupKeyErrors = true;
-               }
-
-               foreach ( $arrToInsert as $a ) {
-                       // start out with empty identity column, this is so we can return
-                       // it as a result of the INSERT logic
-                       $sqlPre = '';
-                       $sqlPost = '';
-                       $identityClause = '';
-
-                       // if we have an identity column
-                       if ( $identity ) {
-                               // iterate through
-                               foreach ( $a as $k => $v ) {
-                                       if ( $k == $identity ) {
-                                               if ( !is_null( $v ) ) {
-                                                       // there is a value being passed to us,
-                                                       // we need to turn on and off inserted identity
-                                                       $sqlPre = "SET IDENTITY_INSERT $table ON;";
-                                                       $sqlPost = ";SET IDENTITY_INSERT $table OFF;";
-                                               } else {
-                                                       // we can't insert NULL into an identity column,
-                                                       // so remove the column from the insert.
-                                                       unset( $a[$k] );
-                                               }
-                                       }
-                               }
-
-                               // we want to output an identity column as result
-                               $identityClause = "OUTPUT INSERTED.$identity ";
-                       }
-
-                       $keys = array_keys( $a );
-
-                       // Build the actual query
-                       $sql = $sqlPre . 'INSERT ' . implode( ' ', $options ) .
-                               " INTO $table (" . implode( ',', $keys ) . ") $identityClause VALUES (";
-
-                       $first = true;
-                       foreach ( $a as $key => $value ) {
-                               if ( isset( $binaryColumns[$key] ) ) {
-                                       $value = new MssqlBlob( $value );
-                               }
-                               if ( $first ) {
-                                       $first = false;
-                               } else {
-                                       $sql .= ',';
-                               }
-                               if ( is_null( $value ) ) {
-                                       $sql .= 'null';
-                               } elseif ( is_array( $value ) || is_object( $value ) ) {
-                                       if ( is_object( $value ) && $value instanceof Blob ) {
-                                               $sql .= $this->addQuotes( $value );
-                                       } else {
-                                               $sql .= $this->addQuotes( serialize( $value ) );
-                                       }
-                               } else {
-                                       $sql .= $this->addQuotes( $value );
-                               }
-                       }
-                       $sql .= ')' . $sqlPost;
-
-                       // Run the query
-                       $this->mScrollableCursor = false;
-                       try {
-                               $ret = $this->query( $sql );
-                       } catch ( Exception $e ) {
-                               $this->mScrollableCursor = true;
-                               $this->mIgnoreDupKeyErrors = false;
-                               throw $e;
-                       }
-                       $this->mScrollableCursor = true;
-
-                       if ( !is_null( $identity ) ) {
-                               // then we want to get the identity column value we were assigned and save it off
-                               $row = $ret->fetchObject();
-                               if ( is_object( $row ) ) {
-                                       $this->mInsertId = $row->$identity;
-
-                                       // it seems that mAffectedRows is -1 sometimes when OUTPUT INSERTED.identity is used
-                                       // if we got an identity back, we know for sure a row was affected, so adjust that here
-                                       if ( $this->mAffectedRows == -1 ) {
-                                               $this->mAffectedRows = 1;
-                                       }
-                               }
-                       }
-               }
-               $this->mIgnoreDupKeyErrors = false;
-               return $ret;
-       }
-
-       /**
-        * INSERT SELECT wrapper
-        * $varMap must be an associative array of the form [ 'dest1' => 'source1', ... ]
-        * Source items may be literals rather than field names, but strings should
-        * be quoted with Database::addQuotes().
-        * @param string $destTable
-        * @param array|string $srcTable May be an array of tables.
-        * @param array $varMap
-        * @param array $conds May be "*" to copy the whole table.
-        * @param string $fname
-        * @param array $insertOptions
-        * @param array $selectOptions
-        * @return null|ResultWrapper
-        * @throws Exception
-        */
-       public function nativeInsertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__,
-               $insertOptions = [], $selectOptions = []
-       ) {
-               $this->mScrollableCursor = false;
-               try {
-                       $ret = parent::nativeInsertSelect(
-                               $destTable,
-                               $srcTable,
-                               $varMap,
-                               $conds,
-                               $fname,
-                               $insertOptions,
-                               $selectOptions
-                       );
-               } catch ( Exception $e ) {
-                       $this->mScrollableCursor = true;
-                       throw $e;
-               }
-               $this->mScrollableCursor = true;
-
-               return $ret;
-       }
-
-       /**
-        * UPDATE wrapper. Takes a condition array and a SET array.
-        *
-        * @param string $table Name of the table to UPDATE. This will be passed through
-        *                Database::tableName().
-        *
-        * @param array $values An array of values to SET. For each array element,
-        *                the key gives the field name, and the value gives the data
-        *                to set that field to. The data will be quoted by
-        *                Database::addQuotes().
-        *
-        * @param array $conds An array of conditions (WHERE). See
-        *                Database::select() for the details of the format of
-        *                condition arrays. Use '*' to update all rows.
-        *
-        * @param string $fname The function name of the caller (from __METHOD__),
-        *                for logging and profiling.
-        *
-        * @param array $options An array of UPDATE options, can be:
-        *                   - IGNORE: Ignore unique key conflicts
-        *                   - LOW_PRIORITY: MySQL-specific, see MySQL manual.
-        * @return bool
-        * @throws DBUnexpectedError
-        * @throws Exception
-        */
-       function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) {
-               $table = $this->tableName( $table );
-               $binaryColumns = $this->getBinaryColumns( $table );
-
-               $opts = $this->makeUpdateOptions( $options );
-               $sql = "UPDATE $opts $table SET " . $this->makeList( $values, LIST_SET, $binaryColumns );
-
-               if ( $conds !== [] && $conds !== '*' ) {
-                       $sql .= " WHERE " . $this->makeList( $conds, LIST_AND, $binaryColumns );
-               }
-
-               $this->mScrollableCursor = false;
-               try {
-                       $this->query( $sql );
-               } catch ( Exception $e ) {
-                       $this->mScrollableCursor = true;
-                       throw $e;
-               }
-               $this->mScrollableCursor = true;
-               return true;
-       }
-
-       /**
-        * Makes an encoded list of strings from an array
-        * @param array $a Containing the data
-        * @param int $mode Constant
-        *      - LIST_COMMA:          comma separated, no field names
-        *      - LIST_AND:            ANDed WHERE clause (without the WHERE). See
-        *        the documentation for $conds in Database::select().
-        *      - LIST_OR:             ORed WHERE clause (without the WHERE)
-        *      - LIST_SET:            comma separated with field names, like a SET clause
-        *      - LIST_NAMES:          comma separated field names
-        * @param array $binaryColumns Contains a list of column names that are binary types
-        *      This is a custom parameter only present for MS SQL.
-        *
-        * @throws DBUnexpectedError
-        * @return string
-        */
-       public function makeList( $a, $mode = LIST_COMMA, $binaryColumns = [] ) {
-               if ( !is_array( $a ) ) {
-                       throw new DBUnexpectedError( $this, __METHOD__ . ' called with incorrect parameters' );
-               }
-
-               if ( $mode != LIST_NAMES ) {
-                       // In MS SQL, values need to be specially encoded when they are
-                       // inserted into binary fields. Perform this necessary encoding
-                       // for the specified set of columns.
-                       foreach ( array_keys( $a ) as $field ) {
-                               if ( !isset( $binaryColumns[$field] ) ) {
-                                       continue;
-                               }
-
-                               if ( is_array( $a[$field] ) ) {
-                                       foreach ( $a[$field] as &$v ) {
-                                               $v = new MssqlBlob( $v );
-                                       }
-                                       unset( $v );
-                               } else {
-                                       $a[$field] = new MssqlBlob( $a[$field] );
-                               }
-                       }
-               }
-
-               return parent::makeList( $a, $mode );
-       }
-
-       /**
-        * @param string $table
-        * @param string $field
-        * @return int Returns the size of a text field, or -1 for "unlimited"
-        */
-       public function textFieldSize( $table, $field ) {
-               $table = $this->tableName( $table );
-               $sql = "SELECT CHARACTER_MAXIMUM_LENGTH,DATA_TYPE FROM INFORMATION_SCHEMA.Columns
-                       WHERE TABLE_NAME = '$table' AND COLUMN_NAME = '$field'";
-               $res = $this->query( $sql );
-               $row = $this->fetchRow( $res );
-               $size = -1;
-               if ( strtolower( $row['DATA_TYPE'] ) != 'text' ) {
-                       $size = $row['CHARACTER_MAXIMUM_LENGTH'];
-               }
-
-               return $size;
-       }
-
-       /**
-        * Construct a LIMIT query with optional offset
-        * This is used for query pages
-        *
-        * @param string $sql SQL query we will append the limit too
-        * @param int $limit The SQL limit
-        * @param bool|int $offset The SQL offset (default false)
-        * @return array|string
-        * @throws DBUnexpectedError
-        */
-       public function limitResult( $sql, $limit, $offset = false ) {
-               if ( $offset === false || $offset == 0 ) {
-                       if ( strpos( $sql, "SELECT" ) === false ) {
-                               return "TOP {$limit} " . $sql;
-                       } else {
-                               return preg_replace( '/\bSELECT(\s+DISTINCT)?\b/Dsi',
-                                       'SELECT$1 TOP ' . $limit, $sql, 1 );
-                       }
-               } else {
-                       // This one is fun, we need to pull out the select list as well as any ORDER BY clause
-                       $select = $orderby = [];
-                       $s1 = preg_match( '#SELECT\s+(.+?)\s+FROM#Dis', $sql, $select );
-                       $s2 = preg_match( '#(ORDER BY\s+.+?)(\s*FOR XML .*)?$#Dis', $sql, $orderby );
-                       $overOrder = $postOrder = '';
-                       $first = $offset + 1;
-                       $last = $offset + $limit;
-                       $sub1 = 'sub_' . $this->mSubqueryId;
-                       $sub2 = 'sub_' . ( $this->mSubqueryId + 1 );
-                       $this->mSubqueryId += 2;
-                       if ( !$s1 ) {
-                               // wat
-                               throw new DBUnexpectedError( $this, "Attempting to LIMIT a non-SELECT query\n" );
-                       }
-                       if ( !$s2 ) {
-                               // no ORDER BY
-                               $overOrder = 'ORDER BY (SELECT 1)';
-                       } else {
-                               if ( !isset( $orderby[2] ) || !$orderby[2] ) {
-                                       // don't need to strip it out if we're using a FOR XML clause
-                                       $sql = str_replace( $orderby[1], '', $sql );
-                               }
-                               $overOrder = $orderby[1];
-                               $postOrder = ' ' . $overOrder;
-                       }
-                       $sql = "SELECT {$select[1]}
-                                       FROM (
-                                               SELECT ROW_NUMBER() OVER({$overOrder}) AS rowNumber, *
-                                               FROM ({$sql}) {$sub1}
-                                       ) {$sub2}
-                                       WHERE rowNumber BETWEEN {$first} AND {$last}{$postOrder}";
-
-                       return $sql;
-               }
-       }
-
-       /**
-        * If there is a limit clause, parse it, strip it, and pass the remaining
-        * SQL through limitResult() with the appropriate parameters. Not the
-        * prettiest solution, but better than building a whole new parser. This
-        * exists becase there are still too many extensions that don't use dynamic
-        * sql generation.
-        *
-        * @param string $sql
-        * @return array|mixed|string
-        */
-       public function LimitToTopN( $sql ) {
-               // Matches: LIMIT {[offset,] row_count | row_count OFFSET offset}
-               $pattern = '/\bLIMIT\s+((([0-9]+)\s*,\s*)?([0-9]+)(\s+OFFSET\s+([0-9]+))?)/i';
-               if ( preg_match( $pattern, $sql, $matches ) ) {
-                       $row_count = $matches[4];
-                       $offset = $matches[3] ?: $matches[6] ?: false;
-
-                       // strip the matching LIMIT clause out
-                       $sql = str_replace( $matches[0], '', $sql );
-
-                       return $this->limitResult( $sql, $row_count, $offset );
-               }
-
-               return $sql;
-       }
-
-       /**
-        * @return string Wikitext of a link to the server software's web site
-        */
-       public function getSoftwareLink() {
-               return "[{{int:version-db-mssql-url}} MS SQL Server]";
-       }
-
-       /**
-        * @return string Version information from the database
-        */
-       public function getServerVersion() {
-               $server_info = sqlsrv_server_info( $this->mConn );
-               $version = 'Error';
-               if ( isset( $server_info['SQLServerVersion'] ) ) {
-                       $version = $server_info['SQLServerVersion'];
-               }
-
-               return $version;
-       }
-
-       /**
-        * @param string $table
-        * @param string $fname
-        * @return bool
-        */
-       public function tableExists( $table, $fname = __METHOD__ ) {
-               list( $db, $schema, $table ) = $this->tableName( $table, 'split' );
-
-               if ( $db !== false ) {
-                       // remote database
-                       wfDebug( "Attempting to call tableExists on a remote table" );
-                       return false;
-               }
-
-               if ( $schema === false ) {
-                       global $wgDBmwschema;
-                       $schema = $wgDBmwschema;
-               }
-
-               $res = $this->query( "SELECT 1 FROM INFORMATION_SCHEMA.TABLES
-                       WHERE TABLE_TYPE = 'BASE TABLE'
-                       AND TABLE_SCHEMA = '$schema' AND TABLE_NAME = '$table'" );
-
-               if ( $res->numRows() ) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-
-       /**
-        * Query whether a given column exists in the mediawiki schema
-        * @param string $table
-        * @param string $field
-        * @param string $fname
-        * @return bool
-        */
-       public function fieldExists( $table, $field, $fname = __METHOD__ ) {
-               list( $db, $schema, $table ) = $this->tableName( $table, 'split' );
-
-               if ( $db !== false ) {
-                       // remote database
-                       wfDebug( "Attempting to call fieldExists on a remote table" );
-                       return false;
-               }
-
-               $res = $this->query( "SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS
-                       WHERE TABLE_SCHEMA = '$schema' AND TABLE_NAME = '$table' AND COLUMN_NAME = '$field'" );
-
-               if ( $res->numRows() ) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-
-       public function fieldInfo( $table, $field ) {
-               list( $db, $schema, $table ) = $this->tableName( $table, 'split' );
-
-               if ( $db !== false ) {
-                       // remote database
-                       wfDebug( "Attempting to call fieldInfo on a remote table" );
-                       return false;
-               }
-
-               $res = $this->query( "SELECT * FROM INFORMATION_SCHEMA.COLUMNS
-                       WHERE TABLE_SCHEMA = '$schema' AND TABLE_NAME = '$table' AND COLUMN_NAME = '$field'" );
-
-               $meta = $res->fetchRow();
-               if ( $meta ) {
-                       return new MssqlField( $meta );
-               }
-
-               return false;
-       }
-
-       /**
-        * Begin a transaction, committing any previously open transaction
-        * @param string $fname
-        */
-       protected function doBegin( $fname = __METHOD__ ) {
-               sqlsrv_begin_transaction( $this->mConn );
-               $this->mTrxLevel = 1;
-       }
-
-       /**
-        * End a transaction
-        * @param string $fname
-        */
-       protected function doCommit( $fname = __METHOD__ ) {
-               sqlsrv_commit( $this->mConn );
-               $this->mTrxLevel = 0;
-       }
-
-       /**
-        * Rollback a transaction.
-        * No-op on non-transactional databases.
-        * @param string $fname
-        */
-       protected function doRollback( $fname = __METHOD__ ) {
-               sqlsrv_rollback( $this->mConn );
-               $this->mTrxLevel = 0;
-       }
-
-       /**
-        * Escapes a identifier for use inm SQL.
-        * Throws an exception if it is invalid.
-        * Reference: http://msdn.microsoft.com/en-us/library/aa224033%28v=SQL.80%29.aspx
-        * @param string $identifier
-        * @throws InvalidArgumentException
-        * @return string
-        */
-       private function escapeIdentifier( $identifier ) {
-               if ( strlen( $identifier ) == 0 ) {
-                       throw new InvalidArgumentException( "An identifier must not be empty" );
-               }
-               if ( strlen( $identifier ) > 128 ) {
-                       throw new InvalidArgumentException( "The identifier '$identifier' is too long (max. 128)" );
-               }
-               if ( ( strpos( $identifier, '[' ) !== false )
-                       || ( strpos( $identifier, ']' ) !== false )
-               ) {
-                       // It may be allowed if you quoted with double quotation marks, but
-                       // that would break if QUOTED_IDENTIFIER is OFF
-                       throw new InvalidArgumentException( "Square brackets are not allowed in '$identifier'" );
-               }
-
-               return "[$identifier]";
-       }
-
-       /**
-        * @param string $s
-        * @return string
-        */
-       public function strencode( $s ) {
-               // Should not be called by us
-
-               return str_replace( "'", "''", $s );
-       }
-
-       /**
-        * @param string|int|null|bool|Blob $s
-        * @return string|int
-        */
-       public function addQuotes( $s ) {
-               if ( $s instanceof MssqlBlob ) {
-                       return $s->fetch();
-               } elseif ( $s instanceof Blob ) {
-                       // this shouldn't really ever be called, but it's here if needed
-                       // (and will quite possibly make the SQL error out)
-                       $blob = new MssqlBlob( $s->fetch() );
-                       return $blob->fetch();
-               } else {
-                       if ( is_bool( $s ) ) {
-                               $s = $s ? 1 : 0;
-                       }
-                       return parent::addQuotes( $s );
-               }
-       }
-
-       /**
-        * @param string $s
-        * @return string
-        */
-       public function addIdentifierQuotes( $s ) {
-               // http://msdn.microsoft.com/en-us/library/aa223962.aspx
-               return '[' . $s . ']';
-       }
-
-       /**
-        * @param string $name
-        * @return bool
-        */
-       public function isQuotedIdentifier( $name ) {
-               return strlen( $name ) && $name[0] == '[' && substr( $name, -1, 1 ) == ']';
-       }
-
-       /**
-        * MS SQL supports more pattern operators than other databases (ex: [,],^)
-        *
-        * @param string $s
-        * @return string
-        */
-       protected function escapeLikeInternal( $s ) {
-               return addcslashes( $s, '\%_[]^' );
-       }
-
-       /**
-        * MS SQL requires specifying the escape character used in a LIKE query
-        * or using Square brackets to surround characters that are to be escaped
-        * https://msdn.microsoft.com/en-us/library/ms179859.aspx
-        * Here we take the Specify-Escape-Character approach since it's less
-        * invasive, renders a query that is closer to other DB's and better at
-        * handling square bracket escaping
-        *
-        * @return string Fully built LIKE statement
-        */
-       public function buildLike() {
-               $params = func_get_args();
-               if ( count( $params ) > 0 && is_array( $params[0] ) ) {
-                       $params = $params[0];
-               }
-
-               return parent::buildLike( $params ) . " ESCAPE '\' ";
-       }
-
-       /**
-        * @param string $db
-        * @return bool
-        */
-       public function selectDB( $db ) {
-               try {
-                       $this->mDBname = $db;
-                       $this->query( "USE $db" );
-                       return true;
-               } catch ( Exception $e ) {
-                       return false;
-               }
-       }
-
-       /**
-        * @param array $options An associative array of options to be turned into
-        *   an SQL query, valid keys are listed in the function.
-        * @return array
-        */
-       public function makeSelectOptions( $options ) {
-               $tailOpts = '';
-               $startOpts = '';
-
-               $noKeyOptions = [];
-               foreach ( $options as $key => $option ) {
-                       if ( is_numeric( $key ) ) {
-                               $noKeyOptions[$option] = true;
-                       }
-               }
-
-               $tailOpts .= $this->makeGroupByWithHaving( $options );
-
-               $tailOpts .= $this->makeOrderBy( $options );
-
-               if ( isset( $noKeyOptions['DISTINCT'] ) || isset( $noKeyOptions['DISTINCTROW'] ) ) {
-                       $startOpts .= 'DISTINCT';
-               }
-
-               if ( isset( $noKeyOptions['FOR XML'] ) ) {
-                       // used in group concat field emulation
-                       $tailOpts .= " FOR XML PATH('')";
-               }
-
-               // we want this to be compatible with the output of parent::makeSelectOptions()
-               return [ $startOpts, '', $tailOpts, '', '' ];
-       }
-
-       /**
-        * Get the type of the DBMS, as it appears in $wgDBtype.
-        * @return string
-        */
-       public function getType() {
-               return 'mssql';
-       }
-
-       /**
-        * @param array $stringList
-        * @return string
-        */
-       public function buildConcat( $stringList ) {
-               return implode( ' + ', $stringList );
-       }
-
-       /**
-        * Build a GROUP_CONCAT or equivalent statement for a query.
-        * MS SQL doesn't have GROUP_CONCAT so we emulate it with other stuff (and boy is it nasty)
-        *
-        * This is useful for combining a field for several rows into a single string.
-        * NULL values will not appear in the output, duplicated values will appear,
-        * and the resulting delimiter-separated values have no defined sort order.
-        * Code using the results may need to use the PHP unique() or sort() methods.
-        *
-        * @param string $delim Glue to bind the results together
-        * @param string|array $table Table name
-        * @param string $field Field name
-        * @param string|array $conds Conditions
-        * @param string|array $join_conds Join conditions
-        * @return string SQL text
-        * @since 1.23
-        */
-       public function buildGroupConcatField( $delim, $table, $field, $conds = '',
-               $join_conds = []
-       ) {
-               $gcsq = 'gcsq_' . $this->mSubqueryId;
-               $this->mSubqueryId++;
-
-               $delimLen = strlen( $delim );
-               $fld = "{$field} + {$this->addQuotes( $delim )}";
-               $sql = "(SELECT LEFT({$field}, LEN({$field}) - {$delimLen}) FROM ("
-                       . $this->selectSQLText( $table, $fld, $conds, null, [ 'FOR XML' ], $join_conds )
-                       . ") {$gcsq} ({$field}))";
-
-               return $sql;
-       }
-
-       /**
-        * Returns an associative array for fields that are of type varbinary, binary, or image
-        * $table can be either a raw table name or passed through tableName() first
-        * @param string $table
-        * @return array
-        */
-       private function getBinaryColumns( $table ) {
-               $tableRawArr = explode( '.', preg_replace( '#\[([^\]]*)\]#', '$1', $table ) );
-               $tableRaw = array_pop( $tableRawArr );
-
-               if ( $this->mBinaryColumnCache === null ) {
-                       $this->populateColumnCaches();
-               }
-
-               return isset( $this->mBinaryColumnCache[$tableRaw] )
-                       ? $this->mBinaryColumnCache[$tableRaw]
-                       : [];
-       }
-
-       /**
-        * @param string $table
-        * @return array
-        */
-       private function getBitColumns( $table ) {
-               $tableRawArr = explode( '.', preg_replace( '#\[([^\]]*)\]#', '$1', $table ) );
-               $tableRaw = array_pop( $tableRawArr );
-
-               if ( $this->mBitColumnCache === null ) {
-                       $this->populateColumnCaches();
-               }
-
-               return isset( $this->mBitColumnCache[$tableRaw] )
-                       ? $this->mBitColumnCache[$tableRaw]
-                       : [];
-       }
-
-       private function populateColumnCaches() {
-               $res = $this->select( 'INFORMATION_SCHEMA.COLUMNS', '*',
-                       [
-                               'TABLE_CATALOG' => $this->mDBname,
-                               'TABLE_SCHEMA' => $this->mSchema,
-                               'DATA_TYPE' => [ 'varbinary', 'binary', 'image', 'bit' ]
-                       ] );
-
-               $this->mBinaryColumnCache = [];
-               $this->mBitColumnCache = [];
-               foreach ( $res as $row ) {
-                       if ( $row->DATA_TYPE == 'bit' ) {
-                               $this->mBitColumnCache[$row->TABLE_NAME][$row->COLUMN_NAME] = $row;
-                       } else {
-                               $this->mBinaryColumnCache[$row->TABLE_NAME][$row->COLUMN_NAME] = $row;
-                       }
-               }
-       }
-
-       /**
-        * @param string $name
-        * @param string $format
-        * @return string
-        */
-       function tableName( $name, $format = 'quoted' ) {
-               # Replace reserved words with better ones
-               switch ( $name ) {
-                       case 'user':
-                               return $this->realTableName( 'mwuser', $format );
-                       default:
-                               return $this->realTableName( $name, $format );
-               }
-       }
-
-       /**
-        * call this instead of tableName() in the updater when renaming tables
-        * @param string $name
-        * @param string $format One of quoted, raw, or split
-        * @return string
-        */
-       function realTableName( $name, $format = 'quoted' ) {
-               $table = parent::tableName( $name, $format );
-               if ( $format == 'split' ) {
-                       // Used internally, we want the schema split off from the table name and returned
-                       // as a list with 3 elements (database, schema, table)
-                       $table = explode( '.', $table );
-                       while ( count( $table ) < 3 ) {
-                               array_unshift( $table, false );
-                       }
-               }
-               return $table;
-       }
-
-       /**
-        * Delete a table
-        * @param string $tableName
-        * @param string $fName
-        * @return bool|ResultWrapper
-        * @since 1.18
-        */
-       public function dropTable( $tableName, $fName = __METHOD__ ) {
-               if ( !$this->tableExists( $tableName, $fName ) ) {
-                       return false;
-               }
-
-               // parent function incorrectly appends CASCADE, which we don't want
-               $sql = "DROP TABLE " . $this->tableName( $tableName );
-
-               return $this->query( $sql, $fName );
-       }
-
-       /**
-        * Called in the installer and updater.
-        * Probably doesn't need to be called anywhere else in the codebase.
-        * @param bool|null $value
-        * @return bool|null
-        */
-       public function prepareStatements( $value = null ) {
-               return wfSetVar( $this->mPrepareStatements, $value );
-       }
-
-       /**
-        * Called in the installer and updater.
-        * Probably doesn't need to be called anywhere else in the codebase.
-        * @param bool|null $value
-        * @return bool|null
-        */
-       public function scrollableCursor( $value = null ) {
-               return wfSetVar( $this->mScrollableCursor, $value );
-       }
-
-       /**
-        * Called in the installer and updater.
-        * Probably doesn't need to be called anywhere else in the codebase.
-        * @param array|null $value
-        * @return array|null
-        */
-       public function ignoreErrors( array $value = null ) {
-               return wfSetVar( $this->mIgnoreErrors, $value );
-       }
-} // end DatabaseMssql class
index 09d8fab..0186222 100644 (file)
@@ -72,7 +72,13 @@ abstract class MWLBFactory {
                                                        // Work around the reserved word usage in MediaWiki schema
                                                        'keywordTableMap' => [ 'user' => 'mwuser', 'text' => 'pagecontent' ]
                                                ];
+                                       } elseif ( $server['type'] === 'mssql' ) {
+                                               $server += [
+                                                       'port' => $mainConfig->get( 'DBport' ),
+                                                       'useWindowsAuth' => $mainConfig->get( 'DBWindowsAuthentication' )
+                                               ];
                                        }
+
                                        if ( in_array( $server['type'], $typesWithSchema, true ) ) {
                                                $server += [ 'schema' => $mainConfig->get( 'DBmwschema' ) ];
                                        }
@@ -112,6 +118,9 @@ abstract class MWLBFactory {
                                        $server['port'] = $mainConfig->get( 'DBport' );
                                        // Work around the reserved word usage in MediaWiki schema
                                        $server['keywordTableMap'] = [ 'user' => 'mwuser', 'text' => 'pagecontent' ];
+                               } elseif ( $server['type'] === 'mssql' ) {
+                                       $server['port'] = $mainConfig->get( 'DBport' );
+                                       $server['useWindowsAuth'] = $mainConfig->get( 'DBWindowsAuthentication' );
                                }
                                $lbConf['servers'] = [ $server ];
                        }
index 2e06c40..62e635d 100644 (file)
@@ -22,6 +22,8 @@
  * @author Aaron Schulz
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Version of FileJournal that logs to a DB table
  * @since 1.20
@@ -180,7 +182,7 @@ class DBFileJournal extends FileJournal {
        protected function getMasterDB() {
                if ( !$this->dbw ) {
                        // Get a separate connection in autocommit mode
-                       $lb = wfGetLBFactory()->newMainLB();
+                       $lb =  MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->newMainLB();
                        $this->dbw = $lb->getConnection( DB_MASTER, [], $this->wiki );
                        $this->dbw->clearFlag( DBO_TRX );
                }
index 9be6c3d..7fa5a3d 100644 (file)
@@ -20,6 +20,7 @@
  * @file
  * @ingroup Deployment
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * Mysql update list and mysql-specific update functions.
@@ -853,7 +854,8 @@ class MysqlUpdater extends DatabaseUpdater {
                        foreach ( $res as $row ) {
                                $count = ( $count + 1 ) % 100;
                                if ( $count == 0 ) {
-                                       wfGetLBFactory()->waitForReplication( [ 'wiki' => wfWikiID() ] );
+                                       $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+                                       $lbFactory->waitForReplication( [ 'wiki' => wfWikiID() ] );
                                }
                                $this->db->insert( 'templatelinks',
                                        [
index f029d0a..f292ab3 100644 (file)
        "config-nofile": "\"$1\" 파일을 찾을 수 없습니다. 이미 삭제되었나요?",
        "config-extension-link": "당신의 위키가 [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Extensions 확장 기능]을 지원한다는 것을 알고 계십니까?\n\n[https://www.mediawiki.org/wiki/Special:MyLanguage/Category:Extensions_by_category 분류별 확장 기능]을 찾아보실 수 있습니다.",
        "mainpagetext": "<strong>미디어위키가 설치되었습니다.</strong>",
-       "mainpagedocfooter": "[https://meta.wikimedia.org/wiki/Help:Contents 이곳]에서 위키 소프트웨어에 대한 정보를 얻을 수 있습니다.\n\n== 시작하기 ==\n\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings 설정하기 목록]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ 미디어위키 FAQ]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce 미디어위키 릴리스 메일링 리스트]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources 내 언어로 미디어위키 지역화]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam 당신의 위키에서 스팸에 대처하는 법을 배우세요]"
+       "mainpagedocfooter": "[https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents 이곳]에서 위키 소프트웨어에 대한 정보를 얻을 수 있습니다.\n\n== 시작하기 ==\n\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings 설정하기 목록]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ 미디어위키 FAQ]\n* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce 미디어위키 릴리스 메일링 리스트]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources 내 언어로 미디어위키 지역화]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam 당신의 위키에서 스팸에 대처하는 법을 배우세요]"
 }
index f09ba57..2d816f9 100644 (file)
@@ -22,6 +22,8 @@
  * @ingroup Cache
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Job to purge the cache for all pages that link to or use another page or file
  *
@@ -113,7 +115,7 @@ class HTMLCacheUpdateJob extends Job {
                $touchTimestamp = wfTimestampNow();
 
                $dbw = wfGetDB( DB_MASTER );
-               $factory = wfGetLBFactory();
+               $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
                $ticket = $factory->getEmptyTransactionTicket( __METHOD__ );
                // Update page_touched (skipping pages already touched since the root job).
                // Check $wgUpdateRowsPerQuery for sanity; batch jobs are sized by that already.
index 0daa4ed..99e509c 100644 (file)
@@ -28,7 +28,6 @@ use Psr\Log\LoggerInterface;
 use Psr\Log\NullLogger;
 use Wikimedia\WaitConditionLoop;
 use BagOStuff;
-use DBMasterPos;
 
 /**
  * Class for ensuring a consistent ordering of events as seen by the user, despite replication.
index a8f664d..fc3ebe0 100644 (file)
@@ -2,6 +2,7 @@
 
 use Wikimedia\Rdbms\DatabaseDomain;
 use Wikimedia\Rdbms\ILoadBalancer;
+use Wikimedia\Rdbms\DBMasterPos;
 
 /**
  * Helper class to handle automatically marking connections as reusable (via RAII pattern)
index 72e39b7..0afce49 100644 (file)
@@ -29,6 +29,7 @@ use Wikimedia\ScopedCallback;
 use Wikimedia\Rdbms\TransactionProfiler;
 use Wikimedia\Rdbms\LikeMatch;
 use Wikimedia\Rdbms\DatabaseDomain;
+use Wikimedia\Rdbms\DBMasterPos;
 
 /**
  * Relational database abstraction object
diff --git a/includes/libs/rdbms/database/DatabaseMssql.php b/includes/libs/rdbms/database/DatabaseMssql.php
new file mode 100644 (file)
index 0000000..b91c7b7
--- /dev/null
@@ -0,0 +1,1357 @@
+<?php
+/**
+ * This is the MS SQL Server Native database abstraction layer.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Database
+ * @author Joel Penner <a-joelpe at microsoft dot com>
+ * @author Chris Pucci <a-cpucci at microsoft dot com>
+ * @author Ryan Biesemeyer <v-ryanbi at microsoft dot com>
+ * @author Ryan Schmidt <skizzerz at gmail dot com>
+ */
+
+/**
+ * @ingroup Database
+ */
+class DatabaseMssql extends Database {
+       protected $mPort;
+       protected $mUseWindowsAuth = false;
+
+       protected $mInsertId = null;
+       protected $mLastResult = null;
+       protected $mAffectedRows = null;
+       protected $mSubqueryId = 0;
+       protected $mScrollableCursor = true;
+       protected $mPrepareStatements = true;
+       protected $mBinaryColumnCache = null;
+       protected $mBitColumnCache = null;
+       protected $mIgnoreDupKeyErrors = false;
+       protected $mIgnoreErrors = [];
+
+       public function implicitGroupby() {
+               return false;
+       }
+
+       public function implicitOrderby() {
+               return false;
+       }
+
+       public function unionSupportsOrderAndLimit() {
+               return false;
+       }
+
+       public function __construct( array $params ) {
+               $this->mPort = $params['port'];
+               $this->mUseWindowsAuth = $params['UseWindowsAuth'];
+
+               parent::__construct( $params );
+       }
+
+       /**
+        * Usually aborts on failure
+        * @param string $server
+        * @param string $user
+        * @param string $password
+        * @param string $dbName
+        * @throws DBConnectionError
+        * @return bool|resource|null
+        */
+       public function open( $server, $user, $password, $dbName ) {
+               # Test for driver support, to avoid suppressed fatal error
+               if ( !function_exists( 'sqlsrv_connect' ) ) {
+                       throw new DBConnectionError(
+                               $this,
+                               "Microsoft SQL Server Native (sqlsrv) functions missing.
+                               You can download the driver from: http://go.microsoft.com/fwlink/?LinkId=123470\n"
+                       );
+               }
+
+               # e.g. the class is being loaded
+               if ( !strlen( $user ) ) {
+                       return null;
+               }
+
+               $this->close();
+               $this->mServer = $server;
+               $this->mUser = $user;
+               $this->mPassword = $password;
+               $this->mDBname = $dbName;
+
+               $connectionInfo = [];
+
+               if ( $dbName ) {
+                       $connectionInfo['Database'] = $dbName;
+               }
+
+               // Decide which auth scenerio to use
+               // if we are using Windows auth, then don't add credentials to $connectionInfo
+               if ( !$this->mUseWindowsAuth ) {
+                       $connectionInfo['UID'] = $user;
+                       $connectionInfo['PWD'] = $password;
+               }
+
+               MediaWiki\suppressWarnings();
+               $this->mConn = sqlsrv_connect( $server, $connectionInfo );
+               MediaWiki\restoreWarnings();
+
+               if ( $this->mConn === false ) {
+                       throw new DBConnectionError( $this, $this->lastError() );
+               }
+
+               $this->mOpened = true;
+
+               return $this->mConn;
+       }
+
+       /**
+        * Closes a database connection, if it is open
+        * Returns success, true if already closed
+        * @return bool
+        */
+       protected function closeConnection() {
+               return sqlsrv_close( $this->mConn );
+       }
+
+       /**
+        * @param bool|MssqlResultWrapper|resource $result
+        * @return bool|MssqlResultWrapper
+        */
+       protected function resultObject( $result ) {
+               if ( !$result ) {
+                       return false;
+               } elseif ( $result instanceof MssqlResultWrapper ) {
+                       return $result;
+               } elseif ( $result === true ) {
+                       // Successful write query
+                       return $result;
+               } else {
+                       return new MssqlResultWrapper( $this, $result );
+               }
+       }
+
+       /**
+        * @param string $sql
+        * @return bool|MssqlResultWrapper|resource
+        * @throws DBUnexpectedError
+        */
+       protected function doQuery( $sql ) {
+               // several extensions seem to think that all databases support limits
+               // via LIMIT N after the WHERE clause, but  MSSQL uses SELECT TOP N,
+               // so to catch any of those extensions we'll do a quick check for a
+               // LIMIT clause and pass $sql through $this->LimitToTopN() which parses
+               // the LIMIT clause and passes the result to $this->limitResult();
+               if ( preg_match( '/\bLIMIT\s*/i', $sql ) ) {
+                       // massage LIMIT -> TopN
+                       $sql = $this->LimitToTopN( $sql );
+               }
+
+               // MSSQL doesn't have EXTRACT(epoch FROM XXX)
+               if ( preg_match( '#\bEXTRACT\s*?\(\s*?EPOCH\s+FROM\b#i', $sql, $matches ) ) {
+                       // This is same as UNIX_TIMESTAMP, we need to calc # of seconds from 1970
+                       $sql = str_replace( $matches[0], "DATEDIFF(s,CONVERT(datetime,'1/1/1970'),", $sql );
+               }
+
+               // perform query
+
+               // SQLSRV_CURSOR_STATIC is slower than SQLSRV_CURSOR_CLIENT_BUFFERED (one of the two is
+               // needed if we want to be able to seek around the result set), however CLIENT_BUFFERED
+               // has a bug in the sqlsrv driver where wchar_t types (such as nvarchar) that are empty
+               // strings make php throw a fatal error "Severe error translating Unicode"
+               if ( $this->mScrollableCursor ) {
+                       $scrollArr = [ 'Scrollable' => SQLSRV_CURSOR_STATIC ];
+               } else {
+                       $scrollArr = [];
+               }
+
+               if ( $this->mPrepareStatements ) {
+                       // we do prepare + execute so we can get its field metadata for later usage if desired
+                       $stmt = sqlsrv_prepare( $this->mConn, $sql, [], $scrollArr );
+                       $success = sqlsrv_execute( $stmt );
+               } else {
+                       $stmt = sqlsrv_query( $this->mConn, $sql, [], $scrollArr );
+                       $success = (bool)$stmt;
+               }
+
+               // Make a copy to ensure what we add below does not get reflected in future queries
+               $ignoreErrors = $this->mIgnoreErrors;
+
+               if ( $this->mIgnoreDupKeyErrors ) {
+                       // ignore duplicate key errors
+                       // this emulates INSERT IGNORE in MySQL
+                       $ignoreErrors[] = '2601'; // duplicate key error caused by unique index
+                       $ignoreErrors[] = '2627'; // duplicate key error caused by primary key
+                       $ignoreErrors[] = '3621'; // generic "the statement has been terminated" error
+               }
+
+               if ( $success === false ) {
+                       $errors = sqlsrv_errors();
+                       $success = true;
+
+                       foreach ( $errors as $err ) {
+                               if ( !in_array( $err['code'], $ignoreErrors ) ) {
+                                       $success = false;
+                                       break;
+                               }
+                       }
+
+                       if ( $success === false ) {
+                               return false;
+                       }
+               }
+               // remember number of rows affected
+               $this->mAffectedRows = sqlsrv_rows_affected( $stmt );
+
+               return $stmt;
+       }
+
+       public function freeResult( $res ) {
+               if ( $res instanceof ResultWrapper ) {
+                       $res = $res->result;
+               }
+
+               sqlsrv_free_stmt( $res );
+       }
+
+       /**
+        * @param MssqlResultWrapper $res
+        * @return stdClass
+        */
+       public function fetchObject( $res ) {
+               // $res is expected to be an instance of MssqlResultWrapper here
+               return $res->fetchObject();
+       }
+
+       /**
+        * @param MssqlResultWrapper $res
+        * @return array
+        */
+       public function fetchRow( $res ) {
+               return $res->fetchRow();
+       }
+
+       /**
+        * @param mixed $res
+        * @return int
+        */
+       public function numRows( $res ) {
+               if ( $res instanceof ResultWrapper ) {
+                       $res = $res->result;
+               }
+
+               $ret = sqlsrv_num_rows( $res );
+
+               if ( $ret === false ) {
+                       // we cannot get an amount of rows from this cursor type
+                       // has_rows returns bool true/false if the result has rows
+                       $ret = (int)sqlsrv_has_rows( $res );
+               }
+
+               return $ret;
+       }
+
+       /**
+        * @param mixed $res
+        * @return int
+        */
+       public function numFields( $res ) {
+               if ( $res instanceof ResultWrapper ) {
+                       $res = $res->result;
+               }
+
+               return sqlsrv_num_fields( $res );
+       }
+
+       /**
+        * @param mixed $res
+        * @param int $n
+        * @return int
+        */
+       public function fieldName( $res, $n ) {
+               if ( $res instanceof ResultWrapper ) {
+                       $res = $res->result;
+               }
+
+               return sqlsrv_field_metadata( $res )[$n]['Name'];
+       }
+
+       /**
+        * This must be called after nextSequenceVal
+        * @return int|null
+        */
+       public function insertId() {
+               return $this->mInsertId;
+       }
+
+       /**
+        * @param MssqlResultWrapper $res
+        * @param int $row
+        * @return bool
+        */
+       public function dataSeek( $res, $row ) {
+               return $res->seek( $row );
+       }
+
+       /**
+        * @return string
+        */
+       public function lastError() {
+               $strRet = '';
+               $retErrors = sqlsrv_errors( SQLSRV_ERR_ALL );
+               if ( $retErrors != null ) {
+                       foreach ( $retErrors as $arrError ) {
+                               $strRet .= $this->formatError( $arrError ) . "\n";
+                       }
+               } else {
+                       $strRet = "No errors found";
+               }
+
+               return $strRet;
+       }
+
+       /**
+        * @param array $err
+        * @return string
+        */
+       private function formatError( $err ) {
+               return '[SQLSTATE ' .
+                       $err['SQLSTATE'] . '][Error Code ' . $err['code'] . ']' . $err['message'];
+       }
+
+       /**
+        * @return string|int
+        */
+       public function lastErrno() {
+               $err = sqlsrv_errors( SQLSRV_ERR_ALL );
+               if ( $err !== null && isset( $err[0] ) ) {
+                       return $err[0]['code'];
+               } else {
+                       return 0;
+               }
+       }
+
+       /**
+        * @return int
+        */
+       public function affectedRows() {
+               return $this->mAffectedRows;
+       }
+
+       /**
+        * SELECT wrapper
+        *
+        * @param mixed $table Array or string, table name(s) (prefix auto-added)
+        * @param mixed $vars Array or string, field name(s) to be retrieved
+        * @param mixed $conds Array or string, condition(s) for WHERE
+        * @param string $fname Calling function name (use __METHOD__) for logs/profiling
+        * @param array $options Associative array of options (e.g.
+        *   [ 'GROUP BY' => 'page_title' ]), see Database::makeSelectOptions
+        *   code for list of supported stuff
+        * @param array $join_conds Associative array of table join conditions
+        *   (optional) (e.g. [ 'page' => [ 'LEFT JOIN','page_latest=rev_id' ] ]
+        * @return mixed Database result resource (feed to Database::fetchObject
+        *   or whatever), or false on failure
+        * @throws DBQueryError
+        * @throws DBUnexpectedError
+        * @throws Exception
+        */
+       public function select( $table, $vars, $conds = '', $fname = __METHOD__,
+               $options = [], $join_conds = []
+       ) {
+               $sql = $this->selectSQLText( $table, $vars, $conds, $fname, $options, $join_conds );
+               if ( isset( $options['EXPLAIN'] ) ) {
+                       try {
+                               $this->mScrollableCursor = false;
+                               $this->mPrepareStatements = false;
+                               $this->query( "SET SHOWPLAN_ALL ON" );
+                               $ret = $this->query( $sql, $fname );
+                               $this->query( "SET SHOWPLAN_ALL OFF" );
+                       } catch ( DBQueryError $dqe ) {
+                               if ( isset( $options['FOR COUNT'] ) ) {
+                                       // likely don't have privs for SHOWPLAN, so run a select count instead
+                                       $this->query( "SET SHOWPLAN_ALL OFF" );
+                                       unset( $options['EXPLAIN'] );
+                                       $ret = $this->select(
+                                               $table,
+                                               'COUNT(*) AS EstimateRows',
+                                               $conds,
+                                               $fname,
+                                               $options,
+                                               $join_conds
+                                       );
+                               } else {
+                                       // someone actually wanted the query plan instead of an est row count
+                                       // let them know of the error
+                                       $this->mScrollableCursor = true;
+                                       $this->mPrepareStatements = true;
+                                       throw $dqe;
+                               }
+                       }
+                       $this->mScrollableCursor = true;
+                       $this->mPrepareStatements = true;
+                       return $ret;
+               }
+               return $this->query( $sql, $fname );
+       }
+
+       /**
+        * SELECT wrapper
+        *
+        * @param mixed $table Array or string, table name(s) (prefix auto-added)
+        * @param mixed $vars Array or string, field name(s) to be retrieved
+        * @param mixed $conds Array or string, condition(s) for WHERE
+        * @param string $fname Calling function name (use __METHOD__) for logs/profiling
+        * @param array $options Associative array of options (e.g. [ 'GROUP BY' => 'page_title' ]),
+        *   see Database::makeSelectOptions code for list of supported stuff
+        * @param array $join_conds Associative array of table join conditions (optional)
+        *    (e.g. [ 'page' => [ 'LEFT JOIN','page_latest=rev_id' ] ]
+        * @return string The SQL text
+        */
+       public function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__,
+               $options = [], $join_conds = []
+       ) {
+               if ( isset( $options['EXPLAIN'] ) ) {
+                       unset( $options['EXPLAIN'] );
+               }
+
+               $sql = parent::selectSQLText( $table, $vars, $conds, $fname, $options, $join_conds );
+
+               // try to rewrite aggregations of bit columns (currently MAX and MIN)
+               if ( strpos( $sql, 'MAX(' ) !== false || strpos( $sql, 'MIN(' ) !== false ) {
+                       $bitColumns = [];
+                       if ( is_array( $table ) ) {
+                               foreach ( $table as $t ) {
+                                       $bitColumns += $this->getBitColumns( $this->tableName( $t ) );
+                               }
+                       } else {
+                               $bitColumns = $this->getBitColumns( $this->tableName( $table ) );
+                       }
+
+                       foreach ( $bitColumns as $col => $info ) {
+                               $replace = [
+                                       "MAX({$col})" => "MAX(CAST({$col} AS tinyint))",
+                                       "MIN({$col})" => "MIN(CAST({$col} AS tinyint))",
+                               ];
+                               $sql = str_replace( array_keys( $replace ), array_values( $replace ), $sql );
+                       }
+               }
+
+               return $sql;
+       }
+
+       public function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds,
+               $fname = __METHOD__
+       ) {
+               $this->mScrollableCursor = false;
+               try {
+                       parent::deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname );
+               } catch ( Exception $e ) {
+                       $this->mScrollableCursor = true;
+                       throw $e;
+               }
+               $this->mScrollableCursor = true;
+       }
+
+       public function delete( $table, $conds, $fname = __METHOD__ ) {
+               $this->mScrollableCursor = false;
+               try {
+                       parent::delete( $table, $conds, $fname );
+               } catch ( Exception $e ) {
+                       $this->mScrollableCursor = true;
+                       throw $e;
+               }
+               $this->mScrollableCursor = true;
+       }
+
+       /**
+        * Estimate rows in dataset
+        * Returns estimated count, based on SHOWPLAN_ALL output
+        * This is not necessarily an accurate estimate, so use sparingly
+        * Returns -1 if count cannot be found
+        * Takes same arguments as Database::select()
+        * @param string $table
+        * @param string $vars
+        * @param string $conds
+        * @param string $fname
+        * @param array $options
+        * @return int
+        */
+       public function estimateRowCount( $table, $vars = '*', $conds = '',
+               $fname = __METHOD__, $options = []
+       ) {
+               // http://msdn2.microsoft.com/en-us/library/aa259203.aspx
+               $options['EXPLAIN'] = true;
+               $options['FOR COUNT'] = true;
+               $res = $this->select( $table, $vars, $conds, $fname, $options );
+
+               $rows = -1;
+               if ( $res ) {
+                       $row = $this->fetchRow( $res );
+
+                       if ( isset( $row['EstimateRows'] ) ) {
+                               $rows = (int)$row['EstimateRows'];
+                       }
+               }
+
+               return $rows;
+       }
+
+       /**
+        * Returns information about an index
+        * If errors are explicitly ignored, returns NULL on failure
+        * @param string $table
+        * @param string $index
+        * @param string $fname
+        * @return array|bool|null
+        */
+       public function indexInfo( $table, $index, $fname = __METHOD__ ) {
+               # This does not return the same info as MYSQL would, but that's OK
+               # because MediaWiki never uses the returned value except to check for
+               # the existence of indexes.
+               $sql = "sp_helpindex '" . $this->tableName( $table ) . "'";
+               $res = $this->query( $sql, $fname );
+
+               if ( !$res ) {
+                       return null;
+               }
+
+               $result = [];
+               foreach ( $res as $row ) {
+                       if ( $row->index_name == $index ) {
+                               $row->Non_unique = !stristr( $row->index_description, "unique" );
+                               $cols = explode( ", ", $row->index_keys );
+                               foreach ( $cols as $col ) {
+                                       $row->Column_name = trim( $col );
+                                       $result[] = clone $row;
+                               }
+                       } elseif ( $index == 'PRIMARY' && stristr( $row->index_description, 'PRIMARY' ) ) {
+                               $row->Non_unique = 0;
+                               $cols = explode( ", ", $row->index_keys );
+                               foreach ( $cols as $col ) {
+                                       $row->Column_name = trim( $col );
+                                       $result[] = clone $row;
+                               }
+                       }
+               }
+
+               return empty( $result ) ? false : $result;
+       }
+
+       /**
+        * INSERT wrapper, inserts an array into a table
+        *
+        * $arrToInsert may be a single associative array, or an array of these with numeric keys, for
+        * multi-row insert.
+        *
+        * Usually aborts on failure
+        * If errors are explicitly ignored, returns success
+        * @param string $table
+        * @param array $arrToInsert
+        * @param string $fname
+        * @param array $options
+        * @return bool
+        * @throws Exception
+        */
+       public function insert( $table, $arrToInsert, $fname = __METHOD__, $options = [] ) {
+               # No rows to insert, easy just return now
+               if ( !count( $arrToInsert ) ) {
+                       return true;
+               }
+
+               if ( !is_array( $options ) ) {
+                       $options = [ $options ];
+               }
+
+               $table = $this->tableName( $table );
+
+               if ( !( isset( $arrToInsert[0] ) && is_array( $arrToInsert[0] ) ) ) { // Not multi row
+                       $arrToInsert = [ 0 => $arrToInsert ]; // make everything multi row compatible
+               }
+
+               // We know the table we're inserting into, get its identity column
+               $identity = null;
+               // strip matching square brackets and the db/schema from table name
+               $tableRawArr = explode( '.', preg_replace( '#\[([^\]]*)\]#', '$1', $table ) );
+               $tableRaw = array_pop( $tableRawArr );
+               $res = $this->doQuery(
+                       "SELECT NAME AS idColumn FROM SYS.IDENTITY_COLUMNS " .
+                               "WHERE OBJECT_NAME(OBJECT_ID)='{$tableRaw}'"
+               );
+               if ( $res && sqlsrv_has_rows( $res ) ) {
+                       // There is an identity for this table.
+                       $identityArr = sqlsrv_fetch_array( $res, SQLSRV_FETCH_ASSOC );
+                       $identity = array_pop( $identityArr );
+               }
+               sqlsrv_free_stmt( $res );
+
+               // Determine binary/varbinary fields so we can encode data as a hex string like 0xABCDEF
+               $binaryColumns = $this->getBinaryColumns( $table );
+
+               // INSERT IGNORE is not supported by SQL Server
+               // remove IGNORE from options list and set ignore flag to true
+               if ( in_array( 'IGNORE', $options ) ) {
+                       $options = array_diff( $options, [ 'IGNORE' ] );
+                       $this->mIgnoreDupKeyErrors = true;
+               }
+
+               $ret = null;
+               foreach ( $arrToInsert as $a ) {
+                       // start out with empty identity column, this is so we can return
+                       // it as a result of the INSERT logic
+                       $sqlPre = '';
+                       $sqlPost = '';
+                       $identityClause = '';
+
+                       // if we have an identity column
+                       if ( $identity ) {
+                               // iterate through
+                               foreach ( $a as $k => $v ) {
+                                       if ( $k == $identity ) {
+                                               if ( !is_null( $v ) ) {
+                                                       // there is a value being passed to us,
+                                                       // we need to turn on and off inserted identity
+                                                       $sqlPre = "SET IDENTITY_INSERT $table ON;";
+                                                       $sqlPost = ";SET IDENTITY_INSERT $table OFF;";
+                                               } else {
+                                                       // we can't insert NULL into an identity column,
+                                                       // so remove the column from the insert.
+                                                       unset( $a[$k] );
+                                               }
+                                       }
+                               }
+
+                               // we want to output an identity column as result
+                               $identityClause = "OUTPUT INSERTED.$identity ";
+                       }
+
+                       $keys = array_keys( $a );
+
+                       // Build the actual query
+                       $sql = $sqlPre . 'INSERT ' . implode( ' ', $options ) .
+                               " INTO $table (" . implode( ',', $keys ) . ") $identityClause VALUES (";
+
+                       $first = true;
+                       foreach ( $a as $key => $value ) {
+                               if ( isset( $binaryColumns[$key] ) ) {
+                                       $value = new MssqlBlob( $value );
+                               }
+                               if ( $first ) {
+                                       $first = false;
+                               } else {
+                                       $sql .= ',';
+                               }
+                               if ( is_null( $value ) ) {
+                                       $sql .= 'null';
+                               } elseif ( is_array( $value ) || is_object( $value ) ) {
+                                       if ( is_object( $value ) && $value instanceof Blob ) {
+                                               $sql .= $this->addQuotes( $value );
+                                       } else {
+                                               $sql .= $this->addQuotes( serialize( $value ) );
+                                       }
+                               } else {
+                                       $sql .= $this->addQuotes( $value );
+                               }
+                       }
+                       $sql .= ')' . $sqlPost;
+
+                       // Run the query
+                       $this->mScrollableCursor = false;
+                       try {
+                               $ret = $this->query( $sql );
+                       } catch ( Exception $e ) {
+                               $this->mScrollableCursor = true;
+                               $this->mIgnoreDupKeyErrors = false;
+                               throw $e;
+                       }
+                       $this->mScrollableCursor = true;
+
+                       if ( $ret instanceof ResultWrapper && !is_null( $identity ) ) {
+                               // Then we want to get the identity column value we were assigned and save it off
+                               $row = $ret->fetchObject();
+                               if ( is_object( $row ) ) {
+                                       $this->mInsertId = $row->$identity;
+                                       // It seems that mAffectedRows is -1 sometimes when OUTPUT INSERTED.identity is
+                                       // used if we got an identity back, we know for sure a row was affected, so
+                                       // adjust that here
+                                       if ( $this->mAffectedRows == -1 ) {
+                                               $this->mAffectedRows = 1;
+                                       }
+                               }
+                       }
+               }
+
+               $this->mIgnoreDupKeyErrors = false;
+
+               return $ret;
+       }
+
+       /**
+        * INSERT SELECT wrapper
+        * $varMap must be an associative array of the form [ 'dest1' => 'source1', ... ]
+        * Source items may be literals rather than field names, but strings should
+        * be quoted with Database::addQuotes().
+        * @param string $destTable
+        * @param array|string $srcTable May be an array of tables.
+        * @param array $varMap
+        * @param array $conds May be "*" to copy the whole table.
+        * @param string $fname
+        * @param array $insertOptions
+        * @param array $selectOptions
+        * @return null|ResultWrapper
+        * @throws Exception
+        */
+       public function nativeInsertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__,
+               $insertOptions = [], $selectOptions = []
+       ) {
+               $this->mScrollableCursor = false;
+               try {
+                       $ret = parent::nativeInsertSelect(
+                               $destTable,
+                               $srcTable,
+                               $varMap,
+                               $conds,
+                               $fname,
+                               $insertOptions,
+                               $selectOptions
+                       );
+               } catch ( Exception $e ) {
+                       $this->mScrollableCursor = true;
+                       throw $e;
+               }
+               $this->mScrollableCursor = true;
+
+               return $ret;
+       }
+
+       /**
+        * UPDATE wrapper. Takes a condition array and a SET array.
+        *
+        * @param string $table Name of the table to UPDATE. This will be passed through
+        *                Database::tableName().
+        *
+        * @param array $values An array of values to SET. For each array element,
+        *                the key gives the field name, and the value gives the data
+        *                to set that field to. The data will be quoted by
+        *                Database::addQuotes().
+        *
+        * @param array $conds An array of conditions (WHERE). See
+        *                Database::select() for the details of the format of
+        *                condition arrays. Use '*' to update all rows.
+        *
+        * @param string $fname The function name of the caller (from __METHOD__),
+        *                for logging and profiling.
+        *
+        * @param array $options An array of UPDATE options, can be:
+        *                   - IGNORE: Ignore unique key conflicts
+        *                   - LOW_PRIORITY: MySQL-specific, see MySQL manual.
+        * @return bool
+        * @throws DBUnexpectedError
+        * @throws Exception
+        */
+       function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) {
+               $table = $this->tableName( $table );
+               $binaryColumns = $this->getBinaryColumns( $table );
+
+               $opts = $this->makeUpdateOptions( $options );
+               $sql = "UPDATE $opts $table SET " . $this->makeList( $values, LIST_SET, $binaryColumns );
+
+               if ( $conds !== [] && $conds !== '*' ) {
+                       $sql .= " WHERE " . $this->makeList( $conds, LIST_AND, $binaryColumns );
+               }
+
+               $this->mScrollableCursor = false;
+               try {
+                       $this->query( $sql );
+               } catch ( Exception $e ) {
+                       $this->mScrollableCursor = true;
+                       throw $e;
+               }
+               $this->mScrollableCursor = true;
+               return true;
+       }
+
+       /**
+        * Makes an encoded list of strings from an array
+        * @param array $a Containing the data
+        * @param int $mode Constant
+        *      - LIST_COMMA:          comma separated, no field names
+        *      - LIST_AND:            ANDed WHERE clause (without the WHERE). See
+        *        the documentation for $conds in Database::select().
+        *      - LIST_OR:             ORed WHERE clause (without the WHERE)
+        *      - LIST_SET:            comma separated with field names, like a SET clause
+        *      - LIST_NAMES:          comma separated field names
+        * @param array $binaryColumns Contains a list of column names that are binary types
+        *      This is a custom parameter only present for MS SQL.
+        *
+        * @throws DBUnexpectedError
+        * @return string
+        */
+       public function makeList( $a, $mode = LIST_COMMA, $binaryColumns = [] ) {
+               if ( !is_array( $a ) ) {
+                       throw new DBUnexpectedError( $this, __METHOD__ . ' called with incorrect parameters' );
+               }
+
+               if ( $mode != LIST_NAMES ) {
+                       // In MS SQL, values need to be specially encoded when they are
+                       // inserted into binary fields. Perform this necessary encoding
+                       // for the specified set of columns.
+                       foreach ( array_keys( $a ) as $field ) {
+                               if ( !isset( $binaryColumns[$field] ) ) {
+                                       continue;
+                               }
+
+                               if ( is_array( $a[$field] ) ) {
+                                       foreach ( $a[$field] as &$v ) {
+                                               $v = new MssqlBlob( $v );
+                                       }
+                                       unset( $v );
+                               } else {
+                                       $a[$field] = new MssqlBlob( $a[$field] );
+                               }
+                       }
+               }
+
+               return parent::makeList( $a, $mode );
+       }
+
+       /**
+        * @param string $table
+        * @param string $field
+        * @return int Returns the size of a text field, or -1 for "unlimited"
+        */
+       public function textFieldSize( $table, $field ) {
+               $table = $this->tableName( $table );
+               $sql = "SELECT CHARACTER_MAXIMUM_LENGTH,DATA_TYPE FROM INFORMATION_SCHEMA.Columns
+                       WHERE TABLE_NAME = '$table' AND COLUMN_NAME = '$field'";
+               $res = $this->query( $sql );
+               $row = $this->fetchRow( $res );
+               $size = -1;
+               if ( strtolower( $row['DATA_TYPE'] ) != 'text' ) {
+                       $size = $row['CHARACTER_MAXIMUM_LENGTH'];
+               }
+
+               return $size;
+       }
+
+       /**
+        * Construct a LIMIT query with optional offset
+        * This is used for query pages
+        *
+        * @param string $sql SQL query we will append the limit too
+        * @param int $limit The SQL limit
+        * @param bool|int $offset The SQL offset (default false)
+        * @return array|string
+        * @throws DBUnexpectedError
+        */
+       public function limitResult( $sql, $limit, $offset = false ) {
+               if ( $offset === false || $offset == 0 ) {
+                       if ( strpos( $sql, "SELECT" ) === false ) {
+                               return "TOP {$limit} " . $sql;
+                       } else {
+                               return preg_replace( '/\bSELECT(\s+DISTINCT)?\b/Dsi',
+                                       'SELECT$1 TOP ' . $limit, $sql, 1 );
+                       }
+               } else {
+                       // This one is fun, we need to pull out the select list as well as any ORDER BY clause
+                       $select = $orderby = [];
+                       $s1 = preg_match( '#SELECT\s+(.+?)\s+FROM#Dis', $sql, $select );
+                       $s2 = preg_match( '#(ORDER BY\s+.+?)(\s*FOR XML .*)?$#Dis', $sql, $orderby );
+                       $postOrder = '';
+                       $first = $offset + 1;
+                       $last = $offset + $limit;
+                       $sub1 = 'sub_' . $this->mSubqueryId;
+                       $sub2 = 'sub_' . ( $this->mSubqueryId + 1 );
+                       $this->mSubqueryId += 2;
+                       if ( !$s1 ) {
+                               // wat
+                               throw new DBUnexpectedError( $this, "Attempting to LIMIT a non-SELECT query\n" );
+                       }
+                       if ( !$s2 ) {
+                               // no ORDER BY
+                               $overOrder = 'ORDER BY (SELECT 1)';
+                       } else {
+                               if ( !isset( $orderby[2] ) || !$orderby[2] ) {
+                                       // don't need to strip it out if we're using a FOR XML clause
+                                       $sql = str_replace( $orderby[1], '', $sql );
+                               }
+                               $overOrder = $orderby[1];
+                               $postOrder = ' ' . $overOrder;
+                       }
+                       $sql = "SELECT {$select[1]}
+                                       FROM (
+                                               SELECT ROW_NUMBER() OVER({$overOrder}) AS rowNumber, *
+                                               FROM ({$sql}) {$sub1}
+                                       ) {$sub2}
+                                       WHERE rowNumber BETWEEN {$first} AND {$last}{$postOrder}";
+
+                       return $sql;
+               }
+       }
+
+       /**
+        * If there is a limit clause, parse it, strip it, and pass the remaining
+        * SQL through limitResult() with the appropriate parameters. Not the
+        * prettiest solution, but better than building a whole new parser. This
+        * exists becase there are still too many extensions that don't use dynamic
+        * sql generation.
+        *
+        * @param string $sql
+        * @return array|mixed|string
+        */
+       public function LimitToTopN( $sql ) {
+               // Matches: LIMIT {[offset,] row_count | row_count OFFSET offset}
+               $pattern = '/\bLIMIT\s+((([0-9]+)\s*,\s*)?([0-9]+)(\s+OFFSET\s+([0-9]+))?)/i';
+               if ( preg_match( $pattern, $sql, $matches ) ) {
+                       $row_count = $matches[4];
+                       $offset = $matches[3] ?: $matches[6] ?: false;
+
+                       // strip the matching LIMIT clause out
+                       $sql = str_replace( $matches[0], '', $sql );
+
+                       return $this->limitResult( $sql, $row_count, $offset );
+               }
+
+               return $sql;
+       }
+
+       /**
+        * @return string Wikitext of a link to the server software's web site
+        */
+       public function getSoftwareLink() {
+               return "[{{int:version-db-mssql-url}} MS SQL Server]";
+       }
+
+       /**
+        * @return string Version information from the database
+        */
+       public function getServerVersion() {
+               $server_info = sqlsrv_server_info( $this->mConn );
+               $version = 'Error';
+               if ( isset( $server_info['SQLServerVersion'] ) ) {
+                       $version = $server_info['SQLServerVersion'];
+               }
+
+               return $version;
+       }
+
+       /**
+        * @param string $table
+        * @param string $fname
+        * @return bool
+        */
+       public function tableExists( $table, $fname = __METHOD__ ) {
+               list( $db, $schema, $table ) = $this->tableName( $table, 'split' );
+
+               if ( $db !== false ) {
+                       // remote database
+                       $this->queryLogger->error( "Attempting to call tableExists on a remote table" );
+                       return false;
+               }
+
+               if ( $schema === false ) {
+                       $schema = $this->mSchema;
+               }
+
+               $res = $this->query( "SELECT 1 FROM INFORMATION_SCHEMA.TABLES
+                       WHERE TABLE_TYPE = 'BASE TABLE'
+                       AND TABLE_SCHEMA = '$schema' AND TABLE_NAME = '$table'" );
+
+               if ( $res->numRows() ) {
+                       return true;
+               } else {
+                       return false;
+               }
+       }
+
+       /**
+        * Query whether a given column exists in the mediawiki schema
+        * @param string $table
+        * @param string $field
+        * @param string $fname
+        * @return bool
+        */
+       public function fieldExists( $table, $field, $fname = __METHOD__ ) {
+               list( $db, $schema, $table ) = $this->tableName( $table, 'split' );
+
+               if ( $db !== false ) {
+                       // remote database
+                       $this->queryLogger->error( "Attempting to call fieldExists on a remote table" );
+                       return false;
+               }
+
+               $res = $this->query( "SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS
+                       WHERE TABLE_SCHEMA = '$schema' AND TABLE_NAME = '$table' AND COLUMN_NAME = '$field'" );
+
+               if ( $res->numRows() ) {
+                       return true;
+               } else {
+                       return false;
+               }
+       }
+
+       public function fieldInfo( $table, $field ) {
+               list( $db, $schema, $table ) = $this->tableName( $table, 'split' );
+
+               if ( $db !== false ) {
+                       // remote database
+                       $this->queryLogger->error( "Attempting to call fieldInfo on a remote table" );
+                       return false;
+               }
+
+               $res = $this->query( "SELECT * FROM INFORMATION_SCHEMA.COLUMNS
+                       WHERE TABLE_SCHEMA = '$schema' AND TABLE_NAME = '$table' AND COLUMN_NAME = '$field'" );
+
+               $meta = $res->fetchRow();
+               if ( $meta ) {
+                       return new MssqlField( $meta );
+               }
+
+               return false;
+       }
+
+       /**
+        * Begin a transaction, committing any previously open transaction
+        * @param string $fname
+        */
+       protected function doBegin( $fname = __METHOD__ ) {
+               sqlsrv_begin_transaction( $this->mConn );
+               $this->mTrxLevel = 1;
+       }
+
+       /**
+        * End a transaction
+        * @param string $fname
+        */
+       protected function doCommit( $fname = __METHOD__ ) {
+               sqlsrv_commit( $this->mConn );
+               $this->mTrxLevel = 0;
+       }
+
+       /**
+        * Rollback a transaction.
+        * No-op on non-transactional databases.
+        * @param string $fname
+        */
+       protected function doRollback( $fname = __METHOD__ ) {
+               sqlsrv_rollback( $this->mConn );
+               $this->mTrxLevel = 0;
+       }
+
+       /**
+        * @param string $s
+        * @return string
+        */
+       public function strencode( $s ) {
+               // Should not be called by us
+
+               return str_replace( "'", "''", $s );
+       }
+
+       /**
+        * @param string|int|null|bool|Blob $s
+        * @return string|int
+        */
+       public function addQuotes( $s ) {
+               if ( $s instanceof MssqlBlob ) {
+                       return $s->fetch();
+               } elseif ( $s instanceof Blob ) {
+                       // this shouldn't really ever be called, but it's here if needed
+                       // (and will quite possibly make the SQL error out)
+                       $blob = new MssqlBlob( $s->fetch() );
+                       return $blob->fetch();
+               } else {
+                       if ( is_bool( $s ) ) {
+                               $s = $s ? 1 : 0;
+                       }
+                       return parent::addQuotes( $s );
+               }
+       }
+
+       /**
+        * @param string $s
+        * @return string
+        */
+       public function addIdentifierQuotes( $s ) {
+               // http://msdn.microsoft.com/en-us/library/aa223962.aspx
+               return '[' . $s . ']';
+       }
+
+       /**
+        * @param string $name
+        * @return bool
+        */
+       public function isQuotedIdentifier( $name ) {
+               return strlen( $name ) && $name[0] == '[' && substr( $name, -1, 1 ) == ']';
+       }
+
+       /**
+        * MS SQL supports more pattern operators than other databases (ex: [,],^)
+        *
+        * @param string $s
+        * @return string
+        */
+       protected function escapeLikeInternal( $s ) {
+               return addcslashes( $s, '\%_[]^' );
+       }
+
+       /**
+        * MS SQL requires specifying the escape character used in a LIKE query
+        * or using Square brackets to surround characters that are to be escaped
+        * https://msdn.microsoft.com/en-us/library/ms179859.aspx
+        * Here we take the Specify-Escape-Character approach since it's less
+        * invasive, renders a query that is closer to other DB's and better at
+        * handling square bracket escaping
+        *
+        * @return string Fully built LIKE statement
+        */
+       public function buildLike() {
+               $params = func_get_args();
+               if ( count( $params ) > 0 && is_array( $params[0] ) ) {
+                       $params = $params[0];
+               }
+
+               return parent::buildLike( $params ) . " ESCAPE '\' ";
+       }
+
+       /**
+        * @param string $db
+        * @return bool
+        */
+       public function selectDB( $db ) {
+               try {
+                       $this->mDBname = $db;
+                       $this->query( "USE $db" );
+                       return true;
+               } catch ( Exception $e ) {
+                       return false;
+               }
+       }
+
+       /**
+        * @param array $options An associative array of options to be turned into
+        *   an SQL query, valid keys are listed in the function.
+        * @return array
+        */
+       public function makeSelectOptions( $options ) {
+               $tailOpts = '';
+               $startOpts = '';
+
+               $noKeyOptions = [];
+               foreach ( $options as $key => $option ) {
+                       if ( is_numeric( $key ) ) {
+                               $noKeyOptions[$option] = true;
+                       }
+               }
+
+               $tailOpts .= $this->makeGroupByWithHaving( $options );
+
+               $tailOpts .= $this->makeOrderBy( $options );
+
+               if ( isset( $noKeyOptions['DISTINCT'] ) || isset( $noKeyOptions['DISTINCTROW'] ) ) {
+                       $startOpts .= 'DISTINCT';
+               }
+
+               if ( isset( $noKeyOptions['FOR XML'] ) ) {
+                       // used in group concat field emulation
+                       $tailOpts .= " FOR XML PATH('')";
+               }
+
+               // we want this to be compatible with the output of parent::makeSelectOptions()
+               return [ $startOpts, '', $tailOpts, '', '' ];
+       }
+
+       public function getType() {
+               return 'mssql';
+       }
+
+       /**
+        * @param array $stringList
+        * @return string
+        */
+       public function buildConcat( $stringList ) {
+               return implode( ' + ', $stringList );
+       }
+
+       /**
+        * Build a GROUP_CONCAT or equivalent statement for a query.
+        * MS SQL doesn't have GROUP_CONCAT so we emulate it with other stuff (and boy is it nasty)
+        *
+        * This is useful for combining a field for several rows into a single string.
+        * NULL values will not appear in the output, duplicated values will appear,
+        * and the resulting delimiter-separated values have no defined sort order.
+        * Code using the results may need to use the PHP unique() or sort() methods.
+        *
+        * @param string $delim Glue to bind the results together
+        * @param string|array $table Table name
+        * @param string $field Field name
+        * @param string|array $conds Conditions
+        * @param string|array $join_conds Join conditions
+        * @return string SQL text
+        * @since 1.23
+        */
+       public function buildGroupConcatField( $delim, $table, $field, $conds = '',
+               $join_conds = []
+       ) {
+               $gcsq = 'gcsq_' . $this->mSubqueryId;
+               $this->mSubqueryId++;
+
+               $delimLen = strlen( $delim );
+               $fld = "{$field} + {$this->addQuotes( $delim )}";
+               $sql = "(SELECT LEFT({$field}, LEN({$field}) - {$delimLen}) FROM ("
+                       . $this->selectSQLText( $table, $fld, $conds, null, [ 'FOR XML' ], $join_conds )
+                       . ") {$gcsq} ({$field}))";
+
+               return $sql;
+       }
+
+       /**
+        * Returns an associative array for fields that are of type varbinary, binary, or image
+        * $table can be either a raw table name or passed through tableName() first
+        * @param string $table
+        * @return array
+        */
+       private function getBinaryColumns( $table ) {
+               $tableRawArr = explode( '.', preg_replace( '#\[([^\]]*)\]#', '$1', $table ) );
+               $tableRaw = array_pop( $tableRawArr );
+
+               if ( $this->mBinaryColumnCache === null ) {
+                       $this->populateColumnCaches();
+               }
+
+               return isset( $this->mBinaryColumnCache[$tableRaw] )
+                       ? $this->mBinaryColumnCache[$tableRaw]
+                       : [];
+       }
+
+       /**
+        * @param string $table
+        * @return array
+        */
+       private function getBitColumns( $table ) {
+               $tableRawArr = explode( '.', preg_replace( '#\[([^\]]*)\]#', '$1', $table ) );
+               $tableRaw = array_pop( $tableRawArr );
+
+               if ( $this->mBitColumnCache === null ) {
+                       $this->populateColumnCaches();
+               }
+
+               return isset( $this->mBitColumnCache[$tableRaw] )
+                       ? $this->mBitColumnCache[$tableRaw]
+                       : [];
+       }
+
+       private function populateColumnCaches() {
+               $res = $this->select( 'INFORMATION_SCHEMA.COLUMNS', '*',
+                       [
+                               'TABLE_CATALOG' => $this->mDBname,
+                               'TABLE_SCHEMA' => $this->mSchema,
+                               'DATA_TYPE' => [ 'varbinary', 'binary', 'image', 'bit' ]
+                       ] );
+
+               $this->mBinaryColumnCache = [];
+               $this->mBitColumnCache = [];
+               foreach ( $res as $row ) {
+                       if ( $row->DATA_TYPE == 'bit' ) {
+                               $this->mBitColumnCache[$row->TABLE_NAME][$row->COLUMN_NAME] = $row;
+                       } else {
+                               $this->mBinaryColumnCache[$row->TABLE_NAME][$row->COLUMN_NAME] = $row;
+                       }
+               }
+       }
+
+       /**
+        * @param string $name
+        * @param string $format
+        * @return string
+        */
+       function tableName( $name, $format = 'quoted' ) {
+               # Replace reserved words with better ones
+               switch ( $name ) {
+                       case 'user':
+                               return $this->realTableName( 'mwuser', $format );
+                       default:
+                               return $this->realTableName( $name, $format );
+               }
+       }
+
+       /**
+        * call this instead of tableName() in the updater when renaming tables
+        * @param string $name
+        * @param string $format One of quoted, raw, or split
+        * @return string
+        */
+       function realTableName( $name, $format = 'quoted' ) {
+               $table = parent::tableName( $name, $format );
+               if ( $format == 'split' ) {
+                       // Used internally, we want the schema split off from the table name and returned
+                       // as a list with 3 elements (database, schema, table)
+                       $table = explode( '.', $table );
+                       while ( count( $table ) < 3 ) {
+                               array_unshift( $table, false );
+                       }
+               }
+               return $table;
+       }
+
+       /**
+        * Delete a table
+        * @param string $tableName
+        * @param string $fName
+        * @return bool|ResultWrapper
+        * @since 1.18
+        */
+       public function dropTable( $tableName, $fName = __METHOD__ ) {
+               if ( !$this->tableExists( $tableName, $fName ) ) {
+                       return false;
+               }
+
+               // parent function incorrectly appends CASCADE, which we don't want
+               $sql = "DROP TABLE " . $this->tableName( $tableName );
+
+               return $this->query( $sql, $fName );
+       }
+
+       /**
+        * Called in the installer and updater.
+        * Probably doesn't need to be called anywhere else in the codebase.
+        * @param bool|null $value
+        * @return bool|null
+        */
+       public function prepareStatements( $value = null ) {
+               $old = $this->mPrepareStatements;
+               if ( $value !== null ) {
+                       $this->mPrepareStatements = $value;
+               }
+
+               return $old;
+       }
+
+       /**
+        * Called in the installer and updater.
+        * Probably doesn't need to be called anywhere else in the codebase.
+        * @param bool|null $value
+        * @return bool|null
+        */
+       public function scrollableCursor( $value = null ) {
+               $old = $this->mScrollableCursor;
+               if ( $value !== null ) {
+                       $this->mScrollableCursor = $value;
+               }
+
+               return $old;
+       }
+}
index ceed7da..361fc50 100644 (file)
@@ -20,6 +20,8 @@
  * @file
  * @ingroup Database
  */
+use Wikimedia\Rdbms\DBMasterPos;
+use Wikimedia\Rdbms\MySQLMasterPos;
 
 /**
  * Database abstraction object for MySQL.
index f1613eb..9fbea51 100644 (file)
@@ -25,6 +25,7 @@
  */
 use Wikimedia\ScopedCallback;
 use Wikimedia\Rdbms\LikeMatch;
+use Wikimedia\Rdbms\DBMasterPos;
 
 /**
  * Basic database interface for live and lazy-loaded relation database handles
index eda0ff3..2f79ea9 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+
+namespace Wikimedia\Rdbms;
+
 /**
  * An object representing a master or replica DB position in a replicated setup.
  *
index 7b49ce9..06776fe 100644 (file)
@@ -1,4 +1,9 @@
 <?php
+
+namespace Wikimedia\Rdbms;
+
+use InvalidArgumentException;
+
 /**
  * DBMasterPos class for MySQL/MariaDB
  *
index d6cff78..4e6f6b0 100644 (file)
@@ -29,7 +29,6 @@ use DBConnRef;
 use MaintainableDBConnRef;
 use DBError;
 use DBAccessError;
-use DBMasterPos;
 use DBTransactionError;
 use DBExpectedError;
 use Exception;
index 3442b73..900a79c 100644 (file)
@@ -27,6 +27,7 @@ use Wikimedia\Rdbms\TransactionProfiler;
 use Wikimedia\Rdbms\ILoadMonitor;
 use Wikimedia\Rdbms\DatabaseDomain;
 use Wikimedia\Rdbms\ILoadBalancer;
+use Wikimedia\Rdbms\DBMasterPos;
 
 /**
  * Database connection, tracking, load balancing, and transaction manager for a cluster
@@ -490,7 +491,10 @@ class LoadBalancer implements ILoadBalancer {
                $key = $this->srvCache->makeGlobalKey( __CLASS__, 'last-known-pos', $server );
                /** @var DBMasterPos $knownReachedPos */
                $knownReachedPos = $this->srvCache->get( $key );
-               if ( $knownReachedPos && $knownReachedPos->hasReached( $this->mWaitForPos ) ) {
+               if (
+                       $knownReachedPos instanceof DBMasterPos &&
+                       $knownReachedPos->hasReached( $this->mWaitForPos )
+               ) {
                        $this->replLogger->debug( __METHOD__ .
                                ": replica DB $server known to be caught up (pos >= $knownReachedPos)." );
                        return true;
index 833e38b..64a6aec 100644 (file)
@@ -19,6 +19,8 @@
  * @ingroup RevisionDelete
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Abstract base class for a list of deletable items. The list class
  * needs to be able to make a query from a set of identifiers to pull
@@ -255,7 +257,8 @@ abstract class RevDelList extends RevisionListBase {
                $status->merge( $this->doPreCommitUpdates() );
                if ( !$status->isOK() ) {
                        // Fatal error, such as no configured archive directory or I/O failures
-                       wfGetLBFactory()->rollbackMasterChanges( __METHOD__ );
+                       $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+                       $lbFactory->rollbackMasterChanges( __METHOD__ );
                        return $status;
                }
 
index bf535a6..2d6ba4a 100644 (file)
@@ -23,6 +23,8 @@
  * @ingroup SpecialPage
  */
 
+use Mediawiki\MediaWikiServices;
+
 /**
  * A special page that allows users to export pages in a XML file
  *
@@ -374,7 +376,7 @@ class SpecialExport extends SpecialPage {
                        $buffer = WikiExporter::BUFFER;
                } else {
                        // Use an unbuffered query; histories may be very long!
-                       $lb = wfGetLBFactory()->newMainLB();
+                       $lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->newMainLB();
                        $db = $lb->getConnection( DB_REPLICA );
                        $buffer = WikiExporter::STREAM;
 
index 21dbddf..2ef9e8b 100644 (file)
        "saveusergroups": "احفظ مجموعات {{GENDER:$1|المستخدم|المستخدمة}}",
        "userrights-groupsmember": "عضو في:",
        "userrights-groupsmember-auto": "عضو ضمني في:",
-       "userrights-groups-help": "يمكنك تغيير المجموعات التي ينتمي هذا المستخدم إليها:\n* يعني الصندوق المعلم أن المستخدم في هذه المجموعة.\n* يعني الصندوق غير المعلم أن المستخدم ليس في هذه المجموعة.\n* تعني علامة * عدم إمكانية إزالة المجموعة متى ما أضفتها، أو العكس.",
+       "userrights-groups-help": "يمكنك تغيير المجموعات التي ينتمي هذا المستخدم إليها:\n* يعني الصندوق المعلم أن المستخدم في هذه المجموعة.\n* يعني الصندوق غير المعلم أن المستخدم ليس في هذه المجموعة.\n* تعني علامة * عدم إمكانية إزالة المجموعة متى ما أضفتها، أو العكس.\n* تعن علامة # أنه يمكنك فقط تحديد تاريخ الانتهاء لهذه المجموعة؛ لكن لا يمكنك تقديمه بعد تحديده.",
        "userrights-reason": "السبب:",
        "userrights-no-interwiki": "أنت لا تمتلك الصلاحية لتعديل صلاحيات المستخدمين على الويكيات الأخرى.",
        "userrights-nodatabase": "قاعدة البيانات $1 غير موجودة أو ليست محلية.",
        "userrights-expiry-options": "1 يوم:1 day,1 أسبوع:1 week,1 شهر:1 month,3 شهور:3 months,6 شهور:6 months,1 سنة:1 year",
        "userrights-invalid-expiry": "تاريخ انتهاء المجموعة \"$1\" غير صحيح.",
        "userrights-expiry-in-past": "تاريخ انتهاء المجموعة \"$1\" هو في الماضي.",
+       "userrights-cannot-shorten-expiry": "أنت لا يمكنك تقديم تاريخ الانتهاء للمجموعة \"$1\". فقط المستخدمون الذين يمتلكون السماح لإضافة وإزالة هذه المجموعة يمكنهم تقديم تواريخ الانتهاء.",
        "userrights-conflict": "تضارب في تغيير صلاحيات المستخدم! الرجاء مراجعة تغييراتك مجدّدا وتأكيدها.",
        "group": "المجموعة:",
        "group-user": "مستخدمون",
index 6109b86..b87eb97 100644 (file)
        "rcfilters-filter-pageedits-label": "Рэдагаваньні старонкі",
        "rcfilters-filter-pageedits-description": "Рэдагаваньні вікізьместу, абмеркаваньняў, апісаньняў катэгорыяў…",
        "rcfilters-filter-newpages-label": "Стварэньні старонак",
+       "rcfilters-filter-newpages-description": "Праўкі, якімі створаныя новыя старонкі.",
+       "rcfilters-filter-categorization-label": "Зьмены катэгорыяў",
+       "rcfilters-filter-categorization-description": "Запісы пра дадаваньне і выдаленьне старонак з катэгорыяў.",
+       "rcfilters-filter-logactions-label": "Журнальныя дзеяньні",
        "rcnotefrom": "Ніжэй {{PLURAL:$5|знаходзіцца зьмена|знаходзяцца зьмены}} з <strong>$4 $3</strong> (да <strong>$1</strong> на старонку).",
        "rclistfrom": "Паказаць зьмены з $2 $3",
        "rcshowhideminor": "$1 дробныя праўкі",
index e7d99eb..64e5890 100644 (file)
        "red-link-title": "$1 (چونو بألگئ یی نیدٙئس)",
        "nstab-main": "بلگه",
        "nstab-user": "صفحه کاربر",
+       "nstab-media": "بلگأ ڤارسگأري",
        "nstab-special": "بألگه ڤیجه",
        "nstab-project": "صفحه پروژه",
        "nstab-image": "فایل",
        "mainpage-nstab": "سأرآسوٙنە",
        "error": "خطا",
        "databaseerror-query": "جوستکاری: $1",
+       "databaseerror-error": "خطا: $1",
        "badtitle": "عنوان بد",
        "badtitletext": "عنوان درخواستی نامعتبر، خالی، یا عنوانی بین زبانی یا بین‌ویکی‌ای با پیوند نادرسته\nو ممکنه دارای یک یا چند کاراکتر بوه که در عنوان مربوط نوا زش استفاده کنین",
        "viewsource": "مشاهده منبع",
        "viewsourcetext": "ایسا ترین بوینین وکپی کنین منبع ای صفحه را:",
+       "welcomeuser": "خۈش أڤوڌين،$1!",
        "yourname": "نام کاربر:",
        "userlogin-yourname": "نوم کارياري",
        "userlogin-yourname-ph": "نوم کاریاريتونأ بزنين",
        "createacct-yourpasswordagain": "پشت راسدکاري رازينإ گوڤأرتن",
        "createacct-yourpasswordagain-ph": "ز نۉ رازينإ گوڤأرتن نأ بزأ",
        "userlogin-remembermypassword": "مۈنإ مإن سامۈنإ ڤاڌار",
+       "yourdomainname": "پوشگر ايسا:",
        "login": "اویدن به سیستم",
        "nav-login-createaccount": "اویدن به سیستم",
        "userlogin": "اویدن به سیستم / درست کردن حساب کاربری",
        "userlogin-helplink2": "هومياري کردن سي ڤامإن أڤوڌن",
        "createacct-emailoptional": "تيرنشۈن أنجومانامأ",
        "createacct-email-ph": "تيرنشۈن أنجومانامأ تۈنأ بزنين",
+       "createaccountreason": "دلیل:",
+       "createacct-reason": "دلیل",
        "createacct-submit": "هساڤ خوتۈنإ راسد کونين",
+       "createacct-another-submit": "راسد کردن هساڤ کارياري",
        "createacct-benefit-body1": "{{PLURAL:$1|ڤيرایشد|ڤيرایشدا}}",
        "createacct-benefit-body2": "{{PLURAL:$1|بألگأ|بألگإ آ}}",
        "createacct-benefit-body3": "تازأ{{PLURAL:$1|هوميار|هوميارا}}",
        "noemail": "وجود نداره نشانی امیل ضبط وابده زه کاریر \"$1\".",
        "passwordsent": "یه رمز تازه ارسال وابید به نشانی امیل ثبت وابده سی \"$1\".\nلطفا بعد از دریافت آن داخل سیستم بوین.",
        "eauthentsent": "یه ایمیل سی تایید آدرس ایمیل به آدرس مورنظر ارسال وابید. قبل زه یو که ایمیل دیگری قابل ارسال به این آدرس بوه، وا دستورهایی که در آن ایمیل اویده را جهت تأیید ای مساله که ای آدرس مال ایسانه اجرا کنین.",
+       "accountcreated": "هساڤ راسد ڤابي",
        "loginlanguagelabel": "زۈن:$1",
        "pt-login": "ڤامین اوڤیڌن",
        "pt-login-button": "ڤامین اوڤیڌن",
        "pt-createaccount": "راسد کردن هساڤ کارياري",
        "pt-userlogout": "ز سامۈنإ درأڤوڌن",
+       "changepassword": "آلشد کردن رازينإ گوڤأرتن",
        "retypenew": "تایپ دوباره رمز:",
        "botpasswords-label-create": "راس كردن",
        "botpasswords-label-cancel": "أنجومشيڤ کردن",
        "rev-delundel": "آلشد هال و بال ديإن",
        "rev-showdeleted": "دياري کردن",
        "revdelete-show-file-submit": "هأرإ",
+       "revdelete-log": "دلیل:",
+       "mergehistory-from": "بألگإ سرچشمأ:",
+       "mergehistory-reason": "دلیل:",
        "history-title": "دڤارتإ دیئن ڤيرگار $1",
        "difference-title": "فرخ مإنجقا ڤانإیريا \"$1\"",
        "lineno": "سطر $1:",
        "search-redirect": "(ڤاگردۈني ز $1)",
        "search-section": "(بهرجا $1)",
        "search-suggest": "منزۈرت یو بي:$1",
+       "search-interwiki-more": "(بيشدر)",
        "searchall": "همه",
        "search-nonefound": "هیژ نتیجه یی وا پی جست تو یکی نئ.",
+       "powersearch-toggleall": "همأ",
+       "powersearch-togglenone": "هيش کوم",
        "preferences": "اولویتها",
        "mypreferences": "خوصوٙیات هأنی",
+       "prefs-skin": "پۈسدأ",
+       "skin-preview": "پيش سإیل",
+       "prefs-watchlist": "سإیل برگ",
+       "prefs-editwatchlist": "ڤيرایشد سإیل برگ",
+       "prefs-misc": "شيڤسدن",
+       "prefs-resetpass": "آلشد کردن رازينإ گوڤأرتن",
+       "saveprefs": "إمایإ کردن",
+       "searchresultshead": "پی جۈري",
+       "stub-threshold-sample-link": "نمۈنأ",
+       "timezoneregion-africa": "إفرقا",
+       "timezoneregion-america": "إمرکا",
+       "timezoneregion-asia": "آسيا",
        "yourrealname": "نام واقعی:",
        "prefs-help-realname": "ذکر نام واقعی اختیاریه ایر تصمیم به گدن بگیرین هنگام ارجاع به آثارتو و انتساب هونو به ایسا زه نام واقعیتو استفاده ابوه",
        "grouppage-sysop": "{{ns:project}}:مدیران",
index 92d8c9f..b209279 100644 (file)
        "userrights": "Postavke korisničkih prava",
        "userrights-lookup-user": "Izaberi korisnika",
        "userrights-user-editname": "Upišite korisničko ime:",
-       "editusergroup": "Uredi korisničke grupe",
+       "editusergroup": "Učitaj korisničke grupe",
        "editinguser": "Mijenjate korisnička prava korisnika <strong>[[User:$1|$1]]</strong> $2",
-       "userrights-editusergroup": "Uredi korisničke grupe",
+       "userrights-editusergroup": "Uredi {{GENDER:$1|korisničke}} grupe",
        "saveusergroups": "Sačuvaj {{GENDER:$1|korisničke}} grupe",
        "userrights-groupsmember": "Član:",
        "userrights-groupsmember-auto": "Uključeni član od:",
-       "userrights-groups-help": "Možete promijeniti grupe kojima ovaj korisnik pripada:\n* Označeni kvadratić znači da je korisnik u toj grupi.\n* Neoznačen kvadratić znači da korisnik nije u toj grupi.\n* Oznaka * (zvjezdica) označava da Vi ne možete izbrisati ovu grupu ako je dodate i obrnutno.",
+       "userrights-groups-help": "Možete promijeniti grupe kojima ovaj korisnik pripada:\n* Označeni kvadratić znači da je korisnik u toj grupi.\n* Neoznačeni kvadratić znači da korisnik nije u toj grupi.\n* Zvjezdica (*) označava da ne možete ukloniti grupu nakon što je dodate i obrnuto.\n* Taraba (#) označava da jedino možete odložiti vrijeme isteka ove grupe; ne možete ga ubrzati.",
        "userrights-reason": "Razlog:",
        "userrights-no-interwiki": "Nemate dopuštenja da uređujete korisnička prava na drugim wikijima.",
        "userrights-nodatabase": "Baza podataka $1 ne postoji ili nije lokalna baza.",
        "userrights-conflict": "Sukob u izmjeni korisničkih prava! Molimo da razmotrite i potvrdite Vaše promjene.",
        "group": "Grupa:",
        "group-user": "Korisnici",
-       "group-autoconfirmed": "Potvrđeni korisnici",
+       "group-autoconfirmed": "Automatski potvrđeni korisnici",
        "group-bot": "Botovi",
        "group-sysop": "Administratori",
        "group-bureaucrat": "Birokrati",
        "group-suppress": "Skrivači",
        "group-all": "(sve)",
        "group-user-member": "{{GENDER:$1|korisnik|korisnica}}",
-       "group-autoconfirmed-member": "Potvrđeni korisnik",
-       "group-bot-member": "bot",
+       "group-autoconfirmed-member": "{{GENDER:$1|automatski potvrđen korisnik|automatski potvrđena korisnica}}",
+       "group-bot-member": "{{GENDER:$1|bot}}",
        "group-sysop-member": "{{GENDER:$1|administrator|administratorica}}",
        "group-bureaucrat-member": "{{GENDER:$1|birokrat|birokratica}}",
        "group-suppress-member": "{{GENDER:$1|skrivač|skrivačica}}",
        "grouppage-user": "{{ns:project}}:Korisnici",
-       "grouppage-autoconfirmed": "{{ns:project}}:Potvrđeni korisnici",
+       "grouppage-autoconfirmed": "{{ns:project}}:Automatski potvrđeni korisnici",
        "grouppage-bot": "{{ns:project}}:Botovi",
        "grouppage-sysop": "{{ns:project}}:Administratori",
        "grouppage-bureaucrat": "{{ns:project}}:Birokrati",
        "grouppage-suppress": "{{ns:project}}:Skrivač",
        "right-read": "Čitanje stranica",
        "right-edit": "Uređivanje stranica",
-       "right-createpage": "Pravljenje stranica (neuključujući stranice za razgovor)",
+       "right-createpage": "Pravljenje stranica (izuzev stranica za razgovor)",
        "right-createtalk": "Pravljenje stranica za razgovor",
-       "right-createaccount": "Pravljenje korisničkog računa",
-       "right-minoredit": "Označavanje izmjena kao malih",
+       "right-createaccount": "Pravljenje novih korisničkih računa",
+       "right-minoredit": "Označavanje izmjena manjim",
        "right-move": "Premještanje stranica",
-       "right-move-subpages": "Preusmjeravanje stranica sa svim podstranicama",
-       "right-move-rootuserpages": "Premještanje stranica osnovnih korisnika",
-       "right-move-categorypages": "Pomakni stranice kategorije",
+       "right-move-subpages": "Premještanje stranica s njihovim podstranicama",
+       "right-move-rootuserpages": "Premještanje osnovnih korisničkih stranica",
+       "right-move-categorypages": "Premještanje kategorija",
        "right-movefile": "Premještanje datoteka",
-       "right-suppressredirect": "Ne pravi preusmjeravanje sa starog imena pri preusmjeravanju stranica",
+       "right-suppressredirect": "Premještanje stranica bez ostavljanja preusmjerenja",
        "right-upload": "Postavljanje datoteka",
-       "right-reupload": "Postavljanje nove verzije datoteke",
-       "right-reupload-own": "Postavljanje nove verzije datoteke koju je postavio korisnik",
-       "right-reupload-shared": "Postavljanje novih lokalnih verzija datoteka identičnih onima u zajedničkoj ostavi",
+       "right-reupload": "Postavljanje novih verzija datoteka",
+       "right-reupload-own": "Postavljanje novih verzija vlastitih datoteka",
+       "right-reupload-shared": "Lokalno premošćivanje datoteka sa zajedničke ostave",
        "right-upload_by_url": "Postavljanje datoteke sa URL adrese",
-       "right-purge": "Osvježavanje keša za stranice bez konfirmacije",
-       "right-autoconfirmed": "Bez ograničavanja stavki za IP adrese",
+       "right-purge": "Osvježavanje keša stranice bez potvrde",
+       "right-autoconfirmed": "Izbjegavanje ograničenja stavki za IP adrese",
        "right-bot": "Postavljen kao automatski proces",
-       "right-nominornewtalk": "Male izmjene na stranici za razgovor ne uzrokuju prikazivanje oznake ''nova poruka'' na stranici za razgovor",
+       "right-nominornewtalk": "Izbjegavanje prikazivanja obavještenja o novim porukama kad je označeno da je izmjena manja",
        "right-apihighlimits": "Korištenje viših ograničenja u API upitima",
-       "right-writeapi": "Korištenje opcije ''write API''",
+       "right-writeapi": "Korištenje API-ja za pisanje",
        "right-delete": "Brisanje stranica",
        "right-bigdelete": "Brisanje stranica sa velikom historijom",
-       "right-deletelogentry": "Brisanje i vraćanje određenih zapisa u evidenciji",
-       "right-deleterevision": "Brisanje i vraćanje određenih revizija stranice",
-       "right-deletedhistory": "Pregled stavki obrisane historije, bez povezanog teksta",
-       "right-deletedtext": "Pregled obrisanog teksta i izmjena između obrisanih revizija",
+       "right-deletelogentry": "Brisanje i vraćanje određenih stavki u zapisniku",
+       "right-deleterevision": "Brisanje i vraćanje određenih izmjena stranice",
+       "right-deletedhistory": "Pregledanje stavki obrisane historije, bez povezanog teksta",
+       "right-deletedtext": "Pregledanje obrisanog teksta i izmjena između obrisanih izmjena",
        "right-browsearchive": "Pretraživanje obrisanih stranica",
        "right-undelete": "Vraćanje obrisanih stranica",
-       "right-suppressrevision": "Pregled, sakrivanje i povratak određenih revizija stranice od svih korisnika",
+       "right-suppressrevision": "Pregledanje, sakrivanje i vraćanje određenih verzija stranica od svih korisnika",
        "right-viewsuppressed": "Pregledaj izmjene skrivene od svih korisnika",
-       "right-suppressionlog": "Gledanje privatnih zapisa",
-       "right-block": "Blokiranje uređivanja drugih korisnika",
-       "right-blockemail": "Blokiranje korisnika da šalje e-mail",
-       "right-hideuser": "Blokiranje korisničkog imena, i njegovo sakrivanje od javnosti",
-       "right-ipblock-exempt": "Zaobilaženje IP blokada, autoblokada i blokada IP grupe",
-       "right-unblockself": "Deblokiraj samog sebe",
-       "right-protect": "Promjena nivoa zaštite i uređivanje kaskadno zaštićenih stranica",
-       "right-editprotected": "Uređivanje stranice zaštićenih kao \"{{int:protect-level-sysop}}\"",
-       "right-editsemiprotected": "Uređivanje stranica zaštićenih kao  \"{{int:protect-level-autoconfirmed}}\"",
+       "right-suppressionlog": "Pregledanje privatnih zapisnika",
+       "right-block": "Blokiranje mogućnosti uređivanja drugim korisnicima",
+       "right-blockemail": "Blokiranje korisnikove mogućnosti da šalje e-poštu",
+       "right-hideuser": "Blokiranje korisničkog imena i njegovo sakrivanje od javnosti",
+       "right-ipblock-exempt": "Zaobilaženje IP-blokada, autoblokada i blokada opsega",
+       "right-unblockself": "Deblokiranje samog sebe",
+       "right-protect": "Mijenjanje nivoâ zaštite i uređivanje stranica pod prenosivom zaštitom",
+       "right-editprotected": "Uređivanje stranica pod zaštitom \"{{int:protect-level-sysop}}\"",
+       "right-editsemiprotected": "Uređivanje stranica pod zaštitom \"{{int:protect-level-autoconfirmed}}\"",
        "right-editcontentmodel": "Uređivanje modela sadržaja stranice",
        "right-editinterface": "Uređivanje korisničkog interfejsa",
        "right-editusercssjs": "Uređivanje CSS i JS datoteka drugih korisnika",
-       "right-editusercss": "Uređivanje CSS datoteka drugih korisnika",
-       "right-edituserjs": "Uređivanje JS datoteka drugih korisnika",
-       "right-editmyusercss": "Uredite svoje vlastite korisničke CSS datoteke",
-       "right-editmyuserjs": "Uredite vlastite korisničke JavaScript datoteke",
-       "right-viewmywatchlist": "Pogledaj svoj spisak praćenih stranica",
-       "right-editmywatchlist": "Uredite vlastiti spisak praćenja. Važno je spomenuti da će neke radnje dodati stranice na spisak, čak i bez ovog prava.",
-       "right-viewmyprivateinfo": "Pogledajte Vaše privatne podatke (npr, adresa e-pošte, pravo ime)",
-       "right-editmyprivateinfo": "Uredite svoje privatne podatke (npr. adresa e-pošte, pravo ime)",
-       "right-editmyoptions": "Uredite svoje postavke",
+       "right-editusercss": "Uređivanje tuđih CSS datoteka",
+       "right-edituserjs": "Uređivanje tuđih JavaScript datoteka",
+       "right-editmyusercss": "Uređivanje vlastitih CSS datoteka",
+       "right-editmyuserjs": "Uređivanje vlastitih JavaScript datoteka",
+       "right-viewmywatchlist": "Pregledanje vlastitog spiska praćenja",
+       "right-editmywatchlist": "Uređivanje vlastitog spiska praćenja. Važno je spomenuti da će neke radnje dodati stranice na spisak, čak i bez ovog prava.",
+       "right-viewmyprivateinfo": "Pregledanje vlastitih ličnih podataka (npr, adresa e-pošte, pravo ime)",
+       "right-editmyprivateinfo": "Uređivanje vlastitih ličnih podataka (npr. adresa e-pošte, pravo ime)",
+       "right-editmyoptions": "Uređivanje vlastitih postavki",
        "right-rollback": "Brzo vraćanje izmjena posljednjeg korisnika koji je uređivao određenu stranicu",
        "right-markbotedits": "Označavanje vraćenih izmjena kao izmjene bota",
        "right-noratelimit": "Izbjegavanje ograničenja uzrokovanih brzinom",
-       "right-import": "Uvoz stranica iz drugih wikija",
-       "right-importupload": "Uvoz stranica putem postavljanja datoteke",
-       "right-patrol": "Označavanje izmjena drugih korisnika patroliranim",
-       "right-autopatrol": "Vlastite izmjene se automatski označavaju kao patrolirane",
+       "right-import": "Uvoženje stranica iz drugih wikija",
+       "right-importupload": "Uvoženje stranica putem postavljanja datoteke",
+       "right-patrol": "Označavanje tuđih izmjena patroliranim",
+       "right-autopatrol": "Automatsko označavanje vlastitih izmjena patroliranim",
        "right-patrolmarks": "Pregled oznaka patroliranja u spisku nedavnih izmjena",
-       "right-unwatchedpages": "Gledanje spiska nepraćenih stranica",
+       "right-unwatchedpages": "Pregledanje spiska nepraćenih stranica",
        "right-mergehistory": "Spajanje historije stranica",
        "right-userrights": "Uređivanje svih korisničkih prava",
        "right-userrights-interwiki": "Uređivanje korisničkih prava korisnika na drugim wikijima",
        "right-siteadmin": "Zaključavanje i otključavanje baze podataka",
        "right-override-export-depth": "Izvoz stranica uključujući povezane stranice do dubine od 5 linkova",
-       "right-sendemail": "Slanje e-maila drugim korisnicima",
-       "right-managechangetags": "Napravi i (de)aktiviraj [[Special:Tags|oznake]]",
-       "right-applychangetags": "Primijeni [[Special:Tags|oznake]] na nečije izmjene",
-       "right-changetags": "Dodavanje ili uklanjanje raznih [[Special:Tags|oznaka]] na pojedinačnim verzijama i unosima zapisnika",
+       "right-sendemail": "Slanje e-pošte drugim korisnicima",
+       "right-managechangetags": "Pravljenje i (de)aktiviranje [[Special:Tags|oznaka]]",
+       "right-applychangetags": "Primjenjivanje [[Special:Tags|oznaka]] na nečije izmjene",
+       "right-changetags": "Dodavanje ili uklanjanje raznih [[Special:Tags|oznaka]] na pojedinačnim verzijama i unosima u zapisnicima",
+       "right-deletechangetags": "Brisanje [[Special:Tags|oznaka]] iz baze podataka",
        "grant-group-page-interaction": "Upravljanje stranicama",
        "grant-group-watchlist-interaction": "Upravljanje Vašim spiskom praćenja",
        "grant-group-high-volume": "Izvršavanje velikog broja radnji",
        "rightslog": "Zapisnik korisničkih prava",
        "rightslogtext": "Ovo je zapisnik promjena korisničkih prava.",
        "action-read": "čitate ovu stranicu",
-       "action-edit": "uređujete ovu stranicu",
+       "action-edit": "uredite ovu stranicu",
        "action-createpage": "napravite ovu stranicu",
-       "action-createtalk": "pravite stranice za razgovor",
+       "action-createtalk": "napravite ovu stranicu za razgovor",
        "action-createaccount": "napravite ovaj korisnički račun",
        "action-history": "gledate historiju ove stranice",
-       "action-minoredit": "da označite ovu izmjenu kao malu",
+       "action-minoredit": "označite ovu izmjenu manjom",
        "action-move": "premjestite ovu stranicu",
-       "action-move-subpages": "premjestite ovu stranicu, i njene podstranice",
-       "action-move-rootuserpages": "premjestite stranice osnovnog korisnika",
-       "action-move-categorypages": "pomakni stranice kategorije",
-       "action-movefile": "premjesti ovu datoteku",
-       "action-upload": "postavljate ovu datoteku",
-       "action-reupload": "stavite novu verziju postojeće datoteke",
-       "action-reupload-shared": "postavite ovu datoteku iz zajedničke ostave",
+       "action-move-subpages": "premjestite ovu stranicu i njene podstranice",
+       "action-move-rootuserpages": "premještate osnovne korisničke stranice",
+       "action-move-categorypages": "premještate kategorije",
+       "action-movefile": "premjestite ovu datoteku",
+       "action-upload": "postavite ovu datoteku",
+       "action-reupload": "postavite novu verziju postojeće datoteke",
+       "action-reupload-shared": "premostite ovu datoteku sa zajedničke ostave",
        "action-upload_by_url": "postavite ovu datoteku putem URL adrese",
-       "action-writeapi": "koristite ''write API'' opciju",
+       "action-writeapi": "koristite API za pisanje",
        "action-delete": "obrišete ovu stranicu",
-       "action-deleterevision": "obrišete ovu reviziju",
-       "action-deletedhistory": "gledate obrisanu historiju ove stranice",
+       "action-deleterevision": "brišete izmjene",
+       "action-deletelogentry": "brišete stavke u zapisniku",
+       "action-deletedhistory": "pregledate obrisanu historiju ove stranice",
+       "action-deletedtext": "pregledate obrisani tekst izmjene",
        "action-browsearchive": "pretražujete obrisane stranice",
-       "action-undelete": "vratite ovu stranicu",
-       "action-suppressrevision": "pregledate i vratite ovu skrivenu reviziju",
-       "action-suppressionlog": "vidite ovaj privatni zapis",
-       "action-block": "blokirate uređivanje ovog korisnika",
-       "action-protect": "promijeniti nivo zaštite za ovu stranicu",
-       "action-rollback": "brzo vraćanje izmjena posljednjeg korisnika koji je uređivao određenu stranicu",
-       "action-import": "uvozite stranice iz druge wiki",
-       "action-importupload": "uvoz stranica putem postavljanja datoteke",
-       "action-patrol": "označite izmjene drugih kao patrolirane",
-       "action-autopatrol": "da Vaše izmjene budu označene kao patrolirane",
+       "action-undelete": "vraćate stranice",
+       "action-suppressrevision": "pregledate i vraćate sakrivene izmjene",
+       "action-suppressionlog": "pregledate ovaj privatni zapisnik",
+       "action-block": "blokirate mogućnost uređivanja ovom korisniku",
+       "action-protect": "promijenite nivoe zaštite ove stranice",
+       "action-rollback": "brzo vratite izmjenu posljednjeg korisnika koji je uređivao određenu stranicu",
+       "action-import": "uvozite stranice iz drugih wikija",
+       "action-importupload": "uvozite stranice putem postavljanja datoteke",
+       "action-patrol": "označite tuđe izmjene patroliranim",
+       "action-autopatrol": "označite vlastite izmjene patroliranim",
        "action-unwatchedpages": "pregledate spisak nepraćenih stranica",
        "action-mergehistory": "spajate historiju ove stranice",
        "action-userrights": "uređujete sva korisnička prava",
        "action-userrights-interwiki": "uređujete korisnička prava korisnika na drugim wikijima",
        "action-siteadmin": "zaključavate ili otključavate bazu podataka",
-       "action-sendemail": "pošalji e-mail poruke",
-       "action-editmywatchlist": "uredite svoj spisak praćenih stranica",
-       "action-viewmywatchlist": "pogledajte svoj spisak praćenih stranica",
-       "action-viewmyprivateinfo": "pogledajte svoje privatne informacije",
-       "action-editmyprivateinfo": "uredite svoje privatne podatke",
-       "action-editcontentmodel": "uredi model sadržaja stranice",
+       "action-sendemail": "šaljete e-poštu",
+       "action-editmyoptions": "uređujete vlastite postavke",
+       "action-editmywatchlist": "uredite vlastiti spisak praćenja",
+       "action-viewmywatchlist": "pregledate vlastiti spisak praćenja",
+       "action-viewmyprivateinfo": "pregledate vlastite lične podatke",
+       "action-editmyprivateinfo": "uređujete vlastite lične podatke",
+       "action-editcontentmodel": "uređujete model sadržaja stranice",
        "action-managechangetags": "pravite i (de)aktivirate oznake",
-       "action-applychangetags": "dodate oznake uz ve izmjene",
+       "action-applychangetags": "dodate oznake uz vlastite izmjene",
        "action-changetags": "dodate ili uklonite razne oznake na pojedinačnim verzijama i unosima u zapisnicima",
+       "action-deletechangetags": "brišete oznake iz baze podataka",
+       "action-purge": "osvježite keš ove stranice",
        "nchanges": "$1 {{PLURAL:$1|promjena|promjene|promjena}}",
        "enhancedrc-since-last-visit": "$1 {{PLURAL:$1|izmjena od Vaše posljedne posjete}}",
        "enhancedrc-history": "historija",
        "listgrouprights-rights": "Prava",
        "listgrouprights-helppage": "Help:Prava grupe",
        "listgrouprights-members": "(spisak članova)",
-       "listgrouprights-addgroup": "Mogu dodati {{PLURAL:$2|grupu|grupe}}: $1",
-       "listgrouprights-removegroup": "Mogu ukloniti {{PLURAL:$2|grupu|grupe}}: $1",
+       "listgrouprights-addgroup": "Dodavanje {{PLURAL:$2|sljedeće grupe|sljedećih grupa}}: $1",
+       "listgrouprights-removegroup": "Uklanjanje {{PLURAL:$2|sljedeće grupe|sljedećih grupa}}: $1",
        "listgrouprights-addgroup-all": "Može dodavati sve grupe",
        "listgrouprights-removegroup-all": "Može ukloniti sve grupe",
        "listgrouprights-addgroup-self": "Može dodati {{PLURAL:$2|grupu|grupe|grupa}} na svoj račun: $1",
        "unblocklink": "deblokiraj",
        "change-blocklink": "promijeni blokadu",
        "contribslink": "doprinosi",
-       "emaillink": "pošalji e-mail",
+       "emaillink": "pošalji e-poruku",
        "autoblocker": "Automatski ste blokirani jer dijelite IP-adresu sa \"[[User:$1|$1]]\".\nRazlog za blokiranje korisnika $1 je ''$2''",
        "blocklogpage": "Zapisnik blokiranja",
        "blocklog-showlog": "Ovaj korisnik je ranije blokiran. Zapisnik blokiranja je prikazan ispod kao referenca:",
index 8171411..ce331c1 100644 (file)
        "move-page": "Reanomena $1",
        "move-page-legend": "Reanomena la pàgina",
        "movepagetext": "Amb el formulari següent reanomenareu una pàgina, movent tot el seu historial al nou nom.\nEl títol anterior es convertirà en una pàgina de redirecció al nou títol.\nPodeu actualitzar automàticament les redireccions que apuntin al títol original.\nSi no ho feu, assegureu-vos de verificar les redireccions [[Special:DoubleRedirects|dobles]] o [[Special:BrokenRedirects|trencades]].\nSerà de la vostra responsabilitat verificar que els enllaços segueixin apuntant cap a on se suposa que ho han de fer.\n\nTingueu en compte que la pàgina <strong>no</strong> serà traslladada si ja existeix una pàgina amb el títol nou, tret que sigui una redirecció sense més historial.\nAixò significa que podeu reanomenar de nou una pàgina al seu títol original si cometeu un error, i que no podeu sobreescriure una pàgina existent.\n\n<strong>Nota:</strong>\nAçò pot ser un canvi dràstic i inesperat en una pàgina que sigui popular; \nassegureu-vos d'entendre les conseqüències que comporta abans de seguir endavant.",
-       "movepagetext-noredirectfixer": "Amb el formulari següent podeu reanomenar una pàgina movent tot el seu historial al nom nou.\nEl títol anterior es convertirà en una pàgina de redirecció al nou títol. \nAssegureu-vos de verificar les redireccions [[Special:DoubleRedirects|dobles]] o [[Special:BrokenRedirects|trencades]].\nÉs responsabilitat vostra assegurar que els enllaços continuen apuntant cap a on se suposa que han d'anar. \n\nTingueu en compte que la pàgina <strong>no</strong> serà traslladada si ja existeix una pàgina amb el títol nou, tret que sigui una redirecció i no tingui més historial. \nAixò significa que podeu reanomenar de nou una pàgina al seu títol original si cometeu un error, i que no podeu sobreescriure una pàgina existent.\n \n<strong>Nota:</strong>\nAixò pot ser un canvi dràstic i inesperat per una pàgina popular; \nassegureu-vos que sabeu el que feu abans de continuar.",
+       "movepagetext-noredirectfixer": "Utilizatz lo formulari çaijós per renomenar una pagina, en desplaçant tot son istoric cap al nom novèl.\nL’ancian títol vendrà una pagina de redireccion cap al novèl títol.\nVerificatz plan las [[Special:DoubleRedirects|doblas redireccions]] o las [[Special:BrokenRedirects|redireccions copadas]].\nAvètz la responsabilitat de vos assegurar que los ligams contuhan de puntar cap a lor destinacion supausada.\n\nNotatz que la pagina serà <strong>pas</strong> desplaçada se existís ja una pagina amb lo títol novèl, levat se aquesta darrièra a un istoric de modificacions verge e es siá void, siá una simpla redireccion. Aquò permet de renomenar una pagina cap a sa posicion d’origina se lo desplaçament s’avèra erronèu, e es impossible d’espotir una pagina existenta.\n\n<strong>Atencion !</strong>\nAquò pòt provocar un cambiament radical e imprevist per una pagina sovent consultada ; asseguratz-vos de n'aver comprés las consequéncias abans de contunhar.",
        "movepagetalktext": "Si marqueu aquesta casella, la pàgina de discussió associada també serà traslladada automàticament al nou títol, tret que ja existeixi allà una pàgina de discussió no buida.\n\nEn aquest cas, haureu de traslladar o fusionar la pàgina manualment si ho desitgeu.",
        "moveuserpage-warning": "'''Atenció:''' Esteu a punt de moure una pàgina d'usuari. Tingueu en compte que només la pàgina es desplaçarà i que el compte d'usuari ''no'' canviarà de nom.",
        "movecategorypage-warning": "<strong>Avís:</strong> Esteu a punt de moure una pàgina de categoria. Tingueu en compte que només es mourà aquesta pàgina, i que les pàgines dins la categoria antiga <em>no</em> es recategoritzaran automàticament en la nova.",
index 06f4da5..95f0182 100644 (file)
        "jumptosearch": "szëkbë",
        "aboutsite": "Ò {{SITENAME}}",
        "aboutpage": "Project:Ò_{{SITENAME}}",
-       "copyright": "Zamkłosc hewòtny starnë je ùżëczónô wedle reglów $1, jeżlë nie pòdóno jinaczi.",
+       "copyright": "Zamkłosc hewòtny starnë je ùprzëstãpnianô wedle reglów $1, jeżlë nie pòdóno jinaczi.",
        "copyrightpage": "{{ns:project}}:Ùsôdzkòwé_prawa",
        "currentevents": "Aktualné wëdarzenia",
        "currentevents-url": "Project:Aktualné wëdarzenia",
        "nstab-special": "Specjalnô starna",
        "nstab-project": "meta-starna",
        "nstab-image": "Òbrôzk",
-       "nstab-mediawiki": "Òłosënk",
+       "nstab-mediawiki": "Ògłosënk",
        "nstab-template": "Szablóna",
        "nstab-help": "Pòmòc",
        "nstab-category": "Kategòrëjô",
        "clearyourcache": "'''Bôczë: Pò zapisanim, mòże bãdzesz mùszôł òminąc pamiãc przezérnika bë òbaczëc zmianë.'''\n'''Mozilla / Firefox / Safari:''' przëtrzëmôj ''Shift'' òbczas klëkaniô na ''Zladëjë znowa'', abò wcësni ''Ctrl-F5'' abò ''Ctrl-R'' (''Command-R'' na kòmpùtrach Mac);\n'''Konqueror:''': klëkni na knąpã ''Zladëjë znowa'', abò wcësni ''F5'';\n'''Opera:''' wëczëszczë pòdrãczną pamiãc w ''Tools→Preferences'';\n'''Internet Explorer:'''przëtrzëmôj ''Ctrl'' òbczas klëkaniô na ''Zladëjë znowa'', abò wcësni ''Ctrl-F5''.",
        "updated": "(Zaktualnioné)",
        "previewnote": "<strong>To je blós pòdzérk.</strong>\n Artikel jesz nie je zapisóny!",
+       "continue-editing": "Przeńdzë do pòla edicje.",
        "editing": "Edicëjô $1",
        "editingsection": "Edicëjô $1 (dzél)",
        "explainconflict": "Chtos sfórtowôł wprowadzëc swòją wersëjã artikla òbczôs Twòji edicëji.\nGórné pòle edicëji zamëkô w se tekst starnë aktualno zapisóny w pòdôwkòwi baze.\nTwòje zmianë są w dólnym pòlu edicëji.\nBë wprowadzëc swòje zmianë mùszisz zmòdifikòwac tekst z górnégò pòla.\n'''Blós''' tekst z górnégò pòla mdze zapisóny w baze czej wcësniesz \"{{int:savearticle}}\".",
index f9da48f..e917c62 100644 (file)
        "filerenameerror": "No se ha podido renombrar el archivo «$1» a «$2».",
        "filedeleteerror": "No se ha podido borrar el archivo «$1».",
        "directorycreateerror": "No se ha podido crear el directorio «$1».",
-       "directoryreadonlyerror": "La carpeta «$1» es de solo lectura.",
-       "directorynotreadableerror": "La carpeta «$1» no tiene permisos de lectura.",
+       "directoryreadonlyerror": "El directorio «$1» es de solo lectura.",
+       "directorynotreadableerror": "El directorio «$1» no tiene permisos de lectura.",
        "filenotfound": "No se ha encontrado el archivo «$1».",
        "unexpected": "Valor inesperado: «$1»=«$2».",
        "formerror": "Error: no se ha podido enviar el formulario.",
index 0c47e68..824ec6f 100644 (file)
        "passwordreset-domain": "Domeen:",
        "passwordreset-email": "E-posti aadress:",
        "passwordreset-emailtitle": "{{GRAMMAR:genitive|{{SITENAME}}}} konto andmed",
-       "passwordreset-emailtext-ip": "Keegi, arvatavasti sina ise, IP-aadressilt $1 palus lähtestada sinu {{GRAMMAR:genitive|{{SITENAME}}}} ($4) parooli. Selle e-posti aadressiga on seotud {{PLURAL:$3|järgmine konto|järgmised kontod}}:\n\n$2\n\n{{PLURAL:$3|See ajutine parool aegub|Need ajutised paroolid aeguvad}} {{PLURAL:$5|ühe|$5}} päeva pärast.\nPeaksid nüüd sisse logima ja uue parooli valima. Kui selle palve esitas keegi teine või kui sulle meenus su parool ja sa ei soovi seda enam muuta, võid teadet eirata ja jätkata vana parooli kasutamist.",
+       "passwordreset-emailtext-ip": "Keegi IP-aadressilt $1, arvatavasti sina ise, palus lähtestada sinu {{GRAMMAR:genitive|{{SITENAME}}}} ($4) parooli. Selle e-posti aadressiga on seotud {{PLURAL:$3|järgmine konto|järgmised kontod}}:\n\n$2\n\n{{PLURAL:$3|See ajutine parool aegub|Need ajutised paroolid aeguvad}} {{PLURAL:$5|ühe|$5}} päeva pärast.\nPeaksid nüüd sisse logima ja uue parooli valima. Kui selle palve esitas keegi teine või kui sulle meenus su parool ja sa ei soovi seda enam muuta, võid teadet eirata ja jätkata vana parooli kasutamist.",
        "passwordreset-emailtext-user": "{{GRAMMAR:genitive|{{SITENAME}}}} kasutaja $1 palus lähtestada sinu {{GRAMMAR:genitive|{{SITENAME}}}} ($4) parooli. Selle e-posti aadressiga on seotud {{PLURAL:$3|järgmine konto|järgmised kontod}}:\n\n$2\n\n{{PLURAL:$3|See ajutine parool aegub|Need ajutised paroolid aeguvad}} {{PLURAL:$5|ühe|$5}} päeva pärast.\nPeaksid nüüd sisse logima ja uue parooli valima. Kui selle palve esitas keegi teine või kui sulle meenus su parool ja sa ei soovi seda enam muuta, võid teadet eirata ja jätkata vana parooli kasutamist.",
        "passwordreset-emailelement": "Kasutajanimi: \n$1\n\nAjutine parool: \n$2",
        "passwordreset-emailsentemail": "Kui oled sidunud konto selle e-posti aadressiga, siis saadetakse sulle parooli lähtestamise e-kiri.",
        "content-json-empty-object": "Tühi objekt",
        "content-json-empty-array": "Tühi massiiv",
        "deprecated-self-close-category": "Vigaste endassesuletud HTML-siltidega leheküljed",
+       "deprecated-self-close-category-desc": "Leheküljel on endassesuletud HTML-silte nagu <code>&lt;b/></code> või <code>&lt;span/></code>. Nende kuvamisviis viiakse peagi vastavusse HTML5 spetsifikatsiooniga. Seetõttu selliseid silte vikitekstis enam kasutama ei peaks.",
        "duplicate-args-warning": "<strong>Hoiatus:</strong> [[:$1]] kutsub malli [[:$2]] nii, et parameetrile \"$3\" vastab rohkem kui üks väärtus. Väärtustest kasutatakse ainult viimast.",
        "duplicate-args-category": "Leheküljed, kus mallikutses on topeltargument",
        "duplicate-args-category-desc": "Lehekülg sisaldab mallikutseid, kus mõnd argumenti on kasutatud mitu korda, näiteks <code><nowiki>{{foo|bar=1|bar=2}}</nowiki></code> või <code><nowiki>{{foo|bar|1=baz}}</nowiki></code>.",
        "search-interwiki-caption": "Sõsarprojektid",
        "search-interwiki-default": "Tulemused asukohast $1:",
        "search-interwiki-more": "(veel)",
+       "search-interwiki-more-results": "veel tulemusi",
        "search-relatedarticle": "Seotud",
        "searchrelated": "seotud",
        "searchall": "kõik",
        "file-thumbnail-no": "Failinimi algab eesliitega <strong>$1</strong>.\nSee paistab vähendatud suurusega pilt (''pisipilt'') olevat.\nKui sul on ka selle pildi täislahutusega versioon, laadi palun hoopis see üles, vastasel korral muuda palun faili nime.",
        "fileexists-forbidden": "Sellise nimega fail on juba olemas, seda ei saa üle kirjutada.\nPalun pöörduge tagasi ja laadige fail üles mõne teise nime all. [[File:$1|thumb|center|$1]]",
        "fileexists-shared-forbidden": "Samanimeline fail on juba olemas jagatud meediavaramus.\nKui soovid siiski oma faili üles laadida, siis palun mine tagasi ja kasuta teist failinime.\n[[File:$1|thumb|center|$1]]",
+       "fileexists-no-change": "Üleslaaditav fail on faili <strong>[[:$1]]</strong> praeguse versiooni üksühene duplikaat.",
+       "fileexists-duplicate-version": "Üleslaaditav fail on faili <strong>[[:$1]]</strong> {{PLURAL:$2|vanema versiooni|vanemate versioonide}} üksühene duplikaat.",
        "file-exists-duplicate": "See fail on {{PLURAL:$1|järgmise faili|järgmiste failide}} duplikaat:",
        "file-deleted-duplicate": "Selle failiga ([[:$1]]) identne fail on hiljuti kustutatud.\nVaata selle faili kustutamise ajalugu enne jätkamist.",
        "file-deleted-duplicate-notitle": "Selle failiga identne fail on varem kustutatud ja pealkiri on varjatud.\nEnne kui jätkad uuesti üleslaadimisega, peaksid paluma olukorda hinnata kellelgi, kes saab vaadata varjatud andmeid.",
        "uploaded-script-svg": "Üleslaaditud SVG-failist leiti skriptitav element \"$1\".",
        "uploaded-hostile-svg": "Üleslaaditud SVG-faili laadielemendist leiti ebaturvaline CSS.",
        "uploaded-event-handler-on-svg": "Sündmuse halduse atribuutide <code>$1=\"$2\"</code> seadmine pole SVG-failis lubatud.",
+       "uploaded-href-attribute-svg": "SVG-failis on lubatud href-atribuudiga viidata ainult sihtkohta skeemiga http:// või https://. Leiti <code>&lt;$1 $2=\"$3\"&gt;</code>.",
        "uploaded-href-unsafe-target-svg": "Üleslaaditud SVG-failist leiti href, mis viitab ebaturvalistele andmetele: URI sihtkoht <code>&lt;$1 $2=\"$3\"&gt;</code>.",
        "uploaded-animate-svg": "Üleslaaditud SVG-failist leiti silt \"animate\", mis võib href-i muuta, kasutades from-atribuuti <code>&lt;$1 $2=\"$3\"&gt;</code>.",
        "uploaded-setting-event-handler-svg": "Sündmuse halduse atribuutide seadmine on keelatud, üleslaaditud SVG-failist leiti <code>&lt;$1 $2=\"$3\"&gt;</code>.",
        "upload-too-many-redirects": "URL sisaldas liiga palju ümbersuunamisi",
        "upload-http-error": "HTTP-viga: $1",
        "upload-copy-upload-invalid-domain": "Sellest domeenist pole kopeerimise teel üleslaadimine võimalik.",
+       "upload-foreign-cant-upload": "Selles vikis pole häälestatud failide üleslaadimine päritud välisesse failihoidlasse.",
+       "upload-foreign-cant-load-config": "Ei õnnestunud laadida häälestust, mis puudutab failide üleslaadimist välisesse failihoidlasse.",
+       "upload-dialog-disabled": "Selle dialoogi kasutamine üleslaadimiseks on siin vikis keelatud.",
        "upload-dialog-title": "Faili üleslaadimine",
        "upload-dialog-button-cancel": "Loobu",
+       "upload-dialog-button-back": "Tagasi",
        "upload-dialog-button-done": "Valmis",
        "upload-dialog-button-save": "Salvesta",
        "upload-dialog-button-upload": "Laadi üles",
        "upload-form-label-infoform-title": "Üksikasjad",
        "upload-form-label-infoform-name": "Pealkiri",
+       "upload-form-label-infoform-name-tooltip": "Ainukordne ja kirjeldav pealkiri, millest saab failinimi. Võid kasutada lihtteksti ja tühikuid. Ära lisa nimele faililaiendit.",
        "upload-form-label-infoform-description": "Kirjeldus",
+       "upload-form-label-infoform-description-tooltip": "Anna teose kohta lühidalt edasi kõik märkimisväärne.\nFoto juures maini, mida on kujutatud, mis sündmuse või kohaga on tegu.",
        "upload-form-label-usage-title": "Kasutus",
        "upload-form-label-usage-filename": "Failinimi",
-       "upload-form-label-own-work": "See on minu enda töö",
+       "upload-form-label-own-work": "See on minu enda looming.",
        "upload-form-label-infoform-categories": "Kategooriad",
        "upload-form-label-infoform-date": "Kuupäev",
        "upload-form-label-own-work-message-generic-local": "Kinnitan, et seda faili üles laadides järgin saidi {{SITENAME}} kasutustingimusi ja litsentsipõhimõtteid.",
        "zip-wrong-format": "Valitud fail ei ole ZIP-fail.",
        "zip-bad": "See ZIP-fail on kas rikutud või muul põhjusel loetamatu.\nSelle turvalisust ei saa kontrollida.",
        "zip-unsupported": "See ZIP-fail kasutab ZIP-funktsioone, mida MediaWiki ei toeta.\nSelle turvalisust ei saa kontrollida.",
-       "uploadstash": "Üleslaaditud failide algne hoidla",
+       "uploadstash": "Üleslaadimise peithoidla",
        "uploadstash-summary": "See lehekülg pakub juurdepääsu failidele, mis on üles laaditud (või mida parasjagu üles laaditakse), kuid mis pole veel vikis avaldatud. Need failid on nähtavad üksnes kasutajale, kes need üles laadis.",
-       "uploadstash-clear": "Kustuta failid algsest hoidlast",
-       "uploadstash-nofiles": "Sul pole algses hoidlas faile.",
+       "uploadstash-clear": "Eemalda peitfailid",
+       "uploadstash-nofiles": "Sul pole peitfaile.",
        "uploadstash-badtoken": "Toiming ebaõnnestus, võib-olla redigeerimismandaadi aegumise tõttu. Palun proovi uuesti.",
-       "uploadstash-errclear": "Failide kustutamine ebaõnnestus.",
+       "uploadstash-errclear": "Failide eemaldamine ebaõnnestus.",
        "uploadstash-refresh": "Värskenda faililoendit",
+       "uploadstash-thumbnail": "vaata pisipilti",
+       "uploadstash-exception": "Üleslaaditavat faili ei õnnestunud peithoidlas talletada ($1): \"$2\".",
        "invalid-chunk-offset": "Tüki vigane nihe",
        "img-auth-accessdenied": "Juurdepääs keelatud",
        "img-auth-nopathinfo": "PATH_INFO puudub.\nSinu server pole seadistatud seda teavet edastama.\nSee võib olla CGI-põhine ja ei toeta img_auth-i.\nVaata lehekülge https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Image_Authorization.",
        "filerevert-submit": "Taasta",
        "filerevert-success": "Faili '''[[Media:$1|$1]]''' seisuga [$4 $3, $2 kasutusel olnud versioon] on taastatud.",
        "filerevert-badversion": "Ette antud ajatempliga kohalik versioon sellest failist puudub.",
+       "filerevert-identical": "Praegune versioon on valitud versiooniga juba identne.",
        "filedelete": "Kustuta $1",
        "filedelete-legend": "Faili kustutamine",
        "filedelete-intro": "Oled kustutamas faili '''[[Media:$1|$1]]''' ja kogu selle ajalugu.",
        "uncategorizedcategories": "Kategoriseerimata kategooriad",
        "uncategorizedimages": "Kategoriseerimata failid",
        "uncategorizedtemplates": "Kategoriseerimata mallid",
+       "uncategorized-categories-exceptionlist": " # Loetelu kategooriatest, mis ei peaks kajastuma leheküljel \"Eri:Kategoriseerimata kategooriad\". Üks kategooria rea kohta, rea alguses \"*\". Muu märgiga (sh tühemik) algavaid ridu eiratakse. Komentaari jaoks kasuta märki \"#\".",
        "unusedcategories": "Kasutamata kategooriad",
        "unusedimages": "Kasutamata failid",
        "wantedcategories": "Kõige oodatumad kategooriad",
        "trackingcategories-name": "Sõnumi nimi",
        "trackingcategories-desc": "Kategooriasse arvamise kriteeriumid",
        "restricted-displaytitle-ignored": "Eiratava kuvapealkirjaga leheküljed",
+       "restricted-displaytitle-ignored-desc": "Leheküljel on <code><nowiki>{{DISPLAYTITLE}}</nowiki></code>, mida eiratakse, sest see ei vasta lehekülje tegelikule pealkirjale.",
        "noindex-category-desc": "Robotid ei indekseeri lehekülge, sest sellel on võlusõna <code><nowiki>__NOINDEX__</nowiki></code> ja lehekülg on nimeruumis, kus see silt on lubatud.",
        "index-category-desc": "Leheküljel on <code><nowiki>__INDEX__</nowiki></code> ja lehekülg on nimeruumis, kus see silt on lubatud ning seetõttu indekseerivad robotid lehekülge seal, kus nad muidu seda ei teeks.",
        "post-expand-template-inclusion-category-desc": "Kõigi mallide hõrendamise järel on lehekülg suurem kui <code>$wgMaxArticleSize</code>, mistõttu jäid mõned mallid hõrendamata.",
        "rollbacklinkcount": "tühista {{PLURAL:$1|üks muudatus|$1 muudatust}}",
        "rollbacklinkcount-morethan": "tühista üle {{PLURAL:$1|ühe muudatuse|10 muudatuse}}",
        "rollbackfailed": "Muudatuste tühistamine ebaõnnestus",
+       "rollback-missingparam": "Päringus puuduvad nõutavad parameetrid.",
+       "rollback-missingrevision": "Redaktsiooni andmeid ei õnnestu laadida.",
        "cantrollback": "Ei saa muudatusi eemaldada, sest viimane kaastööline on artikli ainus autor.",
        "alreadyrolled": "Muudatust, mille tegi lehele [[:$1]] kasutaja [[User:$2|$2]] ([[User talk:$2|arutelu]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]), ei saa tühistada, sest keegi teine on seda lehte vahepeal muutnud.\n\nLehte muutis viimasena [[User:$3|$3]] ([[User talk:$3|arutelu]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).",
        "editcomment": "Redaktsiooni resümee oli: <em>$1</em>.",
        "revertpage": "Tühistati kasutaja [[Special:Contributions/$2|$2]] ([[User talk:$2|arutelu]]) tehtud muudatused ja pöörduti tagasi viimasele muudatusele, mille tegi [[User:$1|$1]].",
        "revertpage-nouser": "Tühistati peidetud kasutaja muudatused ja pöörduti tagasi viimasele muudatusele, mille tegi [[User:$1|$1]].",
        "rollback-success": "Tühistati muudatused, mille tegi $1;\npöörduti tagasi viimasele muudatusele, mille tegi $2.",
+       "rollback-success-notify": "Tühistatud kasutaja $1 tehtud muudatused;\npöördutud tagasi kasutaja $2 viimase redaktsiooni juurde. [$3 Näita muudatusi]",
        "sessionfailure-title": "Seansiviga",
        "sessionfailure": "Sinu sisselogimisseansiga näib probleem olevat.\nSee toiming on seansiärandamise vastase ettevaatusabinõuna tühistatud.\nMine tagasi eelmisele leheküljele ja taaslaadi see, seejärel proovi uuesti.",
        "changecontentmodel": "Lehekülje sisumudeli muutmine",
        "changecontentmodel-success-text": "Lehekülje [[:$1]] sisumudel on muudetud.",
        "changecontentmodel-cannot-convert": "Lehekülje [[:$1]] sisumudelit ei saa teisendada tüübiks $2.",
        "changecontentmodel-nodirectediting": "Sisumudel $1 ei võimalda otseredigeerimist.",
+       "changecontentmodel-emptymodels-title": "Sisumudeleid pole saadaval",
+       "changecontentmodel-emptymodels-text": "Lehekülje [[:$1]] sisu ei saa teisendada ühtegi tüüpi mudelisse.",
        "log-name-contentmodel": "Sisumudeli muutmislogi",
        "log-description-contentmodel": "Siin on loetletud lehekülgede sisumudelite muudatused ning leheküljed, mis loodi vaikeväärtusest erineva sisumudeliga.",
+       "logentry-contentmodel-new": "$1 {{GENDER:$2|lõi}} lehekülje $3 vaikeväärtusest erineva sisumudeliga \"$5\"",
        "logentry-contentmodel-change": "$1 {{GENDER:$2|muutis}} lehekülje \"$3\" sisumudeli: \"$4\" → \"$5\"",
        "logentry-contentmodel-change-revertlink": "võta tagasi",
        "logentry-contentmodel-change-revert": "tagasi võetud",
        "proxyblockreason": "Sinu IP-aadress on blokeeritud, sest see on avatud proksi. Palun võta ühendust oma internetiteenuse pakkujaga või tehnilise toega ja teata neile sellest probleemist.",
        "sorbsreason": "Sinu IP-aadress on {{GRAMMAR:genitive|{{SITENAME}}}} kasutatavas DNS-põhises mustas nimekirjas märgitud kui avatud proksi.",
        "sorbs_create_account_reason": "Sinu IP-aadress on {{GRAMMAR:genitive|{{SITENAME}}}} kasutatavas DNS-põhises mustas nimekirjas märgitud kui avatud proksi.\nSa ei saa kasutajakontot luua.",
+       "softblockrangesreason": "Sinu IP-aadressilt ($1) pole anonüümne kaastöö lubatud. Palun logi sisse.",
        "xffblockreason": "X-Forwarded-Fori päises esinev IP-aadress, mis kuulub kas sulle või proksiserverile, mida kasutad, on blokeeritud. Blokeerimise algne põhjus oli: $1",
        "cant-see-hidden-user": "Kasutaja, keda blokeerida üritad, on juba blokeeritud ning peidetud. Kuna sul pole õigust blokeerida kasutajanimesid, peites need avalikkuse eest, ei saa sa selle kasutaja blokeeringut vaadata ega muuta.",
        "ipbblocked": "Sa ei saa teisi blokeerida ega nende blokeeringuid eemaldada, sest oled ise blokeeritud.",
        "lockdbsuccesstext": "Andmebaas on nüüd lukustatud.<br />\nKui sinu hooldustöö on läbi, ära unusta [[Special:UnlockDB|kirjutuspääsu taastada]]!",
        "unlockdbsuccesstext": "Andmebaasi kirjutuspääs on taastatud.",
        "lockfilenotwritable": "Andmebaasi lukufail ei ole kirjutatav.\nAndmebaasi lukustamiseks ja avamiseks peavad veebiserveril olema sellele kirjutusõigused.",
+       "databaselocked": "Andmebaas on juba lukustatud.",
        "databasenotlocked": "Andmebaas ei ole lukustatud.",
        "lockedbyandtime": "(lukustas $1; $2, kell $3)",
        "move-page": "Lehekülje \"$1\" teisaldamine",
        "cant-move-to-user-page": "Sul ei ole õigust teisaldada lehekülge kasutajaleheks (ei käi kasutaja alamlehe kohta).",
        "cant-move-category-page": "Sul pole õigust kategoorialehekülgi teisaldada.",
        "cant-move-to-category-page": "Sul pole õigust teisaldada lehekülge kategoorialeheküljele.",
+       "cant-move-subpages": "Sul pole lubatud alamlehekülgi teisaldada.",
+       "namespace-nosubpages": "Nimeruumis \"$1\" pole alamleheküljed lubatud.",
        "newtitle": "Uus pealkiri:",
        "move-watch": "Jälgi lähte- ja sihtlehekülge",
        "movepagebtn": "Teisalda lehekülg",
        "movelogpagetext": "See logi sisaldab infot lehekülgede teisaldamistest.",
        "movesubpage": "{{PLURAL:$1|Alamlehekülg|Alamleheküljed}}",
        "movesubpagetext": "Selle lehekülje $1 {{PLURAL:$1|alamlehekülg|alamlehekülge}} on kuvatud allpool.",
+       "movesubpagetalktext": "Seonduval aruteluleheküljel on $1 allnäidatud {{PLURAL:$1|alamlehekülg|alamlehekülge}}.",
        "movenosubpage": "Sellel leheküljel pole alamlehekülgi.",
        "movereason": "Põhjus:",
        "revertmove": "taasta",
        "pageinfo-length": "Lehekülje pikkus (baitides)",
        "pageinfo-article-id": "Lehekülje identifikaator",
        "pageinfo-language": "Lehekülje sisu keel",
+       "pageinfo-language-change": "muuda",
        "pageinfo-content-model": "Lehekülje sisumudel",
        "pageinfo-content-model-change": "muuda",
        "pageinfo-robot-policy": "Robotindekseering",
        "log-show-hide-patrol": "$1 kontrollimislogi",
        "log-show-hide-tag": "$1 märgiste logi",
        "confirm-markpatrolled-button": "Sobib",
+       "confirm-markpatrolled-top": "Kas märgid lehekülje $2 redaktsiooni $3 kontrollituks?",
        "deletedrevision": "Kustutatud vanem versioon $1",
        "filedeleteerror-short": "Tõrge faili kustutamisel: $1",
        "filedeleteerror-long": "Faili kustutamisel esines tõrkeid:\n\n$1",
        "exif-photometricinterpretation-0": "Mustvalge (valge on 0)",
        "exif-photometricinterpretation-1": "Mustvalge (must on 0)",
        "exif-photometricinterpretation-3": "Palett",
+       "exif-photometricinterpretation-4": "Läbipaistvusmask",
        "exif-photometricinterpretation-5": "Eraldatud (arvatavasti CMYK)",
        "exif-photometricinterpretation-9": "CIE L*a*b* (ICC kodeering)",
        "exif-photometricinterpretation-10": "CIE L*a*b* (ITU kodeering)",
        "confirmemail_body_set": "Keegi IP-aadressilt $1, arvatavasti sina ise, on {{GRAMMAR:genitive|{{SITENAME}}}} konto \"$2\" e-posti aadressiks määranud selle aadressi.\n\nKinnitamaks, et see konto kuulub tõesti sulle ja et aktiveerida e-posti teenused, ava võrgulehitsejas järgmine link:\n\n$3\n\nKui konto *ei* kuulu sulle, kasuta e-posti aadressi kinnituse tühistamiseks järgmist linki:\n\n$5\n\nSelle kinnituskoodi aegumistähtaeg on $4.",
        "confirmemail_invalidated": "E-posti aadressi kinnitamine tühistati",
        "invalidateemail": "E-posti aadressi kinnituse tühistamine",
+       "notificationemail_subject_changed": "{{GRAMMAR:inessive|{{SITENAME}}}} registreeritud e-posti aadress on muudetud",
+       "notificationemail_subject_removed": "{{GRAMMAR:inessive|{{SITENAME}}}} registreeritud e-posti aadress on eemaldatud",
+       "notificationemail_body_changed": "Keegi IP-aadressilt $1, arvatavasti sina ise,\nmuutis {{GRAMMAR:inessive|{{SITENAME}}}} konto \"$2\" e-posti aadressiks \"$3\".\n\nKui see ei olnud sina, siis võta viivitamata ühendust saidi administraatoriga.",
+       "notificationemail_body_removed": "Keegi IP-aadressilt $1, arvatavasti sina ise,\neemaldas {{GRAMMAR:inessive|{{SITENAME}}}} konto \"$2\" e-posti aadressi.\n\nKui see ei olnud sina, siis võta viivitamata ühendust saidi administraatoriga.",
        "scarytranscludedisabled": "[Vikidevaheline mallina kasutamine on keelatud]",
        "scarytranscludefailed": "[Malli $1 hankimine ebaõnnestus]",
        "scarytranscludefailed-httpstatus": "[Malli $1 hankimine ebaõnnestus: HTTP $2]",
        "confirm-unwatch-button": "Sobib",
        "confirm-unwatch-top": "Kas eemaldad selle lehekülje oma jälgimisloendist?",
        "confirm-rollback-button": "Sobib",
+       "confirm-rollback-top": "Kas tühistad sellel leheküljel tehtud muudatused?",
        "quotation-marks": "\"$1\"",
        "imgmultipageprev": "← eelmine lehekülg",
        "imgmultipagenext": "järgmine lehekülg →",
        "watchlisttools-edit": "vaata ja redigeeri jälgimisloendit",
        "watchlisttools-raw": "redigeeri jälgimisloendi toorandmeid",
        "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|arutelu]])",
+       "timezone-local": "Kohalik",
        "duplicate-defaultsort": "'''Hoiatus:''' Järjestamisvõti \"$2\" tühistab eespool oleva järjestamisvõtme \"$1\".",
        "duplicate-displaytitle": "<strong>Hoiatus:</strong> Kuvatava pealkirjaga \"$2\" kirjutatakse üle varasem kuvatav pealkiri \"$1\".",
+       "restricted-displaytitle": "<strong>Hoiatus:</strong> Kuvapealkirja \"$1\" eirati, sest see ei vasta lehekülje tegelikule pealkirjale.",
        "invalid-indicator-name": "<strong>Tõrge:</strong> Lehekülje olekunäidu juures ei tohi atribuudi <code>name</code> väärtus puududa.",
        "version": "Versioon",
        "version-extensions": "Paigaldatud lisad",
        "redirect-page": "Lehekülje identifikaator",
        "redirect-revision": "Lehekülje redaktsioon",
        "redirect-file": "Failinimi",
+       "redirect-logid": "Logi identifikaator",
        "redirect-not-exists": "Väärtust ei leitud",
        "fileduplicatesearch": "Faili duplikaatide otsimine",
        "fileduplicatesearch-summary": "Otsi duplikaatfaile nende räsiväärtuse järgi.",
        "tags-delete-not-found": "Märgist \"$1\" pole.",
        "tags-delete-too-many-uses": "Märgist \"$1\" on rakendatud rohkem kui {{PLURAL:$2|ühe|$2}} redaktsiooni juures, mistõttu ei saa seda kustutada.",
        "tags-delete-warnings-after-delete": "Märgis \"$1\" on kustutatud, kuid väljastati {{PLURAL:$2|järgmine hoiatus|järgmised hoiatused}}:",
+       "tags-delete-no-permission": "Sul pole lubatud muudatusmärgiseid kustutada.",
        "tags-activate-title": "Märgise lubamine",
        "tags-activate-question": "Siinkohal lubad märgise \"$1\".",
        "tags-activate-reason": "Põhjus:",
        "htmlform-cloner-create": "Lisa veel",
        "htmlform-cloner-delete": "Eemalda",
        "htmlform-cloner-required": "Vähemalt üks väärtus on nõutav.",
+       "htmlform-date-placeholder": "AAAA-KK-PP",
+       "htmlform-time-placeholder": "TT:MM:SS",
+       "htmlform-datetime-placeholder": "AAAA-KK-PP TT:MM:SS",
        "htmlform-title-badnamespace": "[[:$1]] pole nimeruumis \"{{ns:$2}}\".",
        "htmlform-title-not-creatable": "Pealkirja \"$1\" all ei saa lehekülge alustada.",
        "htmlform-title-not-exists": "Lehekülge $1 pole olemas.",
index d1218e1..f9eb200 100644 (file)
        "userrights-user-editname": "Erabiltzaile izena idatzi:",
        "editusergroup": "Erabiltzaile taldeak kargatu",
        "editinguser": "<strong>[[User:$1|$1]]</strong> $2 {{GENDER:$1|lankidearen}} erabiltzaile-eskubideak aldatzen",
-       "userrights-editusergroup": "Erabiltzaile taldeak editatu",
+       "userrights-editusergroup": "{{GENDER:$1|Erabiltzaile}} taldeak editatu",
        "saveusergroups": "Erabiltzaile {{GENDER:$1|taldeak}} gorde",
        "userrights-groupsmember": "Ondorengo talde honetako kide da:",
        "userrights-groupsmember-auto": "Honen kide inplizitua:",
-       "userrights-groups-help": "Lankide hau zein taldetakoa den alda dezakezu:\n* Laukia hautatuta baldin badago, esan nahi du lankidea talde horretakoa dela.\n* Laukia hautatu gabe baldin badago, esan nahi du lankidea talde horretakoa ez dela.\n* Izartxoak (*) erakusten du ezin duzula talde horretatik kendu, taldera gehitu eta gero; edo alderantziz, ezin duzula talde horretara gehitu, taldetik kendu eta gero.",
+       "userrights-groups-help": "Lankide hau zein taldetakoa den alda dezakezu:\n* Laukia hautatuta baldin badago, esan nahi du lankidea talde horretakoa dela.\n* Laukia hautatu gabe baldin badago, esan nahi du lankidea talde horretakoa ez dela.\n* Izartxoak (*) erakusten du ezin duzula talde horretatik kendu, taldera gehitu eta gero; edo alderantziz, ezin duzula talde horretara gehitu, taldetik kendu eta gero.\n* Traolak (#) erakusten du taldearen iraungipen data luzatu egin dezakezula soilik; ez ordea aurreratu.",
        "userrights-reason": "Arrazoia:",
        "userrights-no-interwiki": "Ez duzu beste wikietan erabiltzaile eskumenak aldatzeko baimenik.",
        "userrights-nodatabase": "$1 datubasea ez da existitzen edo ez dago lokalki.",
        "rcfilters-filtergroup-authorship": "Edizioaren egiletza",
        "rcfilters-filter-bots-label": "Bot",
        "rcfilters-filter-minor-label": "Aldaketa txikiak",
-       "rcnotefrom": "Jarraian azaltzen diren aldaketak data honetatik aurrerakoak dira: <b>$2</b> (gehienez <b>$1</b> erakusten dira).",
+       "rcnotefrom": "Jarraian azaltzen diren {{PLURAL:$5|aldaketak}} data honetatik aurrerakoak dira: <strong>$3,$4</strong> (gehienez <b>$1</b> erakusten dira).",
        "rclistfrom": "Erakutsi $3 $2 ondorengo aldaketa berriak",
        "rcshowhideminor": "$1 aldaketa txikiak",
        "rcshowhideminor-show": "Erakutsi",
        "emailccsubject": "Zure mezuaren kopia $1(r)i: $2",
        "emailsent": "Mezua bidali egin da",
        "emailsenttext": "Zure e-posta mezua bidali egin da.",
-       "emailuserfooter": "E-posta hau $1(e)k {{GENDER:$1|bidali}} dio {{GENDER:$2|$2}}(r)i {{SITENAME}}ko \"{{int:emailuser}}\" funtzioa erabiliz.",
+       "emailuserfooter": "E-posta hau $1(e)k {{GENDER:$1|bidali}} dio {{GENDER:$2|$2}}(r)i {{SITENAME}}ko \"{{int:emailuser}}\" funtzioa erabiliz. Email honi erantzuten {{GENDER:$2|badiozu}}, zure emaila zuzenean jatorrizko {{GENDER:$1|igorleari}} bidaliko zaio eta {{GENDER:$1|harentzat}} {{GENDER:$2|zure}} email helbidea ikusgai geratuko da.",
        "usermessage-summary": "Sistema mezua uzten.",
        "usermessage-editor": "Sistemako mezularia",
        "watchlist": "Jarraipen zerrenda",
        "addedwatchtext": "\"[[:$1]]\" eta haren eztabaida orria zure [[Special:Watchlist|jarraipen zerrendara]] erantsi da. \n\nOrri honetan aurrerantzean egindako aldaketak zerrenda horretan agertuko dira.",
        "addedwatchtext-short": "$1 orria zure jarraipen zerrendara gehitu da.",
        "removewatch": "Kendu zure jarraipen zerrendatik",
-       "removedwatchtext": "\"[[:$1]]\" orrialdea zure [[Special:Watchlist|jarraipen zerrendatik]] kendu da.",
+       "removedwatchtext": "\"[[:$1]]\" eta haren eztabaida orrialdea zure [[Special:Watchlist|jarraipen zerrendatik]] kendu da.",
        "removedwatchtext-short": "$1 orria zure jarraipen zerrendatik ezabatu da.",
        "watch": "Jarraitu",
        "watchthispage": "Orrialde hau jarraitu",
index 0d1ec60..ad00b86 100644 (file)
        "recentchanges-legend-plusminus": "(''±123'')",
        "recentchanges-submit": "Näytä",
        "rcfilters-activefilters": "Aktiiviset suodattimet",
+       "rcfilters-clear-all-filters": "Tyhjennä kaikki suodattimet",
+       "rcfilters-search-placeholder": "Suodattimen viimeaikaiset muutokset (selaa tai aloita kirjoittaa)",
        "rcfilters-invalid-filter": "Suodatin on epäkelpo",
+       "rcfilters-empty-filter": "Ei aktiivisia suodattimia. Kaikki muutokset näytetään.",
        "rcfilters-filterlist-title": "Suodattimet",
        "rcfilters-filterlist-noresults": "Ei löytynyt suodattimia",
        "rcfilters-filter-registered-label": "Rekisteröitynyt",
        "rcfilters-filter-editsbyother-label": "Muiden muokkaukset",
        "rcfilters-filter-editsbyother-description": "Muutokset jotka tehneet muut käyttäjät (et sinä).",
        "rcfilters-filter-userExpLevel-newcomer-label": "Tulokkaat",
+       "rcfilters-filter-userExpLevel-learner-label": "Oppijat",
+       "rcfilters-filter-userExpLevel-experienced-label": "Kokeneet käyttäjät",
+       "rcfilters-filter-userExpLevel-experienced-description": "Enemmän kuin 30 päivää aktiivisena ja 500 muokkausta.",
+       "rcfilters-filtergroup-automated": "Automatisoidut muutokset",
        "rcfilters-filter-bots-label": "Botti",
        "rcfilters-filter-bots-description": "Muokkaukset jotka tehty automaattisilla työkaluilla.",
        "rcfilters-filter-humans-label": "Ihminen (ei botti)",
        "rcfilters-filter-minor-label": "Pienet muutokset",
+       "rcfilters-filter-pageedits-label": "Sivun muokkaukset",
        "rcfilters-filter-newpages-description": "Muokkaukset jotka luovat uusia sivuja.",
        "rcfilters-filter-categorization-label": "Luokkamuutokset",
+       "rcfilters-filter-logactions-label": "Kirjatut toimet",
        "rcnotefrom": "Alla ovat muutokset <strong>$3, $4</strong> lähtien. (Enintään <strong>$1</strong> näytetään.)",
        "rclistfrom": "Näytä uudet muutokset $3 kello $2 alkaen",
        "rcshowhideminor": "$1 pienet muutokset",
        "booksources-invalid-isbn": "Annettu ISBN-numero ei ole kelvollinen. Tarkista alkuperäisestä lähteestä kirjoitusvirheiden varalta.",
        "magiclink-tracking-rfc": "Sivut, jotka käyttävät RFC-taikalinkkejä",
        "magiclink-tracking-pmid": "Sivut, jotka käyttävät PMID-taikalinkkejä",
-       "magiclink-tracking-isbn": "Sivut, joissa käytetään ISBN-taikalinkkejä",
+       "magiclink-tracking-isbn": "Sivut, jotka käyttävät ISBN-taikalinkkejä",
        "specialloguserlabel": "Suorittaja:",
        "speciallogtitlelabel": "Kohde (sivu tai {{ns:user}}:käyttäjänimi):",
        "log": "Lokit",
index adede88..a0af1f9 100644 (file)
        "spamprotectionmatch": "Naš filtar spama reagirao je na sljedeći tekst: $1",
        "spambot_username": "MediaWiki zaštita od spama",
        "spam_reverting": "Vraćam na posljednju inačicu koja ne sadrži poveznice na $1",
-       "spam_blanking": "Sve inačice sadrže poveznice na $1, brišem cjelokupni sadržaj",
+       "spam_blanking": "Sve inačice koje sadržavaju poveznice na $1, brišem cjelokupni sadržaj",
        "spam_deleting": "Sve inačice sadržale su poveznice na $1, brišem cjelokupni sadržaj",
        "simpleantispam-label": "Anti-spam provjera.\n<strong>NE</strong> ispunjavajte ovo!",
        "pageinfo-title": "Podatci o stranici \"$1\"",
        "markedaspatrollederror-noautopatrol": "Ne možete vlastite promjene označiti patroliranima.",
        "markedaspatrollednotify": "Uređivanje stranice $1 označeno je pregledanim.",
        "markedaspatrollederrornotify": "Označavanje stranice pregledanom nije uspjelo.",
-       "patrol-log-page": "Evidencija pregledavanja promjena",
+       "patrol-log-page": "Evidencija ophodnji i samoophodnji",
        "patrol-log-header": "Ovo su evidencije ophođenih izmjena.",
-       "log-show-hide-patrol": "$1 evidenciju patroliranja",
+       "log-show-hide-patrol": "$1 evidenciju ophodnji",
+       "log-show-hide-tag": "$1 evidenciju oznaka",
        "confirm-markpatrolled-button": "U redu",
        "confirm-markpatrolled-top": "Označiti izmjenu $3 stranice $2 pregledanom?",
        "deletedrevision": "izbrisana stara inačica $1",
        "tag-mw-contentmodelchange": "promjena modela sadržaja",
        "tag-mw-contentmodelchange-description": "Uređivanja koja [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:ChangeContentModel mijenjanju model sadržaja] stranice",
        "tags-title": "Oznake",
-       "tags-intro": "Ova je stranica popis oznaka s kojima softver može označiti promjenu te njihovo značenje.",
+       "tags-intro": "Ova stranica sadržava popis oznaka s kojima programska oprema može označivati promjene te njihova značenja.",
        "tags-tag": "Naziv oznake",
        "tags-display-header": "Izgled na popisima izmjena",
        "tags-description-header": "Puni opis značenja",
        "tags-active-header": "Aktivno?",
        "tags-hitcount-header": "Označene izmjene",
        "tags-actions-header": "Radnje",
-       "tags-active-yes": "Da",
-       "tags-active-no": "Ne",
+       "tags-active-yes": "da",
+       "tags-active-no": "ne",
        "tags-source-extension": "Definirano proširenjem",
        "tags-source-none": "Nije više u uporabi",
        "tags-edit": "uredi",
        "tags-delete": "izbriši",
        "tags-activate": "pokreni",
        "tags-deactivate": "isključi",
-       "tags-hitcount": "$1 {{PLURAL:$1|promjena|promjene|promjena}}",
+       "tags-hitcount": "$1 {{PLURAL:$1|izmjena|izmjene|izmjena}}",
        "tags-manage-no-permission": "Nemate pravo upravljati promjenama oznaka.",
        "tags-create-heading": "Stvori novu oznaku",
        "tags-create-tag-name": "Naziv oznake:",
index cd7e0f6..b8e207c 100644 (file)
        "mw-widgets-titleinput-description-new-page": "pagina non existe ancora",
        "mw-widgets-titleinput-description-redirect": "redirection a $1",
        "mw-widgets-categoryselector-add-category-placeholder": "Adder un categoria…",
+       "mw-widgets-usersmultiselect-placeholder": "Adder plus...",
        "sessionmanager-tie": "Impossibile combinar plure typos de authentication de requesta: $1.",
        "sessionprovider-generic": "sessiones $1",
        "sessionprovider-mediawiki-session-cookiesessionprovider": "sessiones basate sur cookies",
index 78d0e07..edcea57 100644 (file)
        "youremail": "이메일:",
        "username": "{{GENDER:$1|사용자 이름}}:",
        "prefs-memberingroups": "{{GENDER:$2|소속}} {{PLURAL:$1|그룹}}:",
+       "group-membership-link-with-expiry": "$1 ($2 까지)",
        "prefs-registration": "등록 시간:",
        "yourrealname": "실명:",
        "yourlanguage": "언어:",
        "emailccsubject": "$1에게 보낸 메시지의 복사본: $2",
        "emailsent": "이메일 보냄",
        "emailsenttext": "이메일을 보냈습니다.",
-       "emailuserfooter": "이 이메일은 {{SITENAME}}의 $1님이 $2에게 \"{{int:emailuser}}\" 기능을 통해 보냈습니다.",
+       "emailuserfooter": "이 이메일은 {{SITENAME}}의 $1님이 $2에게 \"{{int:emailuser}}\" 기능을 통해 보냈습니다. 만약, {{GENDER:$2|당신}}이 이 이메일을 답장하면, {{GENDER:$2|당신}}의 이메일은 {{GENDER:$1|원래 사용자}}에게 {{GENDER:$2|당신}}의 이메일 주소가  {{GENDER:$1|원래 사용자}}에게 공개되면서 보내집니다.",
        "usermessage-summary": "시스템 메시지 남기기",
        "usermessage-editor": "시스템 메신저",
        "usermessage-template": "MediaWiki:UserMessage",
        "usercssispublic": "주목해 주십시오: CSS의 하위 문서들은 다른 사용자들이 볼 수 있기 때문에 기밀 데이터를 포함해서는 안 됩니다.",
        "restrictionsfield-badip": "유효하지 않은 IP 주소나 대역: $1",
        "restrictionsfield-label": "허용된 IP 대역:",
-       "restrictionsfield-help": "줄 단위의 하나의 IP 주소 또는 CIDR 대역입니다. 모든 곳에 적용하려면, 다음을 사용하세요<br><code>0.0.0.0/0</code><br><code>::/0</code>",
+       "restrictionsfield-help": "줄 단위의 하나의 IP 주소 또는 CIDR 대역입니다. 모든 곳에 적용하려면, 다음을 사용하세요:<pre>0.0.0.0/0\n::/0</pre>",
        "revid": "$1 판",
        "pageid": "페이지 ID $1"
 }
index d105b06..0487ba3 100644 (file)
        "search-interwiki-caption": "Søsterprosjekter",
        "search-interwiki-default": "Resultater fra $1:",
        "search-interwiki-more": "(mer)",
+       "search-interwiki-more-results": "flere resultater",
        "search-relatedarticle": "Relatert",
        "searchrelated": "relatert",
        "searchall": "alle",
        "editusergroup": "Last brukergrupper",
        "editinguser": "Endrer brukerrettighetene for {{GENDER:$1|bruker}} <strong>[[User:$1|$1]]</strong> $2",
        "viewinguserrights": "Viser {{GENDER:$1|brukerrettighetene}} til  <strong>[[User:$1|$1]]</strong> $2",
-       "userrights-editusergroup": "Rediger brukergrupper",
-       "userrights-viewusergroup": "Se brukergrupper",
+       "userrights-editusergroup": "Rediger {{GENDER:$1|brukergrupper}}",
+       "userrights-viewusergroup": "Se {{GENDER:$1|brukergrupper}}",
        "saveusergroups": "Lagre {{GENDER:$1|brukergrupper}}",
        "userrights-groupsmember": "Medlem av:",
        "userrights-groupsmember-auto": "Implisitt medlem av:",
-       "userrights-groups-help": "Du kan endre hvilke grupper denne brukeren er medlem av.\n* En avkrysset boks betyr at brukeren er medlem av gruppen.\n* En uavkrysset boks betyr at brukeren ikke er medlem av gruppen.\n* En * betyr at du ikke kan fjerne gruppemedlemskapet når du har lagt det til, eller vice versa.",
+       "userrights-groups-help": "Du kan endre hvilke grupper denne brukeren er medlem av.\n* En avkrysset boks betyr at brukeren er medlem av gruppen.\n* En uavkrysset boks betyr at brukeren ikke er medlem av gruppen.\n* En * betyr at du ikke kan fjerne gruppemedlemskapet når du har lagt det til, eller vice versa.\n* En # betyr at du kun kan forkorte utløpstiden til denne gruppen, du kan ikke forlenge den.",
        "userrights-reason": "Årsak:",
        "userrights-no-interwiki": "Du har ikke tillatelse til å endre brukerrettigheter på andre wikier.",
        "userrights-nodatabase": "Databasen $1 finnes ikke, eller er ikke lokal.",
        "userrights-expiry-options": "1 dag:1 day,1 uke:1 week,1 måned:1 month,3 måneder:3 months,6 måneder:6 months,1 år:1 year",
        "userrights-invalid-expiry": "Utløpstiden for gruppa «$1» er ugyldig.",
        "userrights-expiry-in-past": "Utløpstiden for gruppa «$1» har vært.",
+       "userrights-cannot-shorten-expiry": "Du kan ikke forlenge utløpstiden til gruppa «$1». Bare brukere med tillatelse til å legge til eller fjerne denne gruppa kan forlenge utløpstider.",
        "userrights-conflict": "En konflikt med endringen av brukerrettigheter! Vær vennlig å sjekke og på nytt bekrefte endringene dine.",
        "group": "Gruppe:",
        "group-user": "Brukere",
        "mw-widgets-titleinput-description-new-page": "siden eksisterer ikke ennå",
        "mw-widgets-titleinput-description-redirect": "omdiriger til $1",
        "mw-widgets-categoryselector-add-category-placeholder": "Legg til en kategori …",
+       "mw-widgets-usersmultiselect-placeholder": "Legg til flere ...",
        "sessionmanager-tie": "Kan ikke kombinere flere forespørselsautentiseringstyper: $1",
        "sessionprovider-generic": "$1 sesjoner",
        "sessionprovider-mediawiki-session-cookiesessionprovider": "informasjons&shy;kapsel-baserte sesjoner",
index c3f20c9..cf8d82b 100644 (file)
        "limitreport-cputime": "CPU-tidsbruk",
        "limitreport-cputime-value": "{{PLURAL:$1|eitt sekund|$1 sekund}}",
        "limitreport-walltime-value": "{{PLURAL:$1|eitt sekund|$1 sekund}}",
-       "limitreport-ppvisitednodes": "Nodevitjingar av preprosessor",
+       "limitreport-ppvisitednodes": "Nodar vitja av preprosessor",
        "limitreport-ppgeneratednodes": "Nodar laga av preprosessor",
        "limitreport-postexpandincludesize": "Inkluderingsstorleik etter utviding",
        "limitreport-postexpandincludesize-value": "$1/$2 byte",
index e26610f..da09ef1 100644 (file)
        "october": "d'octobre",
        "november": "de novembre",
        "december": "de decembre",
-       "january-gen": "Genièr",
-       "february-gen": "Febrièr",
-       "march-gen": "Març",
+       "january-gen": "de genièr",
+       "february-gen": "de febrièr",
+       "march-gen": "de març",
        "april-gen": "Abril",
-       "may-gen": "Mai",
-       "june-gen": "Junh",
-       "july-gen": "Julhet",
+       "may-gen": "de mai",
+       "june-gen": "de junh",
+       "july-gen": "de julhet",
        "august-gen": "d'agost",
-       "september-gen": "Setembre",
+       "september-gen": "de setembre",
        "october-gen": "Octobre",
-       "november-gen": "Novembre",
-       "december-gen": "Decembre",
+       "november-gen": "de novembre",
+       "december-gen": "de decembre",
        "jan": "de gen",
        "feb": "de feb",
        "mar": "de març",
        "internalerror_info": "Error intèrna: $1",
        "internalerror-fatal-exception": "Error fatala de tipe \"$1\"",
        "filecopyerror": "Impossible de copiar lo fichièr « $1 » cap a « $2 ».",
-       "filerenameerror": "Impossible de tornar nomenar lo fichièr « $1 » en « $2 ».",
+       "filerenameerror": "Impossible de renomenar lo fichièr « $1 » en « $2 ».",
        "filedeleteerror": "Impossible de suprimir lo fichièr « $1 ».",
        "directorycreateerror": "Impossible de crear lo dorsièr « $1 ».",
        "directoryreadonlyerror": "Lo repertòri « $1 » es en lectura sola.",
        "no-null-revision": "Impossible de crear una novèla revision voida per la pagina « $1 »",
        "badtitle": "Títol marrit",
        "badtitletext": "Lo títol de la pagina demandada es invalid, void o s’agís d’un títol interlenga o interprojècte mal ligat. Benlèu conten un o maites caractèrs que pòdon pas èsser utilizats dins los títols.",
-       "title-invalid-talk-namespace": "La pagina de títol demandada fa referéncia a una pagina de discussion qu'existís pas.",
-       "title-invalid-characters": "La pagina de títol demandada contèn de caractèrs invalides : $1",
+       "title-invalid-talk-namespace": "Lo títol de la pagina demandada fa referéncia a una pagina de discussion que pòt pas existir.",
+       "title-invalid-characters": "Lo títol  de la pagina demandada conten de caractèrs invalids : « $1 ».",
        "perfcached": "Las donadas seguendas son en cache e benlèu, son pas a jorn. Un maximum de {{PLURAL:$1|un resultat|$1 resultats}} es disponible dins lo cache.",
        "perfcachedts": "Las donadas seguendas son en cache e benlèu, son pas a jorn. Un maximum de {{PLURAL:$1|un resultat|$1 resultats}} es disponible dins lo cache.",
        "querypage-no-updates": "Las mesas a jorn per aquesta pagina son actualamnt desactivadas. Las donadas çaijós son pas mesas a jorn.",
        "changepassword-throttled": "Avètz ensajat un tròp grand nombre de connexions darrièrament.\nEsperatz $1 abans d’ensajar tornarmai.",
        "botpasswords": "Senhals de robòts",
        "botpasswords-disabled": "Los senhals robòts son desactivats.",
-       "botpasswords-no-central-id": "Per intrar lo senhau d'un bot, devètz èsser connectat amb un còmpte globau.",
+       "botpasswords-no-central-id": "Per utilizar los senhals de robòts, vos cal èsser connectat a un compte centralizat.",
        "botpasswords-existing": "Senhals de robòts existents",
-       "botpasswords-createnew": "Crear un novèu senhau de bot",
-       "botpasswords-editexisting": "Editar un senhau de bot existent",
+       "botpasswords-createnew": "Crear un novèl senhal de robòts",
+       "botpasswords-editexisting": "Modificar un senhal de robòts existent",
        "botpasswords-label-appid": "Nom del robòt :",
        "botpasswords-label-create": "Crear",
        "botpasswords-label-update": "Metre a jorn",
        "botpasswords-label-grants-column": "Acordat",
        "botpasswords-bad-appid": "Lo nom del robòt «$1» es pas valid.",
        "botpasswords-insert-failed": "Fracàs de l’apondon del nom de robòt « $1 ». Es ja estat apondut ?",
-       "botpasswords-created-title": "Senhau de bot creat",
-       "botpasswords-created-body": "Lo senhau dau bot per lo bot $1 de l'utilizaire $2 es estat creat",
-       "botpasswords-updated-title": "Senhau dau bot més a jorn",
-       "botpasswords-updated-body": "Lo senhau dau bot $1 de l'utilizaire $2 es estat més a jorn",
-       "botpasswords-deleted-title": "Senhau dau bot escafat",
-       "botpasswords-deleted-body": "Lo senhay dau bot $1 de l'utilizaire $2 es estat escafat",
+       "botpasswords-created-title": "Senhal de robòts creat",
+       "botpasswords-created-body": "Lo senhal pel robòt « $1 » de l'utilizaire « $2 » es estat creat.",
+       "botpasswords-updated-title": "Senhal de robòts mes a jorn",
+       "botpasswords-updated-body": "Lo senhal pel robòt « $1 » de l'utilizaire « $2 » es estat mes a jorn.",
+       "botpasswords-deleted-title": "Senhal de robòts suprimit",
+       "botpasswords-deleted-body": "Lo senhal pel robòt « $1 » de l'utilizaire « $2 » es estat suprimit.",
        "botpasswords-no-provider": "BotPasswordsSessionProvider es pas disponible",
        "resetpass_forbidden": "Los senhals pòdon pas èsser cambiats",
-       "resetpass_forbidden-reason": "Lei senhaus pòdon pas èsser cambiats : $1",
+       "resetpass_forbidden-reason": "Los senhaus pòdon pas èsser cambiats : $1",
        "resetpass-no-info": "Vos cal èsser connectat per aver accès a aquesta pagina.",
        "resetpass-submit-loggedin": "Modificar lo senhal",
        "resetpass-submit-cancel": "Anullar",
        "passwordreset-emailtext-ip": "Qualqu'un (probablament vos, dempuèi l'adreça IP $1) a demandat una reïnicializacion de vòstre senhal per {{SITENAME}} ($4). {{PLURAL:$3|Lo compte d'utilizaire seguent es associat|Los comptes d'utilizaires seguents son associats}} a aquesta adreça de corrièr electronic :\n\n$2\n\n{{PLURAL:$3|Aqueste senhal temporari expirarà|Aquestes senhals temporaris expiraràn}} dins {{PLURAL:$5|un jorn|$5 jorns}}. Ara, vos cal vos connectar e causir un senhal novèl. Se aquesta demanda proven pas de vos, o que vos sètz remembrat de vòstre senhal inicial, e que volètz pas mai lo modificar, podètz ignorar aqueste messatge e contunhar d'utilizar vòstre ancian senhal.",
        "passwordreset-emailtext-user": "L'utilizaire $1 sus {{SITENAME}} a demandat una reïnicializacion de vòstre senhal per {{SITENAME}} ($4). {{PLURAL:$3|Lo compte d'utilizaire seguent es associat|Los comptes d'utilizaires seguents son associats}} a aquesta adreça de corrièr electronic :\n\n$2\n\n{{PLURAL:$3|Aqueste senhal temporari expirarà|Aquestes senhals temporaris expiraràn}} dins {{PLURAL:$5|un jorn|$5 jorns}}. Ara, vos cal vos connectar e causir un senhal novèl. Se aquesta demanda proven pas de vos, o que vos sètz remembrat de vòstre senhal inicial, e que lo volètz pas mai modificar, podètz ignorar aqueste messatge e contunhar d'utilizar vòstre ancian senhal.",
        "passwordreset-emailelement": "Utilizaire: \n$1\n\nSenhal temporari: \n$2",
-       "passwordreset-emailsentemail": "Se aquela adreiça de corrièr electrnic es associat ambé vòstre compte, un corrièr electronic de reïnicializacion de senhal es estat mandat.",
-       "passwordreset-emailsentusername": "Se una adreiça de corrier electronic es associada amb aqueu còmpte d'utilizaire, un senhau de reïnicializacion serà mandat.",
+       "passwordreset-emailsentemail": "Se aquesta adreça de corrièl es associada a vòstre compte, alara un corrièl de reïnicializacion de senhal serà mandat.",
+       "passwordreset-emailsentusername": "Se i a una adreça de corrièr electronic associada a aqueste nom d’utilizaire, alara un corrièl de reïnicializacion senhal serà mandat.",
        "passwordreset-nosuchcaller": "L’apelant existís pas : $1",
-       "passwordreset-invalidemail": "Adreiça electronica invalida",
+       "passwordreset-invalidemail": "Adreça de corrièr electronic invalida",
        "changeemail": "Cambiar o suprimir l'adreça electronica",
        "changeemail-header": "Cambiar l'adreça electronica del compte",
        "changeemail-no-info": "Vos cal èsser connectat per aver accès a aquesta pagina.",
        "search-interwiki-caption": "Projèctes fraires",
        "search-interwiki-default": "Resultats de $1 :",
        "search-interwiki-more": "(mai)",
+       "search-interwiki-more-results": "mai de resultats",
        "search-relatedarticle": "Relatat",
        "searchrelated": "relatat",
        "searchall": "Totes",
        "showingresultsinrange": "Afichar çaijós fins a {{PLURAL:$1|<strong>1</strong> resultat|<strong>$1</strong> resultats}} dins la seria #<strong>$2</strong> a #<strong>$3</strong>.",
        "search-showingresults": "{{PLURAL:$4|Resultat <strong>$1</strong> demest <strong>$3</strong>|Resultats <strong>$1 a $2</strong> demest <strong>$3</strong>}}",
        "search-nonefound": "I a pas cap de resultat correspondent a la requèsta.",
+       "search-nonefound-thiswiki": "I a pas de resultats que correspondon a la requèsta sus aqueste site.",
        "powersearch-legend": "Recèrca avançada",
        "powersearch-ns": "Recercar dins los espacis de nom :",
        "powersearch-togglelabel": "Marcar :",
        "youremail": "Adreça de corrièr electronic :",
        "username": "{{GENDER:$1|Nom d'utilizaire|Nom d'utilizaira}}:",
        "prefs-memberingroups": "{{GENDER:$2|Membre|Membra}} {{PLURAL:$1|del grop|dels gropes}}:",
+       "group-membership-link-with-expiry": "$1 (fins a $2)",
        "prefs-registration": "Data de creacion del compte :",
        "yourrealname": "Nom vertadièr :",
        "yourlanguage": "Lenga de l'interfàcia :",
        "email": "Corrièr electronic",
        "prefs-help-realname": "Lo nom vertadièr es facultatiu.\nSe l'especificatz, serà utilizat per vos atribuir vòstras contribucions.",
        "prefs-help-email": "L’adreça de corrièr electronic es facultativa mas vos permet de reçaupre lo senhal se lo doblidatz.\nTanben podètz causir de permetre a d’autres de vos contactar per vòstra pagina d’utilizaire o la de discussion sens sofracha de desvelar vòstra idenditat.",
-       "prefs-help-email-others": "Tanben podètz causir de daissar los autres vos contactar sus vòstra pagina de discussion d'utilizaire sens que siá necessari de revelar vòstra identitat.",
+       "prefs-help-email-others": "Tanben podètz causir de daissar los autres vos contactar per corrièl via un ligam sus vòstra pagina de discussion d'utilizaire o pagina d'utilizaire.\nVòstra adreça de corrièr electronic es pas revelada quand los utilizaires vos contactan.",
        "prefs-help-email-required": "Una adreça de corrièr electronic es requesa.",
        "prefs-info": "Informacion de basa",
        "prefs-i18n": "Internationalizacion",
        "userrights-expiry": "Data d’expiracion :",
        "userrights-expiry-existing": "Data d'expiracion existenta : $2 à $3",
        "userrights-expiry-othertime": "Autre temps :",
+       "userrights-expiry-options": "1 jorn:1 day,1 setmana:1 week,1 mes:1 month,3 meses:3 months,6 meses:6 months,1 an:1 year",
        "userrights-conflict": "Conflicte de modificacion de dreits d'utilizaire ! Relegissètz e confirmatz vòstras modificacions.",
        "group": "Grop :",
        "group-user": "Utilizaires",
        "right-minoredit": "Marcar de cambiaments coma menors",
        "right-move": "Renomenar de paginas",
        "right-move-subpages": "Desplaçar de paginas amb lor sospaginas",
-       "right-move-rootuserpages": "Tornar nomenar las paginas de l’utilizaire de banca.",
+       "right-move-rootuserpages": "Renomenar la pagina principala d’un utilizaire",
        "right-move-categorypages": "Renomenar de paginas de categoria",
        "right-movefile": "Desplaçar los fichièrs",
        "right-suppressredirect": "Crear pas de redireccion dempuèi la pagina anciana en renomenant la pagina",
        "grant-group-file-interaction": "Interagir amb de mèdias",
        "grant-group-watchlist-interaction": "Interagir amb vòstra lista de seguiment",
        "grant-group-email": "Mandar un corrièr electronic",
+       "grant-group-customization": "Personalizacion e preferéncias",
+       "grant-group-administration": "Efectuar d'accions administrativas",
+       "grant-group-private-information": "Accedir a vòstras donadas privadas",
+       "grant-group-other": "Activitats divèrsas",
        "grant-blockusers": "Blocar e desblocar d'utilizaires",
        "grant-createaccount": "Crear de comptes",
        "grant-createeditmovepage": "Crear, modificar e desplaçar de paginas",
-       "grant-editpage": "Editar lei paginas existentas",
-       "grant-editprotected": "Editar lei paginas protegidas",
+       "grant-editmyoptions": "Modificar vòstras preferéncias d'utilizaire",
+       "grant-editpage": "Modificar de paginas existentas",
+       "grant-editprotected": "Modificar de paginas protegidas",
        "grant-patrol": "Verificar las modificacions de paginas",
-       "grant-uploadeditmovefile": "Telecargar, remplaçar e desplaçar de fichiers",
-       "grant-uploadfile": "Telecargar un novèu fichier",
+       "grant-privateinfo": "Accedir a las informacions privadas",
+       "grant-sendemail": "Mandar de corriers electronics als autres utilizaires",
+       "grant-uploadeditmovefile": "Telecargar, remplaçar e renomenar de fichièrs",
+       "grant-uploadfile": "Importar de fichièrs novèls",
        "grant-basic": "Dreits de basa",
-       "grant-viewdeleted": "Veire lei fichiers e lei paginas escafats",
+       "grant-viewdeleted": "Afichar los fichièrs e paginas suprimits",
        "grant-viewmywatchlist": "Afichar vòstra lista de seguiment",
        "newuserlogpage": "Istoric de las creacions de comptes",
        "newuserlogpagetext": "Jornal de las creacions de comptes d'utilizaires.",
        "action-history": "afichar l’istoric d'aquesta pagina",
        "action-minoredit": "marcar aqueste cambiament coma menor",
        "action-move": "renomenar aquesta pagina",
-       "action-move-subpages": "tornar nomenar aquesta pagina e sas sospaginas",
+       "action-move-subpages": "renomenar aquesta pagina e sas sospaginas",
        "action-move-rootuserpages": "renomenar las paginas de l’utilizaire de basa.",
        "action-move-categorypages": "Renomenar de paginas de categoria",
        "action-movefile": "renomenar aqueste fichièr",
        "action-writeapi": "utilizar l‘API d’escritura",
        "action-delete": "suprimir aquesta pagina",
        "action-deleterevision": "suprimir las revisions",
-       "action-deletelogentry": "Escafar lo jornau deis intradas",
+       "action-deletelogentry": "suprimir las entradas del jornal",
        "action-deletedhistory": "veire l’istoric suprimit d'una pagina",
        "action-browsearchive": "recercar de paginas suprimidas",
        "action-undelete": "restablir de paginas",
        "action-userrights-interwiki": "modificar los dreits d’utilizaire e los sus d’autres wikis",
        "action-siteadmin": "verrolhar o desverrolhar la basa de donadas",
        "action-sendemail": "mandar corrièrs electronics",
-       "action-editmyoptions": "Editar vòstrei preferéncias",
+       "action-editmyoptions": "modificar vòstras preferéncias",
        "action-editmywatchlist": "modificar vòstra lista de seguiment",
        "action-viewmywatchlist": "afichar vòstra pròpria lista de seguiment",
        "action-viewmyprivateinfo": "veire vòstras informacions personalas",
        "action-editmyprivateinfo": "modificar vòstras informacions personalas",
-       "action-purge": "Purgar la pagina",
+       "action-purge": "purgar aquesta pagina",
        "nchanges": "$1 {{PLURAL:$1|cambiament|cambiaments}}",
        "enhancedrc-since-last-visit": "$1 {{PLURAL:$1|dempuèi la darrièra visita}}",
        "enhancedrc-history": "istoric",
        "rcfilters-filtergroup-automated": "Contribucions automatizadas",
        "rcfilters-filter-bots-label": "Robòt",
        "rcfilters-filter-humans-label": "Èsser uman (pas robòt)",
+       "rcfilters-filter-humans-description": "Modificacions faitas per d'editors umans.",
        "rcfilters-filtergroup-significance": "Significacion",
        "rcfilters-filter-minor-label": "Cambiaments menors",
+       "rcfilters-filter-minor-description": "Modificacions que l'autor a marcadas coma menoras.",
        "rcfilters-filter-major-label": "Modificacions pas menoras",
+       "rcfilters-filter-major-description": "Modificacions pas marcadas coma menoras.",
        "rcfilters-filtergroup-changetype": "Tipe de cambiament",
        "rcfilters-filter-pageedits-label": "Modificacions de pagina",
+       "rcfilters-filter-pageedits-description": "Modificacions del contengut del wiki, de las discussions, de las descripcions de las categorias...",
        "rcfilters-filter-newpages-label": "Creacions de pagina",
+       "rcfilters-filter-newpages-description": "Modificacions a l'origina de paginas novèlas.",
        "rcfilters-filter-categorization-label": "Cambiaments de categoria",
        "rcfilters-filter-logactions-label": "Accions traçadas",
+       "rcfilters-filter-logactions-description": "Accions dels administrators, creacions de comptes, supressions de paginas, telecargaments...",
        "rcnotefrom": "Çaijós {{PLURAL:$5|la modificacion efectuada|las modificacions efectuadas}} dempuèi lo <strong>$3, $4</strong> (afichadas fins a <strong>$1</strong>).",
        "rclistfrom": "Afichar las modificacions novèlas dempuèi lo $3 $2",
        "rcshowhideminor": "$1 los cambiaments menors",
        "recentchangeslinked-page": "Nom de la pagina :",
        "recentchangeslinked-to": "Afichar los cambiaments cap a las paginas ligadas al luòc de la pagina donada",
        "recentchanges-page-added-to-category": "[[:$1]] apondut a la categoria",
-       "recentchanges-page-removed-from-category": "[[:$1]] retirat de la categoria",
-       "autochange-username": "Cambiament automatic MediaWiki",
+       "recentchanges-page-removed-from-category": "[[:$1]] suprimit de la categoria",
+       "autochange-username": "Cambiament automatic de MediaWiki",
        "upload": "Importar un fichièr",
        "uploadbtn": "Importar un fichièr",
        "reuploaddesc": "Anullar lo cargament e tornar al formulari.",
        "file-thumbnail-no": "Lo nom del fichièr comença per <strong>$1</strong>.\nEs possible que s’agisca d’una version reducha ''(miniatura)''.\nSe dispausatz del fichièr en resolucion nauta, importatz-lo, si que non cambiatz lo nom del fichièr.",
        "fileexists-forbidden": "Un fichièr amb aqueste nom existís ja e pòt pas èsser espotit.\nSe volètz totjorn importar aquel fichièr, mercé de tornar en arrièr e d'utilizar un nom novèl. [[File:$1|thumb|center|$1]]",
        "fileexists-shared-forbidden": "Un fichièr amb lo meteis nom existís ja dins la basa de donadas comuna.\nS'o volètz importar tornamai, tornatz en rèire e importatz-lo jos un autre nom. [[File:$1|thumb|center|$1]]",
-       "fileexists-no-change": "Lo telecargament es un doblon de <strong>[[:$1]]</strong>.",
-       "fileexists-duplicate-version": "Lo telecargament es un doblon de {{PLURAL:$2|an older version|older versions}} de <strong>[[:$1]]</strong>.",
+       "fileexists-no-change": "Lo fichièr telecargat es una còpia exacta de la version actuala de <strong>[[:$1]]</strong>",
+       "fileexists-duplicate-version": "Lo fichièr mandat es una còpia exacta {{PLURAL:$2|d'una version precedenta|de versions precedentas}} de <strong>[[:$1]]</strong>.",
        "file-exists-duplicate": "Aqueste fichièr es un doble {{PLURAL:$1|del fichièr seguent|dels fichièrs seguents}} :",
        "file-deleted-duplicate": "Un fichièr identic a aqueste ([[:$1]]) ja es estat suprimit. Vos caldriá verificar lo jornal de las supressions d'aqueste fichièr abans de la tornar telecargar.",
        "file-deleted-duplicate-notitle": "Un fichièr identic a aqueste fichièr es ja estat suprimit amai lo títol. \nVos caldriá demandar a qualqu'un la possibilitat de verificar lo jornal d'aqueste fichièr suprimit per tal d'examinar la situacion  abans de l'importar tornarmai.",
        "upload-form-label-own-work": "Soi l'autor d'aquesta òbra",
        "upload-form-label-infoform-categories": "Categorias",
        "upload-form-label-infoform-date": "Data",
-       "upload-form-label-own-work-message-generic-foreign": "Compreni que siáu a telecargar aquest fichier vèrs un estocatge partejat. Confiermi que siáu a lo faire segon lei reglas d'utilizacion e de licéncia en vigor.",
-       "upload-form-label-not-own-work-message-generic-foreign": "Se siatz pas capable de telecargar aqust fichir segon lei reglas d'aquest estocatge partejat, mercé de sarrar aquest boita de dialògue a d'assaiar un autre metòde.",
+       "upload-form-label-not-own-work-local-generic-local": "Tanben podètz ensajar [[Special:Upload|la pagina de telecargament per defaut]].",
+       "upload-form-label-own-work-message-generic-foreign": "Compreni que mandi aqueste fichièr cap a un depaus partejat. Confirmi qu'agissi en acòrd amb las condicions d'utilizacion e las règlas relativas a las licéncias en vigor.",
+       "upload-form-label-not-own-work-message-generic-foreign": "Se sètz pas en capacitat de mandar aqueste fichièr segon las règlas d'aqueste depaus partejat, mercé de tampar aquesta bóstia de dialòg a d'ensajar un autre metòde.",
        "backend-fail-stream": "Impossible de legir lo fichièr $1.",
        "backend-fail-backup": "Impossible de salvar lo fichièr $1.",
        "backend-fail-notexists": "Lo fichièr $1 existís pas.",
        "zip-bad": "Lo fichièr es un archiu ZIP corromput o illegible.\nPòt pas èsser verificat corrèctament per la seguretat.",
        "zip-unsupported": "Lo fichièr es un archiu ZIP qu'utiliza de caracteristicas pas suportadas per MediaWiki. \nSa seguretat pòt pas èsser verificada corrèctament.",
        "uploadstash": "Cache d'impòrt",
-       "uploadstash-summary": "La pagina dona accès ai fichiers que son telecargats o en cors de telecargament, mai pas encara publicats sus lo wiki. Aquelei fichiers son unicament visibles per l'utilizaire a l'origina dau telecargament.",
+       "uploadstash-summary": "Aquesta pagina dona accès als fichièrs que son importats (o en cors d'importacion), mas son pas encara publicats dins lo wiki. Aqueles fichièrs son pas encara visibles, levat per l'utilizaire a l'origina de l'importacion.",
        "uploadstash-clear": "Escafar los fichièrs en cache",
        "uploadstash-nofiles": "Avètz pas de fichièrs en cache d'impòrt.",
        "uploadstash-errclear": "La supression dels fichièrs a fracassat.",
        "listfiles-delete": "suprimir",
        "listfiles-summary": "Aquesta pagina especiala permet de far la lista de totes los fichièrs importats.",
        "listfiles_search_for": "Recèrca del mèdia nomenat :",
-       "listfiles-userdoesnotexist": "L'utilizaire \"$1\" es pas enregistrat.",
+       "listfiles-userdoesnotexist": "Lo compte d'utilizaire « $1 » es pas enregistrat.",
        "imgfile": "fichièr",
        "listfiles": "Lista dels imatges",
        "listfiles_thumb": "Apercebut",
        "uploadnewversion-linktext": "Importar una version novèla d'aqueste fichièr",
        "shared-repo-from": "de $1",
        "shared-repo": "un depaus partejat",
+       "shared-repo-name-wikimediacommons": "Wikimèdia Commons",
        "upload-disallowed-here": "Podètz pas remplaçar aqueste fichièr.",
        "filerevert": "Revocar $1",
        "filerevert-legend": "Revocar lo fichièr",
        "filerevert-submit": "Revocar",
        "filerevert-success": "'''[[Media:$1|$1]]''' es estat revocat fins a [$4 la version del $2 a $3].",
        "filerevert-badversion": "I a pas de version mai anciana del fichièr amb lo Timestamp donat.",
-       "filerevert-identical": "La version actuala d'aqueu fichier es ja identica an aquela qu'es seleccionada.",
+       "filerevert-identical": "La version actuala del fichièr es ja identica a aquela qu'es seleccionada.",
        "filedelete": "Suprimir $1",
        "filedelete-legend": "Suprimir lo fichièr",
        "filedelete-intro": "Sètz a suprimir '''[[Media:$1|$1]]''' amb tot son istoric.",
        "protectedpages-unknown-timestamp": "Desconegut",
        "protectedpages-unknown-performer": "Utilizaire desconegut",
        "protectedtitles": "Títols protegits",
-       "protectedtitles-summary": "Aquò es una lista dei títols de pagina que son a l'ora d'ara protegits còntra la creacion. Per una lista dei paginas existentas que son protegidas, veire [[{{#special:ProtectedPages}}|{{int:protectedpages}}]].",
+       "protectedtitles-summary": "Aquò es una lista dels títols de pagina que son a l'ora d'ara protegits contra la creacion. Per una lista de las paginas existentas que son protegidas, veire [[{{#special:ProtectedPages}}|{{int:protectedpages}}]].",
        "protectedtitlesempty": "Cap de títol es pas actualament protegit amb aquestes paramètres.",
        "protectedtitles-submit": "Afichar los títols",
        "listusers": "Lista dels participants",
        "apisandbox-submit": "Far la demanda",
        "apisandbox-reset": "Escafar",
        "apisandbox-retry": "Ensajar tornarmai",
+       "apisandbox-load-error": "Una error s'es produita pendent lo cargament de las informacions del modul \"$1\" de l'API : $2",
+       "apisandbox-no-parameters": "Aqueste modul API a pas cap de paramètre.",
        "apisandbox-helpurls": "Ligams d'ajuda",
        "apisandbox-examples": "Exemples",
        "apisandbox-dynamic-parameters": "Paramètres suplementaris",
        "apisandbox-dynamic-parameters-add-label": "Apondon del paramètre",
        "apisandbox-dynamic-parameters-add-placeholder": "Nom del paramètre",
+       "apisandbox-dynamic-error-exists": "Existís ja un paramètre nomenat \"$1\"",
        "apisandbox-deprecated-parameters": "Paramètres obsolèts",
        "apisandbox-fetch-token": "Auto-emplenatge del geton",
-       "apisandbox-submit-invalid-fields-title": "De camps son invalides",
+       "apisandbox-submit-invalid-fields-title": "Certans camps son invalids",
+       "apisandbox-submit-invalid-fields-message": "Corregissètz los camps indicats e ensajatz tornamai.",
        "apisandbox-results": "Resultats",
        "apisandbox-sending-request": "Mandadís de la requèsta a l'API...",
        "apisandbox-loading-results": "Recepcion dels resultats de l'API...",
        "apisandbox-request-url-label": "Requèsta URL :",
        "apisandbox-request-json-label": "Demandar de JSON :",
        "apisandbox-request-time": "Durada de la demanda : {{PLURAL:$1|$1 ms}}",
+       "apisandbox-alert-page": "Los camps d'aquesta pagina son pas valids.",
+       "apisandbox-alert-field": "La valor d'aqueste camp es pas valida.",
        "apisandbox-continue": "Contunhar",
        "apisandbox-continue-clear": "Escafar",
+       "apisandbox-param-limit": "Entrar <kbd>max</kbd> per utilizar lo limit maximal.",
        "apisandbox-multivalue-all-namespaces": "$1 (totes los espacis de noms)",
        "apisandbox-multivalue-all-values": "$1 (totas las valors)",
        "booksources": "Obratges de referéncia",
        "activeusers-count": "$1 {{PLURAL:$1|accion|accions}} al moment {{PLURAL:$3|del darrièr jorn|dels $3 darrièrs jorns}}",
        "activeusers-from": "Afichar los utilizaires dempuèi :",
        "activeusers-noresult": "Cap d'utilizaire pas trobat.",
-       "activeusers-submit": "Mostrar leis utilizaires actius",
+       "activeusers-submit": "Afichar los utilizaires actius",
        "listgrouprights": "Dreits dels gropes d'utilizaires",
        "listgrouprights-summary": "Aquesta pagina conten una lista de gropes definits sus aqueste wiki e mai los dreits d'accès qu'i son associats.\nI pòt aver [[{{MediaWiki:Listgrouprights-helppage}}|d'entresenhas complementàrias]] a prepaus dels dreits.",
        "listgrouprights-key": "Legenda :\n*<span class=\"listgrouprights-granted\">Dreit autrejat</span>\n*<span class=\"listgrouprights-revoked\">Dreit revocat</span>",
        "emailusername": "Nom d'utilizaire :",
        "emailusernamesubmit": "Sometre",
        "email-legend": "Mandar un corrièr electronic a un autre utilizaire de {{SITENAME}}",
-       "emailfrom": "Expeditor :",
+       "emailfrom": "De :",
        "emailto": "Destinatari :",
        "emailsubject": "Subjècte :",
        "emailmessage": "Messatge :",
        "databasenotlocked": "La basa de donadas es pas verrolhada.",
        "lockedbyandtime": "(per $1 lo $2 a $3)",
        "move-page": "Renomenar $1",
-       "move-page-legend": "Tornar nomenar una pagina",
+       "move-page-legend": "Renomenar una pagina",
        "movepagetext": "Utilizatz lo formulari çaijós per tornar nomenar una pagina, en desplaçant tot son istoric cap al nom novèl. Lo títol ancian vendrà una pagina de redireccion cap al títol novèl. Podètz metre a jorn automaticament las redireccions actualas que puntan cap al títol original. Se causissètz de lo far pas, asseguratz-vos de verificar tota [[Special:DoubleRedirects|redireccion dobla]] o [[Special:BrokenRedirects|redireccion copada]]. Avètz la responsabilitat de vos assegurar que los ligams contunhen de puntar cap a lor destinacion supausada.\n\nNotatz que la pagina serà '''pas''' renomada s'existís ja una pagina amb lo novèl títol, levat se aquesta darrièra a un istoric de modificacions verge e es una simpla redireccion. Aquò permet de renomenar una pagina cap a sa posicion d'origina se lo desplaçament s'avera erronèu.\n\n'''ATENCION !'''\nAquò pòt provocar un cambiament radical e imprevist per una pagina consultada frequentament ; asseguratz-vos de n'aver comprés las consequéncias abans de contunhar.",
        "movepagetalktext": "La pagina de discussion associada, se presenta, serà automaticament desplaçada amb ''' levat se :'''\n*Desplaçatz una pagina cap a un autre espaci,\n*Una pagina de discussion ja existís amb lo nom novèl, o\n*Avètz deseleccionat lo boton çaijós.\n\nDins aqueste cas, vos caldrà desplaçar o fusionar la pagina manualament se o volètz.",
        "moveuserpage-warning": "'''Atencion :''' Sètz a mand de tornar nomenar una pagina d’utilizaire. Notatz que sola la pagina serà renomenada e que l’utilizaire '''ne''' serà '''pas''' renomenat.",
        "cant-move-user-page": "Avètz pas la permission de renomenar las paginas principalas d'utilizaires.",
        "cant-move-to-user-page": "Avètz pas la permission de tornar nomenar una pagina cap a una pagina d'utilizaire (a l'excepcion d'una sospagina).",
        "cant-move-category-page": "Avètz pas la permission de renomenar las paginas de categorias.",
-       "cant-move-to-category-page": "Avètz pas lei drechs necessaris per desplaçar una pagina vèrs una categoria",
-       "cant-move-subpages": "Avètz pas lei drechs necessaris per desplaçar de sota-paginas.",
-       "namespace-nosubpages": "Lo nom d'espaci $1 autoriza pas lei sota-paginas.",
+       "cant-move-to-category-page": "Avètz pas lo dreit de renomenar una pagina cap a una pagina de categoria.",
+       "cant-move-subpages": "Avètz pas lo dreit de renomenar de sospaginas.",
+       "namespace-nosubpages": "L’espaci de noms « $1 » autoriza pas las sospaginas.",
        "newtitle": "Títol novèl :",
        "move-watch": "Seguir aquesta pagina",
        "movepagebtn": "Renomenar l'article",
        "articleexists": "Existís ja un article que pòrta aqueste títol, o lo títol qu'avètz causit es pas valid.\nCausissètz-ne un autre.",
        "cantmove-titleprotected": "Avètz pas la possibilitat de desplaçar una pagina cap a aqueste emplaçament perque lo títol es estat protegit a la creacion.",
        "movetalk": "Renomenar tanben la pagina de discussion associada",
-       "move-subpages": "Tornar nomenar las sospaginas (fins a $1 paginas)",
-       "move-talk-subpages": "Tornar nomenar las sospaginas de la pagina de discussion (fins a $1 paginas)",
+       "move-subpages": "Renomenar las sospaginas (maximum $1)",
+       "move-talk-subpages": "Renomenar las sospaginas de la pagina de discussion (maximum $1 paginas)",
        "movepage-page-exists": "La pagina $1 existís ja e pòt pas èsser espotida automaticament.",
        "movepage-page-moved": "La pagina $1 es estada renomenada en $2.",
        "movepage-page-unmoved": "La pagina $1 pòt èsser renomenada en $2.",
        "delete_and_move_confirm": "Òc, accèpti de suprimir la pagina de destinacion per permetre lo cambiament de nom.",
        "delete_and_move_reason": "Pagina suprimida per permetre lo cambiament de nom dempuèi « [[$1]] »",
        "selfmove": "Los títols d’origina e de destinacion son los meteisses : impossible de tornar nomenar una pagina sus ela-meteissa.",
-       "immobile-source-namespace": "Podètz pas tornar nomenar de paginas dins l'espaci de noms « $1 »",
+       "immobile-source-namespace": "Podètz pas renomenar las paginas dins l'espaci de noms « $1 »",
        "immobile-target-namespace": "Podètz pas desplaçar de paginas cap a l'espaci de noms « $1 »",
        "immobile-target-namespace-iw": "Los ligams interwikis son pas una cibla valida pels cambiaments de nom.",
-       "immobile-source-page": "Aquesta pagina se pòt pas tornar nomenar.",
+       "immobile-source-page": "Aquesta pagina se pòt pas renomenar.",
        "immobile-target-page": "Es pas possible de desplaçar la pagina cap a aqueste títol.",
        "imagenocrossnamespace": "Pòt pas desplaçar un imatge cap a un espaci de nomenatge que siá pas un imatge.",
        "nonfile-cannot-move-to-file": "Impossible de renomenar quicòm mai qu'un fichièr cap a l'espaci de noms fichièr.",
        "export-download": "Salvar en tant que fichièr",
        "export-templates": "Enclure los modèls",
        "export-pagelinks": "Enclure las paginas ligadas a una prigondor de :",
-       "export-manual": "Ajustar de paginas manualament :",
+       "export-manual": "Apondre de paginas manualament :",
        "allmessages": "Lista dels messatges del sistèma",
        "allmessagesname": "Nom del camp",
        "allmessagesdefault": "Messatge per defaut",
        "tooltip-p-logo": "Pagina principala",
        "tooltip-n-mainpage": "Visitatz la pagina principala",
        "tooltip-n-mainpage-description": "Anar a l’acuèlh",
-       "tooltip-n-portal": "A prepaus del projècte",
+       "tooltip-n-portal": "A prepaus del projècte, çò que podètz far, ont trobar d'informacions",
        "tooltip-n-currentevents": "Trobar d'entresenhas suls eveniments actuals",
        "tooltip-n-recentchanges": "Lista dels darrièrs cambiaments sul wiki",
        "tooltip-n-randompage": "Afichar una pagina a l'azard",
        "pageinfo-edits": "Nombre total de modificacions",
        "pageinfo-authors": "Nombre total d'autors distinctes",
        "pageinfo-recent-edits": "Nombre de modificacions recentas (dins los darrièrs $1)",
-       "pageinfo-recent-authors": "Nombre d'autors distinctes recents",
+       "pageinfo-recent-authors": "Nombre d'autors distintes recents",
        "pageinfo-magic-words": "{{PLURAL:$1|Mot magic|Mots magics}} ($1)",
        "pageinfo-hidden-categories": "{{PLURAL:$1|Categoria amagada|Categorias amagadas}} ($1)",
        "pageinfo-templates": "{{PLURAL:$1|Modèl inclús|Modèls incluses}} ($1)",
        "htmlform-datetime-placeholder": "AAAA-MM-JJ HH:MM:SS",
        "htmlform-title-not-exists": "$1 existís pas.",
        "htmlform-user-not-exists": "<strong>$1</strong> existís pas.",
-       "htmlform-user-not-valid": "<strong>$1</strong> es pas un nom d'utilizaire valide.",
+       "htmlform-user-not-valid": "<strong>$1</strong> es pas un nom d'utilizaire valid.",
        "logentry-delete-delete": "$1 {{GENDER:$2|a suprimit}} la pagina $3",
        "logentry-delete-restore": "$1 {{GENDER:$2|a restablit}} la pagina $3",
        "logentry-delete-event": "$1 {{GENDER:$2|a modificat}} la visibilitat {{PLURAL:$5|d'un eveniment del jornal|de $5 eveniments del jornal}} sus $3 : $4",
        "pagelang-use-default": "Utilizar la lenga per defaut",
        "pagelang-select-lang": "Seleccionar la lenga",
        "pagelang-reason": "Motiu",
-       "pagelang-submit": "Validar",
+       "pagelang-submit": "Mandar",
        "pagelang-nonexistent-page": "La pagina $1 existís pas.",
        "right-pagelang": "Cambiar la lenga de la pagina",
        "action-pagelang": "cambiar la lenga de la pagina",
        "special-characters-title-minus": "signe mens",
        "mw-widgets-dateinput-no-date": "Cap de data pas seleccionada",
        "mw-widgets-mediasearch-input-placeholder": "Recercar de mèdias",
-       "mw-widgets-mediasearch-noresults": "Ges de resultat trobat",
-       "mw-widgets-categoryselector-add-category-placeholder": "Ajustar una categoria...",
-       "sessionprovider-generic": "$1 sessions",
+       "mw-widgets-mediasearch-noresults": "Cap de resultat pas trobat.",
+       "mw-widgets-categoryselector-add-category-placeholder": "Apondre una categoria...",
+       "mw-widgets-usersmultiselect-placeholder": "Apondre mai...",
+       "sessionprovider-generic": "sessions $1",
        "sessionprovider-mediawiki-session-cookiesessionprovider": "sessions basadas sus de cookies",
-       "sessionprovider-nocookies": "Lei cookies son benlèu desactivats. Verificatz que lei cookies siegan ben activat e tornatz assaiar.",
+       "sessionprovider-nocookies": "Es possible que los testimònis (''cookies'') sián desactivats. Asseguratz-vos qu'avètz activat los testimònis e recomençatz.",
        "randomrootpage": "Pagina raiç aleatòria",
-       "log-action-filter-block": "Tipe d'accion :",
-       "log-action-filter-delete": "Tipe d'accion :",
+       "log-action-filter-block": "Tipe de blocatge :",
+       "log-action-filter-delete": "Tipe de supression :",
        "log-action-filter-import": "Tipe d'importacion :",
-       "log-action-filter-managetags": "Tipe d'accion :",
+       "log-action-filter-managetags": "Tipe d'accion de gestion de las etiquetas :",
        "log-action-filter-move": "Tipe de desplaçament :",
-       "log-action-filter-newusers": "Tipe de creacion :",
+       "log-action-filter-newusers": "Tipe de creacion de compte :",
        "log-action-filter-patrol": "Tipe de patrolha :",
-       "log-action-filter-protect": "Tipe d'accion :",
+       "log-action-filter-protect": "Tipe de proteccion :",
        "log-action-filter-rights": "Tipe de cambiament de dreits :",
        "log-action-filter-suppress": "Tipe de supression :",
-       "log-action-filter-upload": "Tipe de telecargament :",
+       "log-action-filter-upload": "Tipe de mandadís :",
        "log-action-filter-all": "Tot",
        "log-action-filter-block-block": "Blocatge",
        "log-action-filter-block-reblock": "Modificacion de blocatge",
        "log-action-filter-block-unblock": "Desblocar",
-       "log-action-filter-delete-delete": "Escafament de pagina",
-       "log-action-filter-delete-restore": "Restauracion de pagina",
+       "log-action-filter-delete-delete": "Supression de paginas",
+       "log-action-filter-delete-restore": "Restabliment de pagina",
        "log-action-filter-import-interwiki": "Impòrt transwiki",
-       "log-action-filter-managetags-create": "Creacion d'etiqueta",
-       "log-action-filter-managetags-delete": "Supression d'etiqueta",
-       "log-action-filter-managetags-activate": "Activacion d'etiqueta",
-       "log-action-filter-managetags-deactivate": "Desactivacion d'etiqueta",
+       "log-action-filter-managetags-create": "Creacion de balisa",
+       "log-action-filter-managetags-delete": "Supression de balisa",
+       "log-action-filter-managetags-activate": "Activacion de l'etiqueta",
+       "log-action-filter-managetags-deactivate": "Desactivacion de l'etiqueta",
        "log-action-filter-newusers-create": "Creacion per un utilizaire anonim",
        "log-action-filter-newusers-create2": "Creacion per un utilizaire enregistrat",
        "log-action-filter-newusers-autocreate": "Creacion automatica",
-       "log-action-filter-newusers-byemail": "Creacion amb un senhau mandat per corrier electronic",
+       "log-action-filter-newusers-byemail": "Creacion amb un senhal mandat per corrièr electronic",
        "log-action-filter-patrol-patrol": "Patrolha manuala",
        "log-action-filter-patrol-autopatrol": "Patrolha automatica",
        "log-action-filter-protect-protect": "Proteccion",
-       "log-action-filter-protect-modify": "Modificacion de proteccion",
+       "log-action-filter-protect-modify": "Modificacion de la proteccion",
        "log-action-filter-protect-unprotect": "Desproteccion",
        "log-action-filter-protect-move_prot": "Proteccion de renomenatge",
-       "log-action-filter-rights-rights": "Cambiament manuau",
+       "log-action-filter-rights-rights": "Cambiament manual",
        "log-action-filter-rights-autopromote": "Cambiament automatic",
        "log-action-filter-suppress-event": "Supression de jornal",
        "log-action-filter-suppress-revision": "Supression de revision",
        "log-action-filter-suppress-delete": "Supression de pagina",
-       "log-action-filter-upload-upload": "Telecargament novèu",
-       "log-action-filter-upload-overwrite": "Retelecargament",
-       "authmanager-create-disabled": "La creacion de còmptes es blocada.",
-       "authmanager-authplugin-setpass-bad-domain": "Domeni invalide",
-       "authmanager-autocreate-noperm": "La creacion automatica de còmptes es blocada.",
-       "authmanager-password-help": "Senhau per autentificacion.",
-       "authmanager-domain-help": "Domeni per autentificacion extèrna.",
-       "authmanager-retype-help": "Mercé de confiermar vòstre senhau.",
+       "log-action-filter-upload-upload": "Mandadís novèl",
+       "log-action-filter-upload-overwrite": "Tornar mandar",
+       "authmanager-create-disabled": "La creacion de compte es desactivada.",
+       "authmanager-authplugin-setpass-bad-domain": "Domeni invalid.",
+       "authmanager-autocreate-noperm": "La creacion automatica de compte es pas autorizada.",
+       "authmanager-password-help": "Senhal per l'autentificacion.",
+       "authmanager-domain-help": "Domeni per l'autentificacion extèrna.",
+       "authmanager-retype-help": "Senhal un còp de mai per confirmacion.",
        "authmanager-email-label": "Corrièr electronic",
        "authmanager-email-help": "Adreça de corrièr electronic",
        "authmanager-realname-label": "Nom vertadièr",
        "authmanager-realname-help": "Nom real de l'utilizaire",
-       "authmanager-provider-password": "Autentificacion ambé senhau",
-       "authmanager-provider-temporarypassword": "Senhau provisòri",
-       "authprovider-confirmlink-message": "Segon lei vòstreis assais recents de connexion, lei còmptes seguents pòdon èsser liats vèrs lo vòstre còmpte wiki. Lei liar permet de se connectar amb aqueleis còmptes. Mercé de seleccionar lei còmptes de liar.",
-       "authprovider-confirmlink-request-label": "Còmptes de liar",
-       "authprovider-confirmlink-success-line": "$1 : operacion capitada, lei còmptes son estats liats.",
-       "authprovider-confirmlink-failed": "La temptativa de liar lei còmptes a pas capitat : $1",
+       "authmanager-provider-password": "Autentificacion amb senhal",
+       "authmanager-provider-temporarypassword": "Senhal provisòri",
+       "authprovider-confirmlink-message": "D’aprèp vòstras darrièras temtativas de connexion, los comptes seguents pòson èsser ligats a vòstre compte wiki. Los ligar vos permetrà de vos connectar via aquestes comptes. Seleccionatz los que devon èsser ligats.",
+       "authprovider-confirmlink-request-label": "Comptes que devon èsser ligats",
+       "authprovider-confirmlink-success-line": "$1 : Ligats amb succès.",
+       "authprovider-confirmlink-failed": "La ligason del compte a pas plan capitat : $1",
        "authprovider-resetpass-skip-label": "Sautar",
        "authform-newtoken": "Geton mancant. $1",
        "authform-notoken": "Geton mancant",
        "authform-wrongtoken": "Marrit geton",
-       "specialpage-securitylevel-not-allowed-title": "Pas autorizat",
+       "specialpage-securitylevel-not-allowed-title": "Interdit",
        "changecredentials": "Modificar las informacions d’identificacion",
+       "removecredentials": "Suprimir las informacions d'identificacion",
+       "removecredentials-submit": "Suprimir las informacions d'identificacion",
+       "credentialsform-provider": "Tipe d’informacion d’identificacion :",
        "credentialsform-account": "Nom de compte :",
-       "linkaccounts": "Liar lei còmptes",
-       "linkaccounts-success-text": "Lo còmpte èra estat liat.",
-       "linkaccounts-submit": "Liar lei còmptes",
+       "linkaccounts": "Ligar los comptes",
+       "linkaccounts-success-text": "Lo compte es estat ligat.",
+       "linkaccounts-submit": "Ligar los comptes",
        "restrictionsfield-badip": "Adreça IP o plaja invalida : $1",
-       "revid": "Revision $1",
-       "pageid": "Pagina ID $1"
+       "revid": "version $1",
+       "pageid": "ID de pagina $1"
 }
index 1204519..e62a905 100644 (file)
        "searcharticle": "သိုပ်ႇၵႂႃႇ",
        "history": "ပိုၼ်းၼႃႈလိၵ်ႈ",
        "history_short": "ပိုၼ်း",
+       "history_small": "ပိုၼ်း",
        "updatedmarker": "ပဵၼ်ဢၢပ်ႉတိတ်ႉဝႆႉ ၸဵမ်မိူဝ်ႈၶႃႈၵႂႃႇဢႅဝ်ႇၵမ်းလိုၼ်းသုတ်း",
        "printableversion": "တွၼ်ႈတႃႇဢိတ်ႇဢွၵ်ႇ",
        "permalink": "ႁဵင်းၵွင်ႉ မၼ်ႈၵိုမ်း",
        "views": "လူတူၺ်း",
        "toolbox": "ၶိူင်ႈၵမ်ႉၵႅမ်",
        "tool-link-userrights": "လႅၵ်ႈလၢႆႈ {{GENDER:$1|ၽူႈၸႂ်ႉတိုဝ်း}} ၸုမ်း",
+       "tool-link-userrights-readonly": "တူၺ်း {{GENDER:$1|ၽူႈၸႂ်ႉတိုဝ်း}} ၸုမ်း",
        "tool-link-emailuser": "သူင်ႇဢီးမေးလ်ဢၼ်ၼႆႉ {{GENDER:$1|ၽူႈၸႂ်ႉတိုဝ်း}}",
        "userpage": "တူၺ်းၼႃႈလိၵ်ႈၽူႈၸႂ်ႉတိုဝ်း",
        "projectpage": "တူၺ်းၼႃႈလိၵ်ႈ ပရေႃးၵျႅၵ်ႉ",
index d0060fd..f907c59 100644 (file)
@@ -46,6 +46,7 @@
        "tog-watchmoves": "Мин күчергән битләр һәм файллар күзәтү исемлегемә өстәлсен",
        "tog-watchdeletion": "Мин бетергән битләр һәм файлларны күзәтү исемлегемгә өстәлсен",
        "tog-watchuploads": "Минем тарафтан йөкләнелгән файлларны күзәтү исемлегемә кертергә",
+       "tog-watchrollback": "Мин үткәрмәгән битләрне күзәтү исемлегемә өстәргә",
        "tog-minordefault": "Барлык үзгәртүләрне килешү буенча кече дип билгеләнсен",
        "tog-previewontop": "Үзгәртү тәрәзәсеннән өстәрәк битне алдан карау өлкәсен күрсәтелсен",
        "tog-previewonfirst": "Үзгәртү битенә күчкәндә башта алдан карау бите күрсәтелсен",
        "talk": "Бәхәс",
        "views": "Караулар",
        "toolbox": "Кораллар",
+       "tool-link-userrights": "{{GENDER:$1|Кулланучының}} төркемнәрен алмаштыру",
+       "tool-link-userrights-readonly": "{{GENDER:$1|Кулланучының}} төркемнәрен карау",
+       "tool-link-emailuser": "{{GENDER:$1|Кулланучыга}} хат язу",
        "userpage": "Кулланучы битен карау",
        "projectpage": "Проект битен карау",
        "imagepage": "Файл битен карау",
        "suspicious-userlogout": "Сезнең эшчәнлекне бетерү соравыгыз кире кагылды, чөнки ул ялгыш браузер яисә кэшлаучы прокси аша җибәрелергэ мөмкин.",
        "pt-login": "Керү",
        "pt-login-button": "Керү",
+       "pt-login-continue-button": "Керүне дәвам итү",
        "pt-createaccount": "Яңа кулланучыны теркәү",
        "pt-userlogout": "Чыгу",
        "php-mail-error-unknown": "PHP mail() функциясендә билгесез хата",
index 27ef735..3793043 100644 (file)
        "logentry-suppress-event-legacy": "$1 {{GENDER:$2|已暗中變更}} $3 中日誌的可見性",
        "logentry-suppress-revision-legacy": "$1 {{GENDER:$2|已暗中更改}}頁面 $3 中修訂的可見性",
        "revdelete-content-hid": "已隱藏內容",
-       "revdelete-summary-hid": "å·±隱藏摘要",
+       "revdelete-summary-hid": "å·²隱藏摘要",
        "revdelete-uname-hid": "隱藏使用者名稱",
        "revdelete-content-unhid": "取消隱藏內容",
        "revdelete-summary-unhid": "取消隱藏編輯摘要",
index da9e59e..14a610b 100644 (file)
@@ -6,27 +6,31 @@
         * @mixins OO.EmitterList
         *
         * @constructor
+        * @param {string} name Group name
         * @param {Object} [config] Configuration options
-        * @cfg {string} [name] Group name
         * @cfg {string} [type='send_unselected_if_any'] Group type
         * @cfg {string} [title] Group title
         * @cfg {string} [separator='|'] Value separator for 'string_options' groups
-        * @cfg {string} [exclusionType='default'] Group exclusion type
         * @cfg {boolean} [active] Group is active
+        * @cfg {boolean} [fullCoverage] This filters in this group collectively cover all results
         */
-       mw.rcfilters.dm.FilterGroup = function MwRcfiltersDmFilterGroup( config ) {
+       mw.rcfilters.dm.FilterGroup = function MwRcfiltersDmFilterGroup( name, config ) {
                config = config || {};
 
                // Mixin constructor
                OO.EventEmitter.call( this );
                OO.EmitterList.call( this );
 
-               this.name = config.name;
+               this.name = name;
                this.type = config.type || 'send_unselected_if_any';
                this.title = config.title;
                this.separator = config.separator || '|';
-               this.exclusionType = config.exclusionType || 'default';
+
                this.active = !!config.active;
+               this.fullCoverage = !!config.fullCoverage;
+
+               this.aggregate( { update: 'filterItemUpdate' } );
+               this.connect( this, { filterItemUpdate: 'onFilterItemUpdate' } );
        };
 
        /* Initialization */
        /* Methods */
 
        /**
-        * Check the active status of the group and set it accordingly.
+        * Respond to filterItem update event
         *
         * @fires update
         */
-       mw.rcfilters.dm.FilterGroup.prototype.checkActive = function () {
-               var active,
-                       count = 0;
-
-               // Recheck group activity
-               this.getItems().forEach( function ( filterItem ) {
-                       count += Number( filterItem.isSelected() );
-               } );
-
-               active = (
-                       count > 0 &&
-                       count < this.getItemCount()
-               );
+       mw.rcfilters.dm.FilterGroup.prototype.onFilterItemUpdate = function () {
+               // Update state
+               var active = this.areAnySelected();
 
                if ( this.active !== active ) {
                        this.active = active;
                return this.name;
        };
 
+       /**
+        * Check whether there are any items selected
+        *
+        * @return {boolean} Any items in the group are selected
+        */
+       mw.rcfilters.dm.FilterGroup.prototype.areAnySelected = function () {
+               return this.getItems().some( function ( filterItem ) {
+                       return filterItem.isSelected();
+               } );
+       };
+
+       /**
+        * Check whether all items selected
+        *
+        * @return {boolean} All items are selected
+        */
+       mw.rcfilters.dm.FilterGroup.prototype.areAllSelected = function () {
+               return this.getItems().every( function ( filterItem ) {
+                       return filterItem.isSelected();
+               } );
+       };
+
+       /**
+        * Get all selected items in this group
+        *
+        * @param {mw.rcfilters.dm.FilterItem} [excludeItem] Item to exclude from the list
+        * @return {mw.rcfilters.dm.FilterItem[]} Selected items
+        */
+       mw.rcfilters.dm.FilterGroup.prototype.getSelectedItems = function ( excludeItem ) {
+               var excludeName = ( excludeItem && excludeItem.getName() ) || '';
+
+               return this.getItems().filter( function ( item ) {
+                       return item.getName() !== excludeName && item.isSelected();
+               } );
+       };
+
+       /**
+        * Check whether all selected items are in conflict with the given item
+        *
+        * @param {mw.rcfilters.dm.FilterItem} filterItem Filter item to test
+        * @return {boolean} All selected items are in conflict with this item
+        */
+       mw.rcfilters.dm.FilterGroup.prototype.areAllSelectedInConflictWith = function ( filterItem ) {
+               var selectedItems = this.getSelectedItems( filterItem );
+
+               return selectedItems.length > 0 && selectedItems.every( function ( selectedFilter ) {
+                       return selectedFilter.existsInConflicts( filterItem );
+               } );
+       };
+
+       /**
+        * Check whether any of the selected items are in conflict with the given item
+        *
+        * @param {mw.rcfilters.dm.FilterItem} filterItem Filter item to test
+        * @return {boolean} Any of the selected items are in conflict with this item
+        */
+       mw.rcfilters.dm.FilterGroup.prototype.areAnySelectedInConflictWith = function ( filterItem ) {
+               var selectedItems = this.getSelectedItems( filterItem );
+
+               return selectedItems.length > 0 && selectedItems.some( function ( selectedFilter ) {
+                       return selectedFilter.existsInConflicts( filterItem );
+               } );
+       };
+
        /**
         * Get group type
         *
        };
 
        /**
-        * Get group exclusion type
+        * Check whether the group is defined as full coverage
         *
-        * @return {string} Exclusion type
+        * @return {boolean} Group is full coverage
         */
-       mw.rcfilters.dm.FilterGroup.prototype.getExclusionType = function () {
-               return this.exclusionType;
+       mw.rcfilters.dm.FilterGroup.prototype.isFullCoverage = function () {
+               return this.fullCoverage;
        };
 }( mediaWiki ) );
index 5dfb68d..39c7667 100644 (file)
@@ -6,6 +6,7 @@
         *
         * @constructor
         * @param {string} name Filter name
+        * @param {mw.rcfilters.dm.FilterGroup} groupModel Filter group model
         * @param {Object} config Configuration object
         * @cfg {string} [group] The group this item belongs to
         * @cfg {string} [label] The label for the filter
         * @cfg {boolean} [active=true] The filter is active and affecting the result
         * @cfg {string[]} [excludes=[]] A list of filter names this filter, if
         *  selected, makes inactive.
-        * @cfg {boolean} [default] The default state of this filter
+        * @cfg {boolean} [selected] The item is selected
+        * @cfg {string[]} [subset] Defining the names of filters that are a subset of this filter
+        * @cfg {string[]} [conflictsWith] Defining the names of filters that conflict with this item
         */
-       mw.rcfilters.dm.FilterItem = function MwRcfiltersDmFilterItem( name, config ) {
+       mw.rcfilters.dm.FilterItem = function MwRcfiltersDmFilterItem( name, groupModel, config ) {
                config = config || {};
 
                // Mixin constructor
                OO.EventEmitter.call( this );
 
                this.name = name;
-               this.group = config.group || '';
+               this.groupModel = groupModel;
+
                this.label = config.label || this.name;
                this.description = config.description;
-               this.default = !!config.default;
+               this.selected = !!config.selected;
+
+               // Interaction definitions
+               this.subset = config.subset || [];
+               this.conflicts = config.conflicts || [];
+               this.superset = [];
 
-               this.active = config.active === undefined ? true : !!config.active;
-               this.excludes = config.excludes || [];
-               this.selected = this.default;
+               // Interaction states
+               this.included = false;
+               this.conflicted = false;
+               this.fullyCovered = false;
        };
 
        /* Initialization */
                return this.name;
        };
 
+       /**
+        * Get the model of the group this filter belongs to
+        *
+        * @return {mw.rcfilters.dm.FilterGroup} Filter group model
+        */
+       mw.rcfilters.dm.FilterItem.prototype.getGroupModel = function () {
+               return this.groupModel;
+       };
+
        /**
         * Get the group name this filter belongs to
         *
         * @return {string} Filter group name
         */
-       mw.rcfilters.dm.FilterItem.prototype.getGroup = function () {
-               return this.group;
+       mw.rcfilters.dm.FilterItem.prototype.getGroupName = function () {
+               return this.groupModel.getName();
        };
 
        /**
                return this.default;
        };
 
+       /**
+        * Get filter subset
+        * This is a list of filter names that are defined to be included
+        * when this filter is selected.
+        *
+        * @return {string[]} Filter subset
+        */
+       mw.rcfilters.dm.FilterItem.prototype.getSubset = function () {
+               return this.subset;
+       };
+
+       /**
+        * Get filter superset
+        * This is a generated list of filters that define this filter
+        * to be included when either of them is selected.
+        *
+        * @return {string[]} Filter superset
+        */
+       mw.rcfilters.dm.FilterItem.prototype.getSuperset = function () {
+               return this.superset;
+       };
+
        /**
         * Get the selected state of this filter
         *
        };
 
        /**
-        * Check if this filter is active
+        * Check whether the filter is currently in a conflict state
+        *
+        * @return {boolean} Filter is in conflict state
+        */
+       mw.rcfilters.dm.FilterItem.prototype.isConflicted = function () {
+               return this.conflicted;
+       };
+
+       /**
+        * Check whether the filter is currently in an already included subset
         *
-        * @return {boolean} Filter is active
+        * @return {boolean} Filter is in an already-included subset
         */
-       mw.rcfilters.dm.FilterItem.prototype.isActive = function () {
-               return this.active;
+       mw.rcfilters.dm.FilterItem.prototype.isIncluded = function () {
+               return this.included;
        };
 
        /**
-        * Check if this filter has a list of excluded filters
+        * Check whether the filter is currently fully covered
         *
-        * @return {boolean} Filter has a list of excluded filters
+        * @return {boolean} Filter is in fully-covered state
         */
-       mw.rcfilters.dm.FilterItem.prototype.hasExcludedFilters = function () {
-               return !!this.excludes.length;
+       mw.rcfilters.dm.FilterItem.prototype.isFullyCovered = function () {
+               return this.fullyCovered;
        };
 
        /**
-        * Get this filter's list of excluded filters
+        * Get filter conflicts
         *
-        * @return {string[]} Array of excluded filter names
+        * @return {string[]} Filter conflicts
         */
-       mw.rcfilters.dm.FilterItem.prototype.getExcludedFilters = function () {
-               return this.excludes;
+       mw.rcfilters.dm.FilterItem.prototype.getConflicts = function () {
+               return this.conflicts;
        };
 
        /**
-        * Toggle the active state of the item
+        * Set filter conflicts
         *
-        * @param {boolean} [isActive] Filter is active
+        * @param {string[]} conflicts Filter conflicts
+        */
+       mw.rcfilters.dm.FilterItem.prototype.setConflicts = function ( conflicts ) {
+               this.conflicts = conflicts || [];
+       };
+
+       /**
+        * Set filter superset
+        *
+        * @param {string[]} superset Filter superset
+        */
+       mw.rcfilters.dm.FilterItem.prototype.setSuperset = function ( superset ) {
+               this.superset = superset || [];
+       };
+
+       /**
+        * Check whether a filter exists in the subset list for this filter
+        *
+        * @param {string} filterName Filter name
+        * @return {boolean} Filter name is in the subset list
+        */
+       mw.rcfilters.dm.FilterItem.prototype.existsInSubset = function ( filterName ) {
+               return this.subset.indexOf( filterName ) > -1;
+       };
+
+       /**
+        * Check whether this item has a potential conflict with the given item
+        *
+        * This checks whether the given item is in the list of conflicts of
+        * the current item, but makes no judgment about whether the conflict
+        * is currently at play (either one of the items may not be selected)
+        *
+        * @param {mw.rcfilters.dm.FilterItem} filterItem Filter item
+        * @return {boolean} This item has a conflict with the given item
+        */
+       mw.rcfilters.dm.FilterItem.prototype.existsInConflicts = function ( filterItem ) {
+               return this.conflicts.indexOf( filterItem.getName() ) > -1;
+       };
+
+       /**
+        * Set the state of this filter as being conflicted
+        * (This means any filters in its conflicts are selected)
+        *
+        * @param {boolean} [conflicted] Filter is in conflict state
+        * @fires update
+        */
+       mw.rcfilters.dm.FilterItem.prototype.toggleConflicted = function ( conflicted ) {
+               conflicted = conflicted === undefined ? !this.conflicted : conflicted;
+
+               if ( this.conflicted !== conflicted ) {
+                       this.conflicted = conflicted;
+                       this.emit( 'update' );
+               }
+       };
+
+       /**
+        * Set the state of this filter as being already included
+        * (This means any filters in its superset are selected)
+        *
+        * @param {boolean} [included] Filter is included as part of a subset
         * @fires update
         */
-       mw.rcfilters.dm.FilterItem.prototype.toggleActive = function ( isActive ) {
-               isActive = isActive === undefined ? !this.active : isActive;
+       mw.rcfilters.dm.FilterItem.prototype.toggleIncluded = function ( included ) {
+               included = included === undefined ? !this.included : included;
 
-               if ( this.active !== isActive ) {
-                       this.active = isActive;
+               if ( this.included !== included ) {
+                       this.included = included;
                        this.emit( 'update' );
                }
        };
                        this.emit( 'update' );
                }
        };
+
+       /**
+        * Toggle the fully covered state of the item
+        *
+        * @param {boolean} [isFullyCovered] Filter is fully covered
+        * @fires update
+        */
+       mw.rcfilters.dm.FilterItem.prototype.toggleFullyCovered = function ( isFullyCovered ) {
+               isFullyCovered = isFullyCovered === undefined ? !this.fullycovered : isFullyCovered;
+
+               if ( this.fullyCovered !== isFullyCovered ) {
+                       this.fullyCovered = isFullyCovered;
+                       this.emit( 'update' );
+               }
+       };
 }( mediaWiki ) );
index 5bbeabf..13f7d31 100644 (file)
                OO.EmitterList.call( this );
 
                this.groups = {};
-               this.excludedByMap = {};
                this.defaultParams = {};
                this.defaultFiltersEmpty = null;
 
                // Events
                this.aggregate( { update: 'filterItemUpdate' } );
-               this.connect( this, { filterItemUpdate: 'onFilterItemUpdate' } );
+               this.connect( this, { filterItemUpdate: [ 'emit', 'itemUpdate' ] } );
        };
 
        /* Initialization */
        /* Methods */
 
        /**
-        * Respond to filter item change.
+        * Re-assess the states of filter items based on the interactions between them
         *
-        * @param {mw.rcfilters.dm.FilterItem} item Updated filter
-        * @fires itemUpdate
+        * @param {mw.rcfilters.dm.FilterItem} [item] Changed item. If not given, the
+        *  method will go over the state of all items
         */
-       mw.rcfilters.dm.FiltersViewModel.prototype.onFilterItemUpdate = function ( item ) {
-               // Reapply the active state of filters
-               this.reapplyActiveFilters( item );
+       mw.rcfilters.dm.FiltersViewModel.prototype.reassessFilterInteractions = function ( item ) {
+               var allSelected,
+                       model = this,
+                       iterationItems = item !== undefined ? [ item ] : this.getItems();
 
-               // Recheck group activity state
-               this.getGroup( item.getGroup() ).checkActive();
+               iterationItems.forEach( function ( checkedItem ) {
+                       var allCheckedItems = checkedItem.getSubset().concat( [ checkedItem.getName() ] ),
+                               groupModel = checkedItem.getGroupModel();
 
-               this.emit( 'itemUpdate', item );
-       };
+                       // Check for subsets (included filters) plus the item itself:
+                       allCheckedItems.forEach( function ( filterItemName ) {
+                               var itemInSubset = model.getItemByName( filterItemName );
 
-       /**
-        * Calculate the active state of the filters, based on selected filters in the group.
-        *
-        * @param {mw.rcfilters.dm.FilterItem} item Changed item
-        */
-       mw.rcfilters.dm.FiltersViewModel.prototype.reapplyActiveFilters = function ( item ) {
-               var selectedItemsCount,
-                       group = item.getGroup(),
-                       model = this;
-               if (
-                       !this.getGroup( group ).getExclusionType() ||
-                       this.getGroup( group ).getExclusionType() === 'default'
-               ) {
-                       // Default behavior
-                       // If any parameter is selected, but:
-                       // - If there are unselected items in the group, they are inactive
-                       // - If the entire group is selected, all are inactive
-
-                       // Check what's selected in the group
-                       selectedItemsCount = this.getGroupFilters( group ).filter( function ( filterItem ) {
-                               return filterItem.isSelected();
-                       } ).length;
-
-                       this.getGroupFilters( group ).forEach( function ( filterItem ) {
-                               filterItem.toggleActive(
-                                       selectedItemsCount > 0 ?
-                                               // If some items are selected
-                                               (
-                                                       selectedItemsCount === model.groups[ group ].getItemCount() ?
-                                                       // If **all** items are selected, they're all inactive
-                                                       false :
-                                                       // If not all are selected, then the selected are active
-                                                       // and the unselected are inactive
-                                                       filterItem.isSelected()
-                                               ) :
-                                               // No item is selected, everything is active
-                                               true
+                               itemInSubset.toggleIncluded(
+                                       // If any of itemInSubset's supersets are selected, this item
+                                       // is included
+                                       itemInSubset.getSuperset().some( function ( supersetName ) {
+                                               return ( model.getItemByName( supersetName ).isSelected() );
+                                       } )
                                );
                        } );
-               } else if ( this.getGroup( group ).getExclusionType() === 'explicit' ) {
-                       // Explicit behavior
-                       // - Go over the list of excluded filters to change their
-                       //   active states accordingly
-
-                       // For each item in the list, see if there are other selected
-                       // filters that also exclude it. If it does, it will still be
-                       // inactive.
-
-                       item.getExcludedFilters().forEach( function ( filterName ) {
-                               var filterItem = model.getItemByName( filterName );
-
-                               // Note to reduce confusion:
-                               // - item is the filter whose state changed and should exclude the other filters
-                               //   in its list of exclusions
-                               // - filterItem is the filter that is potentially being excluded by the current item
-                               // - anotherExcludingFilter is any other filter that excludes filterItem; we must check
-                               //   if that filter is selected, because if it is, we should not touch the excluded item
-                               if (
-                                       // Check if there are any filters (other than the current one)
-                                       // that also exclude the filterName
-                                       !model.excludedByMap[ filterName ].some( function ( anotherExcludingFilterName ) {
-                                               var anotherExcludingFilter = model.getItemByName( anotherExcludingFilterName );
-
-                                               return (
-                                                       anotherExcludingFilterName !== item.getName() &&
-                                                       anotherExcludingFilter.isSelected()
-                                               );
-                                       } )
-                               ) {
-                                       // Only change the state for filters that aren't
-                                       // also affected by other excluding selected filters
-                                       filterItem.toggleActive( !item.isSelected() );
+
+                       // Update coverage for the changed group
+                       if ( groupModel.isFullCoverage() ) {
+                               allSelected = groupModel.areAllSelected();
+                               groupModel.getItems().forEach( function ( filterItem ) {
+                                       filterItem.toggleFullyCovered( allSelected );
+                               } );
+                       }
+               } );
+
+               // Check for conflicts
+               // In this case, we must go over all items, since
+               // conflicts are bidirectional and depend not only on
+               // individual items, but also on the selected states of
+               // the groups they're in.
+               this.getItems().forEach( function ( filterItem ) {
+                       var inConflict = false,
+                               filterItemGroup = filterItem.getGroupModel();
+
+                       // For each item, see if that item is still conflicting
+                       $.each( model.groups, function ( groupName, groupModel ) {
+                               if ( filterItem.getGroupName() === groupName ) {
+                                       // Check inside the group
+                                       inConflict = groupModel.areAnySelectedInConflictWith( filterItem );
+                               } else {
+                                       // According to the spec, if two items conflict from two different
+                                       // groups, the conflict only lasts if the groups **only have selected
+                                       // items that are conflicting**. If a group has selected items that
+                                       // are conflicting and non-conflicting, the scope of the result has
+                                       // expanded enough to completely remove the conflict.
+
+                                       // For example, see two groups with conflicts:
+                                       // userExpLevel: [
+                                       //   {
+                                       //      name: 'experienced',
+                                       //      conflicts: [ 'unregistered' ]
+                                       //   }
+                                       // ],
+                                       // registration: [
+                                       //   {
+                                       //      name: 'registered',
+                                       //   },
+                                       //   {
+                                       //      name: 'unregistered',
+                                       //   }
+                                       // ]
+                                       // If we select 'experienced', then 'unregistered' is in conflict (and vice versa),
+                                       // because, inherently, 'experienced' filter only includes registered users, and so
+                                       // both filters are in conflict with one another.
+                                       // However, the minute we select 'registered', the scope of our results
+                                       // has expanded to no longer have a conflict with 'experienced' filter, and
+                                       // so the conflict is removed.
+
+                                       // In our case, we need to check if the entire group conflicts with
+                                       // the entire item's group, so we follow the above spec
+                                       inConflict = (
+                                               // The foreign group is in conflict with this item
+                                               groupModel.areAllSelectedInConflictWith( filterItem ) &&
+                                               // Every selected member of the item's own group is also
+                                               // in conflict with the other group
+                                               filterItemGroup.getSelectedItems().every( function ( otherGroupItem ) {
+                                                       return groupModel.areAllSelectedInConflictWith( otherGroupItem );
+                                               } )
+                                       );
                                }
+
+                               // If we're in conflict, this will return 'false' which
+                               // will break the loop. Otherwise, we're not in conflict
+                               // and the loop continues
+                               return !inConflict;
                        } );
-               }
+
+                       // Toggle the item state
+                       filterItem.toggleConflicted( inConflict );
+               } );
        };
 
        /**
         * @param {Object} filters Filter group definition
         */
        mw.rcfilters.dm.FiltersViewModel.prototype.initializeFilters = function ( filters ) {
-               var i, filterItem, selectedFilterNames, excludedFilters,
+               var i, filterItem, selectedFilterNames,
                        model = this,
                        items = [],
-                       addToMap = function ( excludedFilters ) {
-                               excludedFilters.forEach( function ( filterName ) {
-                                       model.excludedByMap[ filterName ] = model.excludedByMap[ filterName ] || [];
-                                       model.excludedByMap[ filterName ].push( filterItem.getName() );
+                       addArrayElementsUnique = function ( arr, elements ) {
+                               elements = Array.isArray( elements ) ? elements : [ elements ];
+
+                               elements.forEach( function ( element ) {
+                                       if ( arr.indexOf( element ) === -1 ) {
+                                               arr.push( element );
+                                       }
                                } );
-                       };
+
+                               return arr;
+                       },
+                       conflictMap = {},
+                       supersetMap = {};
 
                // Reset
                this.clearItems();
                this.groups = {};
-               this.excludedByMap = {};
 
                $.each( filters, function ( group, data ) {
                        if ( !model.groups[ group ] ) {
-                               model.groups[ group ] = new mw.rcfilters.dm.FilterGroup( {
-                                       name: group,
+                               model.groups[ group ] = new mw.rcfilters.dm.FilterGroup( group, {
                                        type: data.type,
                                        title: data.title,
                                        separator: data.separator,
-                                       exclusionType: data.exclusionType
+                                       fullCoverage: !!data.fullCoverage
                                } );
                        }
 
                        selectedFilterNames = [];
                        for ( i = 0; i < data.filters.length; i++ ) {
-                               excludedFilters = data.filters[ i ].excludes || [];
-
-                               filterItem = new mw.rcfilters.dm.FilterItem( data.filters[ i ].name, {
+                               filterItem = new mw.rcfilters.dm.FilterItem( data.filters[ i ].name, model.groups[ group ], {
                                        group: group,
                                        label: data.filters[ i ].label,
                                        description: data.filters[ i ].description,
-                                       selected: data.filters[ i ].selected,
-                                       excludes: excludedFilters,
-                                       'default': data.filters[ i ].default
+                                       subset: data.filters[ i ].subset
                                } );
 
-                               // Map filters and what excludes them
-                               addToMap( excludedFilters );
+                               // For convenience, we should store each filter's "supersets" -- these are
+                               // the filters that have that item in their subset list. This will just
+                               // make it easier to go through whether the item has any other items
+                               // that affect it (and are selected) at any given time
+                               if ( data.filters[ i ].subset ) {
+                                       data.filters[ i ].subset.forEach( function ( subsetFilterName ) { // eslint-disable-line no-loop-func
+                                               supersetMap[ subsetFilterName ] = supersetMap[ subsetFilterName ] || [];
+                                               addArrayElementsUnique(
+                                                       supersetMap[ subsetFilterName ],
+                                                       filterItem.getName()
+                                               );
+                                       } );
+                               }
+
+                               // Conflicts are bi-directional, which means FilterA can define having
+                               // a conflict with FilterB, and this conflict should appear in **both**
+                               // filter definitions.
+                               // We need to remap all the 'conflicts' so they reflect the entire state
+                               // in either direction regardless of which filter defined the other as conflicting.
+                               if ( data.filters[ i ].conflicts ) {
+                                       conflictMap[ filterItem.getName() ] = conflictMap[ filterItem.getName() ] || [];
+                                       addArrayElementsUnique(
+                                               conflictMap[ filterItem.getName() ],
+                                               data.filters[ i ].conflicts
+                                       );
+
+                                       data.filters[ i ].conflicts.forEach( function ( conflictingFilterName ) { // eslint-disable-line no-loop-func
+                                               // Add this filter to the conflicts of each of the filters in its list
+                                               conflictMap[ conflictingFilterName ] = conflictMap[ conflictingFilterName ] || [];
+                                               addArrayElementsUnique(
+                                                       conflictMap[ conflictingFilterName ],
+                                                       filterItem.getName()
+                                               );
+                                       } );
+                               }
 
                                if ( data.type === 'send_unselected_if_any' ) {
                                        // Store the default parameter state
                        }
                } );
 
+               items.forEach( function ( filterItem ) {
+                       // Apply conflict map to the items
+                       // Now that we mapped all items and conflicts bi-directionally
+                       // we need to apply the definition to each filter again
+                       filterItem.setConflicts( conflictMap[ filterItem.getName() ] );
+
+                       // Apply the superset map
+                       filterItem.setSuperset( supersetMap[ filterItem.getName() ] );
+               } );
+
+               // Add items to the model
                this.addItems( items );
 
                this.emit( 'initialize' );
                return this.groups;
        };
 
-       /**
-        * Update the representation of the parameters. These are the back-end
-        * parameters representing the filters, but they represent the given
-        * current state regardless of validity.
-        *
-        * This should only run after filters are already set.
-        *
-        * @param {Object} params Parameter state
-        */
-       mw.rcfilters.dm.FiltersViewModel.prototype.updateParameters = function ( params ) {
-               var model = this;
-
-               $.each( params, function ( name, value ) {
-                       // Only store the parameters that exist in the system
-                       if ( model.getItemByName( name ) ) {
-                               model.parameters[ name ] = value;
-                       }
-               } );
-       };
-
        /**
         * Get the value of a specific parameter
         *
                for ( i = 0; i < items.length; i++ ) {
                        result[ items[ i ].getName() ] = {
                                selected: items[ i ].isSelected(),
-                               active: items[ i ].isActive()
+                               conflicted: items[ i ].isConflicted(),
+                               included: items[ i ].isIncluded()
                        };
                }
 
                        filterItem = model.getItemByName( paramName );
                        // Ignore if no filter item exists
                        if ( filterItem ) {
-                               groupMap[ filterItem.getGroup() ] = groupMap[ filterItem.getGroup() ] || {};
+                               groupMap[ filterItem.getGroupName() ] = groupMap[ filterItem.getGroupName() ] || {};
 
                                // Mark the group if it has any items that are selected
-                               groupMap[ filterItem.getGroup() ].hasSelected = (
-                                       groupMap[ filterItem.getGroup() ].hasSelected ||
+                               groupMap[ filterItem.getGroupName() ].hasSelected = (
+                                       groupMap[ filterItem.getGroupName() ].hasSelected ||
                                        !!Number( paramValue )
                                );
 
                                // Add the relevant filter into the group map
-                               groupMap[ filterItem.getGroup() ].filters = groupMap[ filterItem.getGroup() ].filters || [];
-                               groupMap[ filterItem.getGroup() ].filters.push( filterItem );
+                               groupMap[ filterItem.getGroupName() ].filters = groupMap[ filterItem.getGroupName() ].filters || [];
+                               groupMap[ filterItem.getGroupName() ].filters.push( filterItem );
                        } else if ( model.groups.hasOwnProperty( paramName ) ) {
                                // This parameter represents a group (values are the filters)
                                // this is equivalent to checking if the group is 'string_options'
                // item label starting with the query string
                for ( i = 0; i < items.length; i++ ) {
                        if ( items[ i ].getLabel().toLowerCase().indexOf( query ) === 0 ) {
-                               result[ items[ i ].getGroup() ] = result[ items[ i ].getGroup() ] || [];
-                               result[ items[ i ].getGroup() ].push( items[ i ] );
+                               result[ items[ i ].getGroupName() ] = result[ items[ i ].getGroupName() ] || [];
+                               result[ items[ i ].getGroupName() ].push( items[ i ] );
                        }
                }
 
                if ( $.isEmptyObject( result ) ) {
                        // item containing the query string in their label, description, or group title
                        for ( i = 0; i < items.length; i++ ) {
-                               groupTitle = this.getGroup( items[ i ].getGroup() ).getTitle();
+                               groupTitle = items[ i ].getGroupModel().getTitle();
                                if (
                                        items[ i ].getLabel().toLowerCase().indexOf( query ) > -1 ||
                                        items[ i ].getDescription().toLowerCase().indexOf( query ) > -1 ||
                                        groupTitle.toLowerCase().indexOf( query ) > -1
                                ) {
-                                       result[ items[ i ].getGroup() ] = result[ items[ i ].getGroup() ] || [];
-                                       result[ items[ i ].getGroup() ].push( items[ i ] );
+                                       result[ items[ i ].getGroupName() ] = result[ items[ i ].getGroupName() ] || [];
+                                       result[ items[ i ].getGroupName() ].push( items[ i ] );
                                }
                        }
                }
index 88f32b4..ff34bb8 100644 (file)
 
        /**
         * Initialize the filter and parameter states
+        *
+        * @param {Object} filterStructure Filter definition and structure for the model
         */
-       mw.rcfilters.Controller.prototype.initialize = function () {
-               this.updateFromURL();
-       };
-
-       /**
-        * Update the model state based on the URL parameters.
-        */
-       mw.rcfilters.Controller.prototype.updateFromURL = function () {
+       mw.rcfilters.Controller.prototype.initialize = function ( filterStructure ) {
                var uri = new mw.Uri();
 
+               // Initialize the model
+               this.filtersModel.initializeFilters( filterStructure );
+
+               // Set filter states based on defaults and URL params
                this.filtersModel.updateFilters(
-                       // Translate the url params to filter select states
-                       this.filtersModel.getFiltersFromParameters( uri.query )
+                       this.filtersModel.getFiltersFromParameters(
+                               // Merge defaults with URL params for initialization
+                               $.extend(
+                                       true,
+                                       {},
+                                       this.filtersModel.getDefaultParams(),
+                                       // URI query overrides defaults
+                                       uri.query
+                               )
+                       )
                );
+
+               // Check all filter interactions
+               this.filtersModel.reassessFilterInteractions();
        };
 
        /**
                var obj = {};
 
                obj[ filterName ] = isSelected;
+
                this.filtersModel.updateFilters( obj );
                this.updateURL();
                this.updateChangesList();
+
+               // Check filter interactions
+               this.filtersModel.reassessFilterInteractions( this.filtersModel.getItemByName( filterName ) );
        };
 
        /**
index ef0489c..61df2e8 100644 (file)
                        new mw.rcfilters.ui.FormWrapperWidget(
                                changesListModel, $( '.rcoptions form' ) );
 
-                       filtersModel.initializeFilters( {
+                       controller.initialize( {
                                registration: {
                                        title: mw.msg( 'rcfilters-filtergroup-registration' ),
                                        type: 'send_unselected_if_any',
+                                       fullCoverage: true,
                                        filters: [
                                                {
                                                        name: 'hideliu',
                                        // ** In this case, the parameter name is the group name. **
                                        type: 'string_options',
                                        separator: ',',
+                                       fullCoverage: false,
                                        filters: [
                                                {
                                                        name: 'newcomer',
                                                        label: mw.msg( 'rcfilters-filter-userExpLevel-newcomer-label' ),
-                                                       description: mw.msg( 'rcfilters-filter-userExpLevel-newcomer-description' )
+                                                       description: mw.msg( 'rcfilters-filter-userExpLevel-newcomer-description' ),
+                                                       conflicts: [ 'hideanons' ]
                                                },
                                                {
                                                        name: 'learner',
                                                        label: mw.msg( 'rcfilters-filter-userExpLevel-learner-label' ),
-                                                       description: mw.msg( 'rcfilters-filter-userExpLevel-learner-description' )
+                                                       description: mw.msg( 'rcfilters-filter-userExpLevel-learner-description' ),
+                                                       conflicts: [ 'hideanons' ]
                                                },
                                                {
                                                        name: 'experienced',
                                                        label: mw.msg( 'rcfilters-filter-userExpLevel-experienced-label' ),
-                                                       description: mw.msg( 'rcfilters-filter-userExpLevel-experienced-description' )
+                                                       description: mw.msg( 'rcfilters-filter-userExpLevel-experienced-description' ),
+                                                       conflicts: [ 'hideanons' ]
                                                }
                                        ]
                                },
@@ -80,6 +85,7 @@
                                        // the functionality to the UI, whether we are dealing with 2
                                        // parameters in the group or more.
                                        type: 'send_unselected_if_any',
+                                       fullCoverage: true,
                                        filters: [
                                                {
                                                        name: 'hidemyself',
                                automated: {
                                        title: mw.msg( 'rcfilters-filtergroup-automated' ),
                                        type: 'send_unselected_if_any',
+                                       fullCoverage: true,
                                        filters: [
                                                {
                                                        name: 'hidebots',
                                significance: {
                                        title: mw.msg( 'rcfilters-filtergroup-significance' ),
                                        type: 'send_unselected_if_any',
+                                       fullCoverage: true,
                                        filters: [
                                                {
                                                        name: 'hideminor',
                                changetype: {
                                        title: mw.msg( 'rcfilters-filtergroup-changetype' ),
                                        type: 'send_unselected_if_any',
+                                       fullCoverage: true,
                                        filters: [
                                                {
                                                        name: 'hidepageedits',
                        $( '.rcoptions' ).before( filtersWidget.$element );
                        $( 'body' ).append( $overlay );
 
-                       // Initialize values
-                       controller.initialize();
-
                        // HACK: Remove old-style filter links for filters handled by the widget
                        // Ideally the widget would handle all filters and we'd just remove .rcshowhide entirely
                        $( '.rcshowhide' ).children().each( function () {
index 4ea88b5..8a9ad54 100644 (file)
@@ -7,4 +7,8 @@
                // Fix the positioning of the popup itself
                margin-top: 1em;
        }
+
+       &-muted {
+               opacity: 0.5;
+       }
 }
index c409d58..6c11cdb 100644 (file)
                color: #54595d;
        }
 
-       &-item-inactive {
-               opacity: 0.5;
-       }
-
        &-emptyFilters {
                color: #72777d;
        }
index 9f9e6fc..a874416 100644 (file)
@@ -20,7 +20,7 @@
                margin: 0 !important;
        }
 
-       &-inactive {
+       &-muted {
                opacity: 0.5;
        }
 }
index ca47f16..525f718 100644 (file)
@@ -57,6 +57,8 @@
                        .addClass( 'mw-rcfilters-ui-capsuleItemWidget' )
                        .on( 'mouseover', this.onHover.bind( this, true ) )
                        .on( 'mouseout', this.onHover.bind( this, false ) );
+
+               this.setCurrentMuteState();
        };
 
        OO.inheritClass( mw.rcfilters.ui.CapsuleItemWidget, OO.ui.CapsuleItemWidget );
         * Respond to model update event
         */
        mw.rcfilters.ui.CapsuleItemWidget.prototype.onModelUpdate = function () {
-               // Deal with active/inactive capsule filter items
+               this.setCurrentMuteState();
+       };
+
+       /**
+        * Set the current mute state for this item
+        */
+       mw.rcfilters.ui.CapsuleItemWidget.prototype.setCurrentMuteState = function () {
                this.$element
                        .toggleClass(
-                               'mw-rcfilters-ui-filterCapsuleMultiselectWidget-item-inactive',
-                               !this.model.isActive()
+                               'mw-rcfilters-ui-capsuleItemWidget-muted',
+                               this.model.isIncluded() ||
+                               this.model.isConflicted() ||
+                               this.model.isFullyCovered()
                        );
        };
 
index f9829d4..9bf26d1 100644 (file)
@@ -48,6 +48,7 @@
                // Event
                this.checkboxWidget.connect( this, { userChange: 'onCheckboxChange' } );
                this.model.connect( this, { update: 'onModelUpdate' } );
+               this.model.getGroupModel().connect( this, { update: 'onGroupModelUpdate' } );
 
                this.$element
                        .addClass( 'mw-rcfilters-ui-filterItemWidget' )
        mw.rcfilters.ui.FilterItemWidget.prototype.onModelUpdate = function () {
                this.checkboxWidget.setSelected( this.model.isSelected() );
 
+               this.setCurrentMuteState();
+       };
+
+       /**
+        * Respond to item group model update event
+        */
+       mw.rcfilters.ui.FilterItemWidget.prototype.onGroupModelUpdate = function () {
+               this.setCurrentMuteState();
+       };
+
+       /**
+        * Set the current mute state for this item
+        */
+       mw.rcfilters.ui.FilterItemWidget.prototype.setCurrentMuteState = function () {
                this.$element.toggleClass(
-                       'mw-rcfilters-ui-filterItemWidget-inactive',
-                       !this.model.isActive()
+                       'mw-rcfilters-ui-filterItemWidget-muted',
+                       this.model.isConflicted() ||
+                       this.model.isIncluded() ||
+                       this.model.isFullyCovered() ||
+                       (
+                               // Item is also muted when any of the items in its group is active
+                               this.model.getGroupModel().isActive() &&
+                               // But it isn't selected
+                               !this.model.isSelected()
+                       )
                );
        };
-
        /**
         * Get the name of this filter
         *
index ad58583..c989c83 100644 (file)
                                                                                booklet.setPage( '|results|' );
                                                                        } ).setDisabled( !paramsAreForced ) ).$element,
                                                                        new OO.ui.PopupButtonWidget( {
+                                                                               $overlay: $( '#mw-apisandbox-ui' ),
                                                                                framed: false,
                                                                                icon: 'info',
                                                                                popup: {
index fceeb64..4df2df7 100644 (file)
@@ -8,6 +8,7 @@
  * @singleton
  */
 
+/* global mwNow */
 /* eslint-disable no-use-before-define */
 
 ( function ( $ ) {
                 *
                 * @return {number} Current time
                 */
-               now: ( function () {
-                       var perf = window.performance,
-                               navStart = perf && perf.timing && perf.timing.navigationStart;
-                       return navStart && typeof perf.now === 'function' ?
-                               function () { return navStart + perf.now(); } :
-                               function () { return +new Date(); };
-               }() ),
+               now: mwNow,
+               // mwNow is defined in startup.js
 
                /**
                 * Format a string. Replace $1, $2 ... $N with positional arguments.
                        return $.when.apply( $, all );
                } );
                loading.then( function () {
+                       /* global mwPerformance */
                        mwPerformance.mark( 'mwLoadEnd' );
                        mw.hook( 'resourceloader.loadEnd' ).fire();
                } );
index 20818d2..deb280a 100644 (file)
@@ -6,11 +6,19 @@
 
 /* global mw, $VARS, $CODE */
 
-// eslint-disable-next-line no-unused-vars
-var mediaWikiLoadStart = ( new Date() ).getTime(),
-       mwPerformance = ( window.performance && performance.mark ) ? performance : {
+var mwPerformance = ( window.performance && performance.mark ) ? performance : {
                mark: function () {}
-       };
+       },
+       // Define now() here to ensure valid comparison with mediaWikiLoadEnd (T153819).
+       mwNow = ( function () {
+               var perf = window.performance,
+                       navStart = perf && perf.timing && perf.timing.navigationStart;
+               return navStart && typeof perf.now === 'function' ?
+                       function () { return navStart + perf.now(); } :
+                       function () { return +new Date(); };
+       }() ),
+       // eslint-disable-next-line no-unused-vars
+       mediaWikiLoadStart = mwNow();
 
 mwPerformance.mark( 'mwLoadStart' );
 
index 1524b78..f54170b 100644 (file)
@@ -27,6 +27,7 @@
 
 use Wikimedia\Rdbms\TransactionProfiler;
 use Wikimedia\Rdbms\DatabaseDomain;
+use Wikimedia\Rdbms\MySQLMasterPos;
 
 /**
  * Fake class around abstract class so we can call concrete methods.
index 92c8add..4b857ce 100644 (file)
@@ -3,6 +3,7 @@
 use Wikimedia\Rdbms\LBFactorySimple;
 use Wikimedia\Rdbms\LBFactoryMulti;
 use Wikimedia\Rdbms\ChronologyProtector;
+use Wikimedia\Rdbms\MySQLMasterPos;
 
 /**
  * Holds tests for LBFactory abstract MediaWiki class.
index 998817d..49a5b18 100644 (file)
                                group1: {
                                        title: 'Group 1',
                                        type: 'send_unselected_if_any',
-                                       exclusionType: 'default',
                                        filters: [
                                                {
                                                        name: 'hidefilter1',
                                        ]
                                }
                        },
+                       defaultFilterRepresentation = {
+                               // Group 1 and 2, "send_unselected_if_any", the values of the filters are "flipped" from the values of the parameters
+                               hidefilter1: false,
+                               hidefilter2: true,
+                               hidefilter3: false,
+                               hidefilter4: true,
+                               hidefilter5: false,
+                               hidefilter6: true
+                       },
                        model = new mw.rcfilters.dm.FiltersViewModel();
 
                model.initializeFilters( definition );
 
                assert.deepEqual(
-                       model.getFullState(),
+                       model.getSelectedState(),
                        {
-                               // Group 1
-                               hidefilter1: { selected: true, active: true },
-                               hidefilter2: { selected: false, active: true },
-                               hidefilter3: { selected: true, active: true },
-                               // Group 2
-                               hidefilter4: { selected: false, active: true },
-                               hidefilter5: { selected: true, active: true },
-                               hidefilter6: { selected: false, active: true },
+                               hidefilter1: false,
+                               hidefilter2: false,
+                               hidefilter3: false,
+                               hidefilter4: false,
+                               hidefilter5: false,
+                               hidefilter6: false
                        },
-                       'Initial state: all filters are active, and select states are default.'
+                       'Initial state: default filters are not selected (controller selects defaults explicitly).'
                );
 
-               // Default behavior for 'exclusion' type with only 1 item selected, means that:
-               // - The items in the same group that are *not* selected are *not* active
-               // - Items in other groups are unaffected (all active)
                model.updateFilters( {
                        hidefilter1: false,
-                       hidefilter2: false,
-                       hidefilter3: false,
-                       hidefilter4: false,
-                       hidefilter5: false,
-                       hidefilter6: true
+                       hidefilter3: false
                } );
-               assert.deepEqual(
-                       model.getFullState(),
-                       {
-                               // Group 1: not affected
-                               hidefilter1: { selected: false, active: true },
-                               hidefilter2: { selected: false, active: true },
-                               hidefilter3: { selected: false, active: true },
-                               // Group 2: affected
-                               hidefilter4: { selected: false, active: false },
-                               hidefilter5: { selected: false, active: false },
-                               hidefilter6: { selected: true, active: true },
-                       },
-                       'Default exclusion behavior with 1 item selected in the group.'
-               );
 
-               // Default behavior for 'exclusion' type with multiple items selected, but not all, means that:
-               // - The items in the same group that are *not* selected are *not* active
-               // - Items in other groups are unaffected (all active)
-               model.updateFilters( {
-                       // Literally updating filters to create a clean state
-                       hidefilter1: false,
-                       hidefilter2: false,
-                       hidefilter3: false,
-                       hidefilter4: false,
-                       hidefilter5: true,
-                       hidefilter6: true
-               } );
-               assert.deepEqual(
-                       model.getFullState(),
-                       {
-                               // Group 1: not affected
-                               hidefilter1: { selected: false, active: true },
-                               hidefilter2: { selected: false, active: true },
-                               hidefilter3: { selected: false, active: true },
-                               // Group 2: affected
-                               hidefilter4: { selected: false, active: false },
-                               hidefilter5: { selected: true, active: true },
-                               hidefilter6: { selected: true, active: true },
-                       },
-                       'Default exclusion behavior with multiple items (but not all) selected in the group.'
-               );
+               model.setFiltersToDefaults();
 
-               // Default behavior for 'exclusion' type with all items in the group selected, means that:
-               // - All items in the group are NOT active
-               // - Items in other groups are unaffected (all active)
-               model.updateFilters( {
-                       // Literally updating filters to create a clean state
-                       hidefilter1: false,
-                       hidefilter2: false,
-                       hidefilter3: false,
-                       hidefilter4: true,
-                       hidefilter5: true,
-                       hidefilter6: true
-               } );
                assert.deepEqual(
-                       model.getFullState(),
-                       {
-                               // Group 1: not affected
-                               hidefilter1: { selected: false, active: true },
-                               hidefilter2: { selected: false, active: true },
-                               hidefilter3: { selected: false, active: true },
-                               // Group 2: affected
-                               hidefilter4: { selected: true, active: false },
-                               hidefilter5: { selected: true, active: false },
-                               hidefilter6: { selected: true, active: false },
-                       },
-                       'Default exclusion behavior with all items in the group.'
+                       model.getSelectedState(),
+                       defaultFilterRepresentation,
+                       'Changing values of filters and then returning to defaults still results in default filters being selected.'
                );
        } );
 
-       QUnit.test( 'reapplyActiveFilters - "explicit" exclusion rules', function ( assert ) {
+       QUnit.test( 'Filter interaction: subsets', function ( assert ) {
                var definition = {
                                group1: {
                                        title: 'Group 1',
-                                       type: 'send_unselected_if_any',
-                                       exclusionType: 'explicit',
+                                       type: 'string_options',
                                        filters: [
                                                {
                                                        name: 'filter1',
-                                                       excludes: [ 'filter2', 'filter3' ],
                                                        label: 'Show filter 1',
-                                                       description: 'Description of Filter 1 in Group 1'
+                                                       description: 'Description of Filter 1 in Group 1',
+                                                       subset: [ 'filter2', 'filter5' ]
                                                },
                                                {
                                                        name: 'filter2',
-                                                       excludes: [ 'filter3' ],
                                                        label: 'Show filter 2',
                                                        description: 'Description of Filter 2 in Group 1'
                                                },
                                                {
                                                        name: 'filter3',
                                                        label: 'Show filter 3',
-                                                       excludes: [ 'filter1' ],
                                                        description: 'Description of Filter 3 in Group 1'
-                                               },
+                                               }
+                                       ]
+                               },
+                               group2: {
+                                       title: 'Group 2',
+                                       type: 'send_unselected_if_any',
+                                       filters: [
                                                {
                                                        name: 'filter4',
                                                        label: 'Show filter 4',
-                                                       description: 'Description of Filter 4 in Group 1'
+                                                       description: 'Description of Filter 1 in Group 2',
+                                                       subset: [ 'filter3', 'filter5' ]
+                                               },
+                                               {
+                                                       name: 'filter5',
+                                                       label: 'Show filter 5',
+                                                       description: 'Description of Filter 2 in Group 2'
+                                               },
+                                               {
+                                                       name: 'filter6',
+                                                       label: 'Show filter 6',
+                                                       description: 'Description of Filter 3 in Group 2'
                                                }
                                        ]
                                }
                        },
-                       defaultFilterRepresentation = {
-                               // Group 1 and 2, "send_unselected_if_any", the values of the filters are "flipped" from the values of the parameters
-                               hidefilter1: false,
-                               hidefilter2: true,
-                               hidefilter3: false,
-                               hidefilter4: true,
-                               hidefilter5: false,
-                               hidefilter6: true,
-                               // Group 3, "string_options", default values correspond to parameters and filters
-                               filter7: false,
-                               filter8: true,
-                               filter9: false
+                       baseFullState = {
+                               filter1: { selected: false, conflicted: false, included: false },
+                               filter2: { selected: false, conflicted: false, included: false },
+                               filter3: { selected: false, conflicted: false, included: false },
+                               filter4: { selected: false, conflicted: false, included: false },
+                               filter5: { selected: false, conflicted: false, included: false },
+                               filter6: { selected: false, conflicted: false, included: false }
                        },
                        model = new mw.rcfilters.dm.FiltersViewModel();
 
                model.initializeFilters( definition );
+               // Select a filter that has subset with another filter
+               model.updateFilters( {
+                       filter1: true
+               } );
 
+               model.reassessFilterInteractions( model.getItemByName( 'filter1' ) );
                assert.deepEqual(
                        model.getFullState(),
-                       {
-                               filter1: { selected: false, active: true },
-                               filter2: { selected: false, active: true },
-                               filter3: { selected: false, active: true },
-                               filter4: { selected: false, active: true }
-                       },
-                       'Initial state: all filters are active.'
+                       $.extend( true, {}, baseFullState, {
+                               filter1: { selected: true },
+                               filter2: { included: true },
+                               filter5: { included: true }
+                       } ),
+                       'Filters with subsets are represented in the model.'
                );
 
-               // "Explicit" behavior for 'exclusion' with one item checked:
-               // - Items in the 'excluded' list of the selected filter are inactive
+               // Select another filter that has a subset with the same previous filter
                model.updateFilters( {
-                       // Literally updating filters to create a clean state
-                       filter1: true, // Excludes 'hidefilter2', 'hidefilter3'
-                       filter2: false, // Excludes 'hidefilter3'
-                       filter3: false, // Excludes 'hidefilter1'
-                       filter4: false // No exclusion list
+                       filter4: true
                } );
+               model.reassessFilterInteractions( model.getItemByName( 'filter4' ) );
                assert.deepEqual(
                        model.getFullState(),
-                       {
-                               filter1: { selected: true, active: true },
-                               filter2: { selected: false, active: false },
-                               filter3: { selected: false, active: false },
-                               filter4: { selected: false, active: true }
-                       },
-                       '"Explicit" exclusion behavior with one item selected that has an exclusion list.'
+                       $.extend( true, {}, baseFullState, {
+                               filter1: { selected: true },
+                               filter2: { included: true },
+                               filter3: { included: true },
+                               filter4: { selected: true },
+                               filter5: { included: true }
+                       } ),
+                       'Filters that have multiple subsets are represented.'
                );
 
-               // "Explicit" behavior for 'exclusion' with two item checked:
-               // - Items in the 'excluded' list of each of the selected filter are inactive
+               // Remove one filter (but leave the other) that affects filter2
                model.updateFilters( {
-                       // Literally updating filters to create a clean state
-                       filter1: true, // Excludes 'hidefilter2', 'hidefilter3'
-                       filter2: false, // Excludes 'hidefilter3'
-                       filter3: true, // Excludes 'hidefilter1'
-                       filter4: false // No exclusion list
+                       filter1: false
                } );
+               model.reassessFilterInteractions( model.getItemByName( 'filter1' ) );
                assert.deepEqual(
                        model.getFullState(),
-                       {
-                               filter1: { selected: true, active: false },
-                               filter2: { selected: false, active: false },
-                               filter3: { selected: true, active: false },
-                               filter4: { selected: false, active: true }
+                       $.extend( true, {}, baseFullState, {
+                               filter2: { included: false },
+                               filter3: { included: true },
+                               filter4: { selected: true },
+                               filter5: { included: true }
+                       } ),
+                       'Removing a filter only un-includes its subset if there is no other filter affecting.'
+               );
+
+               model.updateFilters( {
+                       filter4: false
+               } );
+               model.reassessFilterInteractions( model.getItemByName( 'filter4' ) );
+               assert.deepEqual(
+                       model.getFullState(),
+                       baseFullState,
+                       'Removing all supersets also un-includes the subsets.'
+               );
+       } );
+
+       QUnit.test( 'Filter interaction: full coverage', function ( assert ) {
+               var definition = {
+                               group1: {
+                                       title: 'Group 1',
+                                       type: 'string_options',
+                                       fullCoverage: false,
+                                       filters: [
+                                               { name: 'filter1' },
+                                               { name: 'filter2' },
+                                               { name: 'filter3' },
+                                       ]
+                               },
+                               group2: {
+                                       title: 'Group 2',
+                                       type: 'send_unselected_if_any',
+                                       fullCoverage: true,
+                                       filters: [
+                                               { name: 'filter4' },
+                                               { name: 'filter5' },
+                                               { name: 'filter6' },
+                                       ]
+                               }
                        },
-                       '"Explicit" exclusion behavior with two selected items that both have an exclusion list.'
+                       isCapsuleItemMuted = function ( filterName ) {
+                               var itemModel = model.getItemByName( filterName ),
+                                       groupModel = itemModel.getGroupModel();
+
+                               // This is the logic inside the capsule widget
+                               return (
+                                       // The capsule item widget only appears if the item is selected
+                                       itemModel.isSelected() &&
+                                       // Muted state is only valid if group is full coverage and all items are selected
+                                       groupModel.isFullCoverage() && groupModel.areAllSelected()
+                               );
+                       },
+                       getCurrentItemsMutedState = function () {
+                               return {
+                                       filter1: isCapsuleItemMuted( 'filter1' ),
+                                       filter2: isCapsuleItemMuted( 'filter2' ),
+                                       filter3: isCapsuleItemMuted( 'filter3' ),
+                                       filter4: isCapsuleItemMuted( 'filter4' ),
+                                       filter5: isCapsuleItemMuted( 'filter5' ),
+                                       filter6: isCapsuleItemMuted( 'filter6' )
+                               };
+                       },
+                       baseMuteState = {
+                               filter1: false,
+                               filter2: false,
+                               filter3: false,
+                               filter4: false,
+                               filter5: false,
+                               filter6: false
+                       },
+                       model = new mw.rcfilters.dm.FiltersViewModel();
+
+               model.initializeFilters( definition );
+
+               // Starting state, no selection, all items are non-muted
+               assert.deepEqual(
+                       getCurrentItemsMutedState(),
+                       baseMuteState,
+                       'No selection - all items are non-muted'
+               );
+
+               // Select most (but not all) items in each group
+               model.updateFilters( {
+                       filter1: true,
+                       filter2: true,
+                       filter4: true,
+                       filter5: true
+               } );
+
+               // Both groups have multiple (but not all) items selected, all items are non-muted
+               assert.deepEqual(
+                       getCurrentItemsMutedState(),
+                       baseMuteState,
+                       'Not all items in the group selected - all items are non-muted'
                );
 
-               // "Explicit behavior" with two filters that exclude the same item
+               // Select all items in 'fullCoverage' group (group2)
+               model.updateFilters( {
+                       filter6: true
+               } );
+
+               // Group2 (full coverage) has all items selected, all its items are muted
+               assert.deepEqual(
+                       getCurrentItemsMutedState(),
+                       $.extend( {}, baseMuteState, {
+                               filter4: true,
+                               filter5: true,
+                               filter6: true
+                       } ),
+                       'All items in \'full coverage\' group are selected - all items in the group are muted'
+               );
 
-               // Two filters selected, both exclude 'hidefilter3'
+               // Select all items in non 'fullCoverage' group (group1)
                model.updateFilters( {
-                       // Literally updating filters to create a clean state
-                       filter1: true, // Excludes 'hidefilter2', 'hidefilter3'
-                       filter2: true, // Excludes 'hidefilter3'
-                       filter3: false, // Excludes 'hidefilter1'
-                       filter4: false // No exclusion list
+                       filter3: true
                } );
+
+               // Group1 (full coverage) has all items selected, no items in it are muted (non full coverage)
                assert.deepEqual(
-                       model.getFullState(),
-                       {
-                               filter1: { selected: true, active: true },
-                               filter2: { selected: true, active: false }, // Excluded by filter1
-                               filter3: { selected: false, active: false }, // Excluded by both filter1 and filter2
-                               filter4: { selected: false, active: true }
+                       getCurrentItemsMutedState(),
+                       $.extend( {}, baseMuteState, {
+                               filter4: true,
+                               filter5: true,
+                               filter6: true
+                       } ),
+                       'All items in a non \'full coverage\' group are selected - none of the items in the group are muted'
+               );
+
+               // Uncheck an item from each group
+               model.updateFilters( {
+                       filter3: false,
+                       filter5: false
+               } );
+               assert.deepEqual(
+                       getCurrentItemsMutedState(),
+                       baseMuteState,
+                       'Not all items in the group are checked - all items are non-muted regardless of group coverage'
+               );
+       } );
+
+       QUnit.test( 'Filter interaction: conflicts', function ( assert ) {
+               var definition = {
+                               group1: {
+                                       title: 'Group 1',
+                                       type: 'string_options',
+                                       filters: [
+                                               {
+                                                       name: 'filter1',
+                                                       conflicts: [ 'filter2', 'filter4' ]
+                                               },
+                                               {
+                                                       name: 'filter2',
+                                                       conflicts: [ 'filter6' ]
+                                               },
+                                               {
+                                                       name: 'filter3'
+                                               }
+                                       ]
+                               },
+                               group2: {
+                                       title: 'Group 2',
+                                       type: 'send_unselected_if_any',
+                                       filters: [
+                                               {
+                                                       name: 'filter4'
+                                               },
+                                               {
+                                                       name: 'filter5',
+                                                       conflicts: [ 'filter3' ]
+                                               },
+                                               {
+                                                       name: 'filter6',
+                                               }
+                                       ]
+                               }
                        },
-                       '"Explicit" exclusion behavior with two selected items that both exclude another item.'
+                       baseFullState = {
+                               filter1: { selected: false, conflicted: false, included: false },
+                               filter2: { selected: false, conflicted: false, included: false },
+                               filter3: { selected: false, conflicted: false, included: false },
+                               filter4: { selected: false, conflicted: false, included: false },
+                               filter5: { selected: false, conflicted: false, included: false },
+                               filter6: { selected: false, conflicted: false, included: false }
+                       },
+                       model = new mw.rcfilters.dm.FiltersViewModel();
+
+               model.initializeFilters( definition );
+
+               assert.deepEqual(
+                       model.getFullState(),
+                       baseFullState,
+                       'Initial state: no conflicts because no selections.'
                );
 
-               // Unselect filter2: filter3 should still be excluded, because filter1 excludes it and is selected
+               // Select a filter that has a conflict with another
                model.updateFilters( {
-                       filter2: false, // Excludes 'hidefilter3'
+                       filter1: true // conflicts: filter2, filter4
                } );
+
+               model.reassessFilterInteractions( model.getItemByName( 'filter1' ) );
+
                assert.deepEqual(
                        model.getFullState(),
-                       {
-                               filter1: { selected: true, active: true },
-                               filter2: { selected: false, active: false }, // Excluded by filter1
-                               filter3: { selected: false, active: false }, // Still excluded by filter1
-                               filter4: { selected: false, active: true }
-                       },
-                       '"Explicit" exclusion behavior unselecting one item that excludes another item, that is being excluded by a third active item.'
+                       $.extend( true, {}, baseFullState, {
+                               filter1: { selected: true },
+                               filter2: { conflicted: true },
+                               filter4: { conflicted: true },
+                       } ),
+                       'Selecting a filter set its conflicts list as "conflicted".'
                );
 
-               // Unselect filter1: filter3 should now be active, since both filters that exclude it are unselected
+               // Select one of the conflicts (both filters are now conflicted and selected)
                model.updateFilters( {
-                       filter1: false, // Excludes 'hidefilter3' and 'hidefilter2'
+                       filter4: true // conflicts: filter 1
                } );
+               model.reassessFilterInteractions( model.getItemByName( 'filter4' ) );
+
                assert.deepEqual(
                        model.getFullState(),
-                       {
-                               filter1: { selected: false, active: true },
-                               filter2: { selected: false, active: true }, // No longer excluded by filter1
-                               filter3: { selected: false, active: true }, // No longer excluded by either filter1 nor filter2
-                               filter4: { selected: false, active: true }
-                       },
-                       '"Explicit" exclusion behavior unselecting both items that excluded the same third item.'
+                       $.extend( true, {}, baseFullState, {
+                               filter1: { selected: true, conflicted: true },
+                               filter2: { conflicted: true },
+                               filter4: { selected: true, conflicted: true },
+                       } ),
+                       'Selecting a conflicting filter sets both sides to conflicted and selected.'
                );
 
+               // Select another filter from filter4 group, meaning:
+               // now filter1 no longer conflicts with filter4
+               model.updateFilters( {
+                       filter6: true // conflicts: filter2
+               } );
+               model.reassessFilterInteractions( model.getItemByName( 'filter6' ) );
+
+               assert.deepEqual(
+                       model.getFullState(),
+                       $.extend( true, {}, baseFullState, {
+                               filter1: { selected: true, conflicted: false }, // No longer conflicts (filter4 is not the only in the group)
+                               filter2: { conflicted: true }, // While not selected, still in conflict with filter1, which is selected
+                               filter4: { selected: true, conflicted: false }, // No longer conflicts with filter1
+                               filter6: { selected: true, conflicted: false }
+                       } ),
+                       'Selecting a non-conflicting filter from a conflicting group removes the conflict'
+               );
        } );
 }( mediaWiki, jQuery ) );
index bac8274..65b7263 100644 (file)
                );
        } );
 
+       QUnit.test( 'mw.now', function ( assert ) {
+               assert.equal( typeof mw.now(), 'number', 'Return a number' );
+               assert.equal(
+                       String( Math.round( mw.now() ) ).length,
+                       String( +new Date() ).length,
+                       'Match size of current timestamp'
+               );
+       } );
+
        QUnit.test( 'mw.Map', function ( assert ) {
                var arry, conf, funky, globalConf, nummy, someValues;