Merge "Clean up newWANCacheFromParams() getInstance() calls"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 24 Oct 2016 23:34:31 +0000 (23:34 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 24 Oct 2016 23:34:31 +0000 (23:34 +0000)
26 files changed:
docs/extension.schema.json
docs/extension.schema.v1.json
includes/Status.php
includes/api/i18n/en.json
includes/api/i18n/ja.json
includes/libs/StatusValue.php
includes/libs/rdbms/database/DatabasePostgres.php
includes/libs/rdbms/lbfactory/ILBFactory.php
includes/libs/rdbms/lbfactory/LBFactory.php
includes/libs/rdbms/lbfactory/LBFactoryMulti.php
includes/libs/rdbms/lbfactory/LBFactorySimple.php
includes/libs/rdbms/lbfactory/LBFactorySingle.php
includes/libs/rdbms/loadbalancer/LoadBalancerSingle.php
includes/registration/ExtensionRegistry.php
languages/Language.php
languages/i18n/ast.json
languages/i18n/es.json
languages/i18n/et.json
languages/i18n/ja.json
languages/i18n/ko.json
languages/i18n/nb.json
languages/i18n/pt.json
languages/i18n/zh-hans.json
maintenance/Maintenance.php
maintenance/update.php
tests/phpunit/includes/registration/ExtensionRegistryTest.php

index e408d03..2cf5fe1 100644 (file)
                                                        "type": "string",
                                                        "enum": [
                                                                "array_merge_recursive",
+                                                               "array_replace_recursive",
                                                                "array_plus_2d",
                                                                "array_plus",
                                                                "array_merge"
index 6d48a06..8659dff 100644 (file)
                                                        "type": "string",
                                                        "enum": [
                                                                "array_merge_recursive",
+                                                               "array_replace_recursive",
                                                                "array_plus_2d",
                                                                "array_plus",
                                                                "array_merge"
index 07828fe..a35af6e 100644 (file)
@@ -113,7 +113,7 @@ class Status extends StatusValue {
         *     1 => object(Status) # The Status with warning messages, only
         * ]
         *
-        * @return array
+        * @return Status[]
         */
        public function splitByErrorType() {
                list( $errorsOnlyStatus, $warningsOnlyStatus ) = parent::splitByErrorType();
index c20ed5d..fe73a56 100644 (file)
        "apihelp-options-description": "Change preferences of the current user.\n\nOnly options which are registered in core or in one of installed extensions, or options with keys prefixed with <code>userjs-</code> (intended to be used by user scripts), can be set.",
        "apihelp-options-param-reset": "Resets preferences to the site defaults.",
        "apihelp-options-param-resetkinds": "List of types of options to reset when the <var>$1reset</var> option is set.",
-       "apihelp-options-param-change": "List of changes, formatted name=value (e.g. skin=vector). Value cannot contain pipe characters. If no value is given (not even an equals sign), e.g., optionname|otheroption|..., the option will be reset to its default value.",
+       "apihelp-options-param-change": "List of changes, formatted name=value (e.g. skin=vector). If no value is given (not even an equals sign), e.g., optionname|otheroption|..., the option will be reset to its default value. If any value passed contains the pipe character (<kbd>|</kbd>), use the [[Special:ApiHelp/main#main/datatypes|alternative multiple-value separator]] for correct operation.",
        "apihelp-options-param-optionname": "The name of the option that should be set to the value given by <var>$1optionvalue</var>.",
-       "apihelp-options-param-optionvalue": "The value for the option specified by <var>$1optionname</var>, can contain pipe characters.",
+       "apihelp-options-param-optionvalue": "The value for the option specified by <var>$1optionname</var>.",
        "apihelp-options-example-reset": "Reset all preferences.",
        "apihelp-options-example-change": "Change <kbd>skin</kbd> and <kbd>hideminor</kbd> preferences.",
        "apihelp-options-example-complex": "Reset all preferences, then set <kbd>skin</kbd> and <kbd>nickname</kbd>.",
index 054ec02..3985dc1 100644 (file)
        "apihelp-protect-description": "ページの保護レベルを変更します。",
        "apihelp-protect-param-title": "保護(解除)するページ名です。$1pageid とは同時に使用できません。",
        "apihelp-protect-param-pageid": "保護(解除)するページIDです。$1title とは同時に使用できません。",
-       "apihelp-protect-param-protections": "<kbd>action=level</kbd> の形式 (例えば、<kbd>edit=sysop</kbd>) で整形された、保護レベルの一覧。\n\n<strong>注意: </strong> ここに列挙されなかった操作の制限は解除されます。",
+       "apihelp-protect-param-protections": "<kbd>action=level</kbd> の形式 (例えば、<kbd>edit=sysop</kbd>) で整形された、保護レベルの一覧。レベル <kbd>all</kbd> は誰もが操作できる、言い換えると制限が掛かっていないことを意味します。\n\n<strong>注意: </strong> ここに列挙されなかった操作の制限は解除されます。",
        "apihelp-protect-param-expiry": "有効期限です。タイムスタンプがひとつだけ指定された場合は、それがすべての保護に適用されます。無期限の保護を行う場合は<kbd>infinite</kbd>, <kbd>indefinite</kbd>, <kbd>infinity</kbd>, または <kbd>never</kbd> を指定します。",
        "apihelp-protect-param-reason": "保護(解除)の理由。",
        "apihelp-protect-param-tags": "保護記録の項目に適用する変更タグ。",
        "apihelp-query+siteinfo-paramvalue-prop-general": "システム全体の情報。",
        "apihelp-query+siteinfo-paramvalue-prop-specialpagealiases": "特別ページの別名の一覧。",
        "apihelp-query+siteinfo-paramvalue-prop-magicwords": "マジックワードとこれらの別名の一覧。",
+       "apihelp-query+siteinfo-param-numberingroup": "利用者グループに属する利用者の数を一覧表示します。",
        "apihelp-query+siteinfo-example-simple": "サイト情報を取得する。",
        "apihelp-query+tags-description": "変更タグを一覧表示します。",
        "apihelp-query+tags-param-limit": "一覧表示するタグの最大数。",
        "apihelp-query+usercontribs-param-tag": "このタグが付与された版のみを一覧表示する。",
        "apihelp-query+usercontribs-param-toponly": "最新の版である変更のみを一覧表示する。",
        "apihelp-query+usercontribs-example-user": "利用者 <kbd>Example</kbd> の投稿記録を表示する。",
+       "apihelp-query+usercontribs-example-ipprefix": "<kbd>192.0.2.</kbd> から始まるすべてのIPアドレスからの投稿記録を表示する。",
+       "apihelp-query+userinfo-description": "現在の利用者に関する情報を取得します。",
        "apihelp-query+userinfo-param-prop": "どの情報を結果に含めるか:",
        "apihelp-query+userinfo-paramvalue-prop-realname": "利用者の本名を追加します。",
        "apihelp-query+userinfo-example-simple": "現在の利用者に関する情報を取得します。",
index bff9abd..db085da 100644 (file)
@@ -88,7 +88,7 @@ class StatusValue {
         *         1 => object(StatusValue) # The StatusValue with warning messages, only
         * ]
         *
-        * @return array
+        * @return StatusValue[]
         */
        public function splitByErrorType() {
                $errorsOnlyStatusValue = clone $this;
@@ -160,7 +160,7 @@ class StatusValue {
         * @param mixed $value
         */
        public function setResult( $ok, $value = null ) {
-               $this->ok = $ok;
+               $this->ok = (bool)$ok;
                $this->value = $value;
        }
 
index 016b9cd..7acd8dc 100644 (file)
@@ -1087,7 +1087,7 @@ __INDEXATTR__;
                if ( !is_array( $types ) ) {
                        $types = [ $types ];
                }
-               if ( !$schema ) {
+               if ( $schema === false ) {
                        $schema = $this->getCoreSchema();
                }
                $table = $this->realTableName( $table, 'raw' );
@@ -1236,7 +1236,6 @@ SQL;
 
        function strencode( $s ) {
                // Should not be called by us
-
                return pg_escape_string( $this->getBindingHandle(), $s );
        }
 
index 9c9f18d..ff1bd43 100644 (file)
@@ -86,28 +86,25 @@ interface ILBFactory {
 
        /**
         * Create a new load balancer for external storage. The resulting object will be
-        * untracked, not chronology-protected, and the caller is responsible for
-        * cleaning it up.
+        * untracked, not chronology-protected, and the caller is responsible for cleaning it up.
         *
         * This method is for only advanced usage and callers should almost always use
         * getExternalLB() instead. This method can be useful when a table is used as a
         * key/value store. In that cases, one might want to query it in autocommit mode
         * (DBO_TRX off) but still use DBO_TRX transaction rounds on other tables.
         *
-        * @param string $cluster External storage cluster, or false for core
-        * @param bool|string $domain Domain ID, or false for the current domain
+        * @param string $cluster External storage cluster name
         * @return ILoadBalancer
         */
-       public function newExternalLB( $cluster, $domain = false );
+       public function newExternalLB( $cluster );
 
        /**
         * Get a cached (tracked) load balancer for external storage
         *
-        * @param string $cluster External storage cluster, or false for core
-        * @param bool|string $domain Domain ID, or false for the current domain
+        * @param string $cluster External storage cluster name
         * @return ILoadBalancer
         */
-       public function getExternalLB( $cluster, $domain = false );
+       public function getExternalLB( $cluster );
 
        /**
         * Execute a function for each tracked load balancer
index f3a3275..d21289b 100644 (file)
@@ -153,18 +153,16 @@ abstract class LBFactory implements ILBFactory {
        /**
         * @see ILBFactory::newExternalLB()
         * @param string $cluster
-        * @param bool $domain
         * @return LoadBalancer
         */
-       abstract public function newExternalLB( $cluster, $domain = false );
+       abstract public function newExternalLB( $cluster );
 
        /**
         * @see ILBFactory::getExternalLB()
         * @param string $cluster
-        * @param bool $domain
         * @return LoadBalancer
         */
-       abstract public function getExternalLB( $cluster, $domain = false );
+       abstract public function getExternalLB( $cluster );
 
        /**
         * Call a method of each tracked load balancer
index 83ca650..a7cc16c 100644 (file)
@@ -255,13 +255,7 @@ class LBFactoryMulti extends LBFactory {
                return $this->mainLBs[$section];
        }
 
-       /**
-        * @param string $cluster
-        * @param DatabaseDomain|string|bool $domain Domain ID, or false for the current domain
-        * @throws InvalidArgumentException
-        * @return LoadBalancer
-        */
-       public function newExternalLB( $cluster, $domain = false ) {
+       public function newExternalLB( $cluster ) {
                if ( !isset( $this->externalLoads[$cluster] ) ) {
                        throw new InvalidArgumentException( __METHOD__ . ": Unknown cluster \"$cluster\"" );
                }
@@ -281,14 +275,9 @@ class LBFactoryMulti extends LBFactory {
                );
        }
 
-       /**
-        * @param string $cluster External storage cluster, or false for core
-        * @param DatabaseDomain|string|bool $domain Domain ID, or false for the current domain
-        * @return LoadBalancer
-        */
-       public function getExternalLB( $cluster, $domain = false ) {
+       public function getExternalLB( $cluster ) {
                if ( !isset( $this->extLBs[$cluster] ) ) {
-                       $this->extLBs[$cluster] = $this->newExternalLB( $cluster, $domain );
+                       $this->extLBs[$cluster] = $this->newExternalLB( $cluster );
                        $this->getChronologyProtector()->initLB( $this->extLBs[$cluster] );
                }
 
index 674bafd..1e69d8f 100644 (file)
@@ -91,13 +91,7 @@ class LBFactorySimple extends LBFactory {
                return $this->mainLB;
        }
 
-       /**
-        * @param string $cluster
-        * @param bool|string $domain
-        * @return LoadBalancer
-        * @throws InvalidArgumentException
-        */
-       public function newExternalLB( $cluster, $domain = false ) {
+       public function newExternalLB( $cluster ) {
                if ( !isset( $this->externalClusters[$cluster] ) ) {
                        throw new InvalidArgumentException( __METHOD__ . ": Unknown cluster \"$cluster\"." );
                }
@@ -105,14 +99,9 @@ class LBFactorySimple extends LBFactory {
                return $this->newLoadBalancer( $this->externalClusters[$cluster] );
        }
 
-       /**
-        * @param string $cluster
-        * @param bool|string $domain
-        * @return LoadBalancer
-        */
-       public function getExternalLB( $cluster, $domain = false ) {
+       public function getExternalLB( $cluster ) {
                if ( !isset( $this->extLBs[$cluster] ) ) {
-                       $this->extLBs[$cluster] = $this->newExternalLB( $cluster, $domain );
+                       $this->extLBs[$cluster] = $this->newExternalLB( $cluster );
                        $this->getChronologyProtector()->initLB( $this->extLBs[$cluster] );
                }
 
index af4a350..e116888 100644 (file)
@@ -39,7 +39,9 @@ class LBFactorySingle extends LBFactory {
                        throw new InvalidArgumentException( "Missing 'connection' argument." );
                }
 
-               $this->lb = new LoadBalancerSingle( array_merge( $this->baseLoadBalancerParams(), $conf ) );
+               $lb = new LoadBalancerSingle( array_merge( $this->baseLoadBalancerParams(), $conf ) );
+               $this->initLoadBalancer( $lb );
+               $this->lb = $lb;
        }
 
        /**
@@ -53,36 +55,34 @@ class LBFactorySingle extends LBFactory {
        }
 
        /**
-        * @param bool|string $wiki
+        * @param bool|string $domain (unused)
         * @return LoadBalancerSingle
         */
-       public function newMainLB( $wiki = false ) {
+       public function newMainLB( $domain = false ) {
                return $this->lb;
        }
 
        /**
-        * @param bool|string $wiki
+        * @param bool|string $domain (unused)
         * @return LoadBalancerSingle
         */
-       public function getMainLB( $wiki = false ) {
+       public function getMainLB( $domain = false ) {
                return $this->lb;
        }
 
        /**
-        * @param string $cluster External storage cluster, or false for core
-        * @param bool|string $wiki Wiki ID, or false for the current wiki
+        * @param string $cluster External storage cluster name (unused)
         * @return LoadBalancerSingle
         */
-       public function newExternalLB( $cluster, $wiki = false ) {
+       public function newExternalLB( $cluster ) {
                return $this->lb;
        }
 
        /**
-        * @param string $cluster External storage cluster, or false for core
-        * @param bool|string $wiki Wiki ID, or false for the current wiki
+        * @param string $cluster External storage cluster name (unused)
         * @return LoadBalancerSingle
         */
-       public function getExternalLB( $cluster, $wiki = false ) {
+       public function getExternalLB( $cluster ) {
                return $this->lb;
        }
 
index 0dec95f..0a05202 100644 (file)
@@ -68,13 +68,6 @@ class LoadBalancerSingle extends LoadBalancer {
                return new static( [ 'connection' => $db ] + $params );
        }
 
-       /**
-        *
-        * @param string $server
-        * @param bool $dbNameOverride
-        *
-        * @return IDatabase
-        */
        protected function reallyOpenConnection( array $server, $dbNameOverride = false ) {
                return $this->db;
        }
index 78ec148..0236ea2 100644 (file)
@@ -258,6 +258,9 @@ class ExtensionRegistry {
                                case 'array_merge_recursive':
                                        $GLOBALS[$key] = array_merge_recursive( $GLOBALS[$key], $val );
                                        break;
+                               case 'array_replace_recursive':
+                                       $GLOBALS[$key] = array_replace_recursive( $GLOBALS[$key], $val );
+                                       break;
                                case 'array_plus_2d':
                                        $GLOBALS[$key] = wfArrayPlus2d( $GLOBALS[$key], $val );
                                        break;
index ab7220c..2e4ef89 100644 (file)
@@ -338,7 +338,7 @@ class Language {
                        // People think language codes are html safe, so enforce it.
                        // Ideally we should only allow a-zA-Z0-9-
                        // but, .+ and other chars are often used for {{int:}} hacks
-                       // see bugs 37564, 37587, 36938
+                       // see bugs T39564, T39587, T38938
                        $cache[$code] =
                                // Protect against path traversal
                                strcspn( $code, ":/\\\000&<>'\"" ) === strlen( $code )
@@ -3759,6 +3759,7 @@ class Language {
         * but uses pairs of regexes and replacements instead of code.
         *
         * @return array[] Array of grammar transformations.
+        * @throws MWException
         * @since 1.28
         */
        public function getGrammarTransformations() {
index 865a51e..78e4779 100644 (file)
        "pageinfo-category-pages": "Númberu de páxines",
        "pageinfo-category-subcats": "Númberu de subcategoríes",
        "pageinfo-category-files": "Númberu de ficheros",
+       "pageinfo-user-id": "ID d'usuariu",
        "markaspatrolleddiff": "Marcar como supervisada",
        "markaspatrolledtext": "Marcar esta páxina como supervisada",
        "markaspatrolledtext-file": "Marcar esta versión del ficheru como patrullada",
index 847eab1..7393b67 100644 (file)
                        "Ivanhercaz",
                        "AlvaroMolina",
                        "Tokvo",
-                       "Irus"
+                       "Irus",
+                       "Sophivorus"
                ]
        },
        "tog-underline": "Subrayar los enlaces:",
index 7ea777c..2dadb55 100644 (file)
@@ -28,7 +28,8 @@
                        "Purodha",
                        "Macofe",
                        "Adeliine",
-                       "Metsavend"
+                       "Metsavend",
+                       "Cumbril"
                ]
        },
        "tog-underline": "Linkide allakriipsutus:",
        "right-managechangetags": "Koostada ja (in)aktiveerida [[Special:Tags|märgiseid]]",
        "right-applychangetags": "Rakendada [[Special:Tags|märgiseid]] enda muudatuste suhtes",
        "right-changetags": "Lisada ja eemaldada käsitsi rakendatavaid [[Special:Tags|märgiseid]] üksikute redaktsioonide ja logisissekannete juures",
+       "right-deletechangetags": "Kustutada andmebaasist [[Eri:Märgised|märgiseid]]",
        "grant-group-page-interaction": "Interaktsioon lehekülgedega",
        "grant-group-file-interaction": "Interaktsioon meediafailidega",
        "grant-group-watchlist-interaction": "Interaktsioon sinu jälgimisloendiga",
index 600e3e8..2300869 100644 (file)
        "rollbacklinkcount-morethan": "$1{{PLURAL:$1|編集}}以上を巻き戻し",
        "rollbackfailed": "巻き戻しに失敗しました",
        "rollback-missingparam": "リクエストに必要なパラメーターが見当たりません。",
+       "rollback-missingrevision": "版の情報を読み込めませんでした。",
        "cantrollback": "編集を差し戻せません。\n最後の投稿者が、このページの唯一の作者です。",
        "alreadyrolled": "ページ[[:$1]]の[[User:$2|$2]] ([[User talk:$2|トーク]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]) による編集を巻き戻せません。\n他の利用者が既に編集または巻き戻しを行ったためです。\n\nこのページの最後の編集は[[User:$3|$3]] ([[User talk:$3|トーク]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]) によるものです。",
        "editcomment": "編集内容の要約: <em>$1</em>",
        "pageinfo-category-pages": "ページ数",
        "pageinfo-category-subcats": "下位カテゴリ数",
        "pageinfo-category-files": "ファイル数",
+       "pageinfo-user-id": "利用者 ID",
        "markaspatrolleddiff": "巡回済みにする",
        "markaspatrolledtext": "このページを巡回済みにする",
        "markaspatrolledtext-file": "このファイルの版を巡回済みにする",
        "feedback-thanks": "ありがとうございます。フィードバックを「[$2 $1]」のページに投稿しました。",
        "feedback-thanks-title": "お願いします!",
        "feedback-useragent": "ユーザーエージェント:",
-       "searchsuggest-search": "検索",
+       "searchsuggest-search": "{{SITENAME}}内を検索",
        "searchsuggest-containing": "この語句を全文検索",
        "api-error-autoblocked": "あなたの IP アドレスは、過去にブロックされた利用者によって使用されていたため、自動的にブロックされました。",
        "api-error-badaccess-groups": "このウィキへのファイルのアップロードが許可されていません。",
index 204579e..bc06966 100644 (file)
        "movelogpagetext": "아래는 이동된 모든 문서의 목록입니다.",
        "movesubpage": "{{PLURAL:$1|하위 문서}}",
        "movesubpagetext": "이 문서에는 다음 {{PLURAL:$1|하위 문서}} $1개가 있습니다.",
+       "movesubpagetalktext": "관련 토론 문서에 속한 $1개의 {{PLURAL:$1|하위 문서}}는 아래와 같습니다.",
        "movenosubpage": "이 문서에는 하위 문서가 존재하지 않습니다.",
        "movereason": "이유:",
        "revertmove": "되돌리기",
        "pageinfo-category-pages": "문서 수",
        "pageinfo-category-subcats": "하위 분류 수",
        "pageinfo-category-files": "파일 수",
+       "pageinfo-user-id": "사용자 ID",
        "markaspatrolleddiff": "점검한 문서로 표시",
        "markaspatrolledtext": "이 문서를 점검한 것으로 표시",
        "markaspatrolledtext-file": "이 파일 버전을 점검한 것으로 표시",
index f356b98..daa8a90 100644 (file)
        "feedback-thanks": "Din tilbakemelding til siden \"[ $2  $1 ]\" er sendt. Takk skal du ha!",
        "feedback-thanks-title": "Takk!",
        "feedback-useragent": "Brukeragent",
-       "searchsuggest-search": "Søk",
+       "searchsuggest-search": "Søk i {{SITENAME}}",
        "searchsuggest-containing": "inneholder …",
        "api-error-autoblocked": "Din IP-adresse har blitt blokkert automatisk fordi den ble brukt av en blokkert bruker.",
        "api-error-badaccess-groups": "Du har ikke tillatelse til å laste opp filer til denne wikien.",
index 0631fcc..5823c24 100644 (file)
        "right-purge": "Limpar a ''cache'' de uma página no servidor sem confirmação",
        "right-autoconfirmed": "Não ser afetado pelos limites de frequência baseados no número de IP",
        "right-bot": "Ser tratado como um processo automatizado",
-       "right-nominornewtalk": "Não despoletar o aviso de mensagens novas ao fazer edições menores a páginas de discussão",
+       "right-nominornewtalk": "Não desencadear o aviso de mensagens novas ao fazer edições menores a páginas de discussão",
        "right-apihighlimits": "Usar limites superiores nas consultas ''(queries)'' via API",
        "right-writeapi": "Usar a API de escrita",
        "right-delete": "Eliminar páginas",
index 5efd11e..b426bce 100644 (file)
        "anoneditwarning": "<strong>警告:</strong>您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您<strong>[$1 登录]</strong>或<strong>[$2 创建]</strong>一个账户,您的编辑将归属于您的用户名,且将享受其他好处。",
        "anonpreviewwarning": "<em>您没有登录。保存将您的IP地址记录至此页面的编辑历史中。</em>",
        "missingsummary": "<strong>提示:</strong>您没有提供编辑摘要。如果您再次点击“{{int:savearticle}}”,您的编辑将不带摘要保存。",
-       "selfredirect": "<strong>警告:</strong>您正在将此页面重定向至它自己。您可能指定了错误的重定向目标,或者您正在编辑错误的页面。如果您再次点击“{{int:savearticle}}”,重定向将无论如何被创建。",
+       "selfredirect": "<strong>警告:</strong>您正在将此页面重定向至它自己。您可能指定了错误的重定向目标,或者您正在编辑错误的页面。如果您再次点击“{{int:savearticle}}”,重定向仍将被创建。",
        "missingcommenttext": "请在下面输入评论。",
        "missingcommentheader": "<strong>提示:</strong>您还没有为此评论提供一个标题。如果您再次点击“{{int:savearticle}}”,您的编辑将不带标题保存。",
        "summary-preview": "摘要预览:",
index 1cb5eef..208cf17 100644 (file)
@@ -104,7 +104,7 @@ abstract class Maintenance {
 
        /**
         * Used by getDB() / setDB()
-        * @var IDatabase
+        * @var Database
         */
        private $mDb = null;
 
@@ -726,6 +726,7 @@ abstract class Maintenance {
 
                if ( is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) {
                        $class = $wgProfiler['class'];
+                       /** @var Profiler $profiler */
                        $profiler = new $class(
                                [ 'sampling' => 1, 'output' => [ $output ] ]
                                        + $wgProfiler
@@ -1182,6 +1183,7 @@ abstract class Maintenance {
                $this->beginTransaction( $dbw, __METHOD__ );
 
                # Get "active" text records from the revisions table
+               $cur = [];
                $this->output( 'Searching for active text records in revisions table...' );
                $res = $dbw->select( 'revision', 'rev_text_id', [], __METHOD__, [ 'DISTINCT' ] );
                foreach ( $res as $row ) {
index b96e7eb..a672e29 100755 (executable)
@@ -145,6 +145,7 @@ class UpdateMediaWiki extends Maintenance {
 
                $this->output( "Going to run database updates for " . wfWikiID() . "\n" );
                if ( $db->getType() === 'sqlite' ) {
+                       /** @var Database|DatabaseSqlite $db */
                        $this->output( "Using SQLite file: '{$db->getDbFilePath()}'\n" );
                }
                $this->output( "Depending on the size of your database this may take a while!\n" );
index 167f52a..1de4265 100644 (file)
@@ -252,6 +252,41 @@ class ExtensionRegistryTest extends MediaWikiTestCase {
                                        'mwtestT100767' => false,
                                ],
                        ],
+                       [
+                               'test array_replace_recursive',
+                               [
+                                       'mwtestJsonConfigs' => [
+                                               'JsonZeroConfig' => [
+                                                       'namespace' => 480,
+                                                       'nsName' => 'Zero',
+                                                       'isLocal' => false,
+                                               ],
+                                       ],
+                               ],
+                               [
+                                       'mwtestJsonConfigs' => [
+                                               'JsonZeroConfig' => [
+                                                       'isLocal' => false,
+                                                       'remote' => [
+                                                               'username' => 'foo',
+                                                       ],
+                                               ],
+                                               ExtensionRegistry::MERGE_STRATEGY => 'array_replace_recursive',
+                                       ],
+                               ],
+                               [
+                                       'mwtestJsonConfigs' => [
+                                               'JsonZeroConfig' => [
+                                                       'namespace' => 480,
+                                                       'nsName' => 'Zero',
+                                                       'isLocal' => false,
+                                                       'remote' => [
+                                                               'username' => 'foo',
+                                                       ],
+                                               ],
+                                       ],
+                               ],
+                       ],
                ];
        }
 }