Merge "EditPage: Remove separator between cancel and help"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 10 Jan 2018 06:16:53 +0000 (06:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 10 Jan 2018 06:16:53 +0000 (06:16 +0000)
61 files changed:
autoload.php
docs/extension.schema.v1.json
docs/extension.schema.v2.json
docs/hooks.txt
includes/DefaultSettings.php
includes/ForkController.php
includes/GlobalFunctions.php
includes/ServiceWiring.php
includes/Storage/SqlBlobStore.php
includes/api/ApiErrorFormatter.php
includes/api/i18n/pt.json
includes/dao/DBAccessBase.php
includes/debug/logger/monolog/WikiProcessor.php
includes/exception/MWExceptionHandler.php
includes/export/BaseDump.php [new file with mode: 0644]
includes/installer/DatabaseUpdater.php
includes/installer/MssqlUpdater.php
includes/installer/MysqlUpdater.php
includes/installer/OracleUpdater.php
includes/installer/PostgresUpdater.php
includes/installer/SqliteUpdater.php
includes/libs/CSSMin.php
includes/libs/lockmanager/LockManager.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php
includes/profiler/Profiler.php
includes/profiler/output/ProfilerOutputText.php
includes/specials/SpecialEditWatchlist.php
includes/utils/UIDGenerator.php
includes/watcheditem/NoWriteWatchedItemStore.php [new file with mode: 0644]
languages/i18n/be-tarask.json
languages/i18n/bg.json
languages/i18n/br.json
languages/i18n/ca.json
languages/i18n/en.json
languages/i18n/eo.json
languages/i18n/es.json
languages/i18n/gl.json
languages/i18n/id.json
languages/i18n/it.json
languages/i18n/ko.json
languages/i18n/nl.json
languages/i18n/pt.json
languages/i18n/ro.json
languages/i18n/ru.json
languages/i18n/sd.json
maintenance/Maintenance.php
maintenance/backupPrefetch.inc [deleted file]
maintenance/dumpTextPass.php
maintenance/generateLocalAutoload.php
maintenance/migrateArchiveText.php [new file with mode: 0644]
maintenance/mwdoc-filter.php
resources/Resources.php
resources/src/mediawiki.widgets/mw.widgets.TitleInputWidget.js
resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
tests/phan/config.php
tests/phpunit/data/composer/installed.json [new file with mode: 0644]
tests/phpunit/includes/libs/CSSMinTest.php
tests/phpunit/includes/libs/composer/ComposerInstalledTest.php [new file with mode: 0644]
tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php [new file with mode: 0644]
tests/phpunit/maintenance/backupPrefetchTest.php

index 351136d..5d6104c 100644 (file)
@@ -175,7 +175,7 @@ $wgAutoloadLocalClasses = [
        'BadRequestError' => __DIR__ . '/includes/exception/BadRequestError.php',
        'BadTitleError' => __DIR__ . '/includes/exception/BadTitleError.php',
        'BagOStuff' => __DIR__ . '/includes/libs/objectcache/BagOStuff.php',
-       'BaseDump' => __DIR__ . '/maintenance/backupPrefetch.inc',
+       'BaseDump' => __DIR__ . '/includes/export/BaseDump.php',
        'BaseTemplate' => __DIR__ . '/includes/skins/BaseTemplate.php',
        'BashkirUppercaseCollation' => __DIR__ . '/includes/collation/BashkirUppercaseCollation.php',
        'BatchRowIterator' => __DIR__ . '/includes/utils/BatchRowIterator.php',
@@ -1011,6 +1011,7 @@ $wgAutoloadLocalClasses = [
        'MessageContent' => __DIR__ . '/includes/content/MessageContent.php',
        'MessageLocalizer' => __DIR__ . '/languages/MessageLocalizer.php',
        'MessageSpecifier' => __DIR__ . '/includes/libs/MessageSpecifier.php',
+       'MigrateArchiveText' => __DIR__ . '/maintenance/migrateArchiveText.php',
        'MigrateComments' => __DIR__ . '/maintenance/migrateComments.php',
        'MigrateFileRepoLayout' => __DIR__ . '/maintenance/migrateFileRepoLayout.php',
        'MigrateUserGroup' => __DIR__ . '/maintenance/migrateUserGroup.php',
@@ -1048,6 +1049,7 @@ $wgAutoloadLocalClasses = [
        'NewFilesPager' => __DIR__ . '/includes/specials/pagers/NewFilesPager.php',
        'NewPagesPager' => __DIR__ . '/includes/specials/pagers/NewPagesPager.php',
        'NewUsersLogFormatter' => __DIR__ . '/includes/logging/NewUsersLogFormatter.php',
+       'NoWriteWatchedItemStore' => __DIR__ . '/includes/watcheditem/NoWriteWatchedItemStore.php',
        'NolinesImageGallery' => __DIR__ . '/includes/gallery/NolinesImageGallery.php',
        'NorthernSamiUppercaseCollation' => __DIR__ . '/includes/collation/NorthernSamiUppercaseCollation.php',
        'NotRecursiveIterator' => __DIR__ . '/includes/libs/iterators/NotRecursiveIterator.php',
index ddf82e8..0763e7d 100644 (file)
                                                                        "description": "Group which this module should be loaded together with"
                                                                },
                                                                "deprecated": {
-                                                                       "type": ["object", "boolean"],
-                                                                       "description": "Whether the module is deprecated and usage is discouraged. Either a boolean or an object with key message can be used to customise deprecation message."
+                                                                       "type": ["object", "string", "boolean"],
+                                                                       "description": "Whether the module is deprecated and usage is discouraged. Either a boolean, or a string or an object with key message can be used to customise deprecation message."
                                                                },
                                                                "position": {
                                                                        "type": "string",
index 0bdf97d..51f9417 100644 (file)
                                                                        "description": "Group with which this module should be loaded"
                                                                },
                                                                "deprecated": {
-                                                                       "type": ["object", "boolean"],
-                                                                       "description": "Whether the module is deprecated and usage is discouraged. Either a boolean or an object with key message can be used to customise deprecation message."
+                                                                       "type": ["object", "string", "boolean"],
+                                                                       "description": "Whether the module is deprecated and usage is discouraged. Either a boolean, or a string or an object with key message can be used to customise deprecation message."
                                                                },
                                                                "position": {
                                                                        "type": "string",
index 45387a3..2c6fc02 100644 (file)
@@ -3917,14 +3917,15 @@ dumps. One, and only one hook should set this, and return false.
 &$opts: Options to use for the query
 &$join: Join conditions
 
-'WikiPageDeletionUpdates': manipulate the list of DataUpdates to be applied when
+'WikiPageDeletionUpdates': manipulate the list of DeferrableUpdates to be applied when
 a page is deleted. Called in WikiPage::getDeletionUpdates(). Note that updates
 specific to a content model should be provided by the respective Content's
 getDeletionUpdates() method.
 $page: the WikiPage
-$content: the Content to generate updates for (or null, if the Content could not be loaded
-due to an error)
-&$updates: the array of DataUpdate objects. Hook function may want to add to it.
+$content: the Content to generate updates for, or null in case the page revision could not be
+  loaded. The delete will succeed despite this.
+&$updates: the array of objects that implement DeferrableUpdate. Hook function may want to add to
+  it.
 
 'WikiPageFactory': Override WikiPage class used for a title
 $title: Title of the page
index 8091428..ee10a6d 100644 (file)
@@ -6623,6 +6623,13 @@ $wgCommandLineDarkBg = false;
  */
 $wgReadOnly = null;
 
+/**
+ * Set this to true to put the wiki watchlists into read-only mode.
+ * @var bool
+ * @since 1.31
+ */
+$wgReadOnlyWatchedItemStore = false;
+
 /**
  * If this lock file exists (size > 0), the wiki will be forced into read-only mode.
  * Its contents will be shown to users as part of the read-only warning
index 2dde17b..cc16964 100644 (file)
@@ -54,7 +54,7 @@ class ForkController {
        const RESTART_ON_ERROR = 1;
 
        public function __construct( $numProcs, $flags = 0 ) {
-               if ( PHP_SAPI != 'cli' ) {
+               if ( !wfIsCLI() ) {
                        throw new MWException( "ForkController cannot be used from the web." );
                }
                $this->procsToStart = $numProcs;
index 310adeb..621dd65 100644 (file)
@@ -2088,6 +2088,16 @@ function wfIsHHVM() {
        return defined( 'HHVM_VERSION' );
 }
 
+/**
+ * Check if we are running from the commandline
+ *
+ * @since 1.31
+ * @return bool
+ */
+function wfIsCLI() {
+       return PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg';
+}
+
 /**
  * Tries to get the system directory for temporary files. First
  * $wgTmpDirectory is checked, and then the TMPDIR, TMP, and TEMP
@@ -3031,7 +3041,7 @@ function wfWaitForSlaves(
        $ifWritesSince = null, $wiki = false, $cluster = false, $timeout = null
 ) {
        if ( $timeout === null ) {
-               $timeout = ( PHP_SAPI === 'cli' ) ? 86400 : 10;
+               $timeout = wfIsCLI() ? 86400 : 10;
        }
 
        if ( $cluster === '*' ) {
index 246b838..79e5b84 100644 (file)
@@ -166,6 +166,11 @@ return [
                        $services->getReadOnlyMode()
                );
                $store->setStatsdDataFactory( $services->getStatsdDataFactory() );
+
+               if ( $services->getMainConfig()->get( 'ReadOnlyWatchedItemStore' ) ) {
+                       $store = new NoWriteWatchedItemStore( $store );
+               }
+
                return $store;
        },
 
index 69e1539..5ddbd34 100644 (file)
@@ -466,6 +466,11 @@ class SqlBlobStore implements IDBAccessObject, BlobStore {
                        return false;
                }
 
+               if ( in_array( 'error', $blobFlags ) ) {
+                       // Error row, return false
+                       return false;
+               }
+
                if ( in_array( 'gzip', $blobFlags ) ) {
                        # Deal with optional compression of archived pages.
                        # This can be done periodically via maintenance/compressOld.php, and
index 1749ce7..c637752 100644 (file)
@@ -112,7 +112,7 @@ class ApiErrorFormatter {
         * Add warnings and errors from a StatusValue object to the result
         * @param string|null $modulePath
         * @param StatusValue $status
-        * @param string[] $types 'warning' and/or 'error'
+        * @param string[]|string $types 'warning' and/or 'error'
         */
        public function addMessagesFromStatus(
                $modulePath, StatusValue $status, $types = [ 'warning', 'error' ]
index 9fc3e07..20330c6 100644 (file)
        "apihelp-emailuser-param-text": "Texto.",
        "apihelp-emailuser-param-ccme": "Enviar-me uma cópia desta mensagem.",
        "apihelp-emailuser-example-email": "Enviar uma mensagem de correio ao utilizador <kbd>WikiSysop</kbd> com o texto <kbd>Content</kbd>.",
-       "apihelp-expandtemplates-summary": "Expande todas as predefinições incluídas num texto em notação wiki.",
+       "apihelp-expandtemplates-summary": "Expande todas as predefinições existentes num texto wiki.",
        "apihelp-expandtemplates-param-title": "Título da página.",
-       "apihelp-expandtemplates-param-text": "Texto em notação wiki a converter.",
+       "apihelp-expandtemplates-param-text": "Texto wiki a converter.",
        "apihelp-expandtemplates-param-revid": "Identificador da revisão, para <code><nowiki>{{REVISIONID}}</nowiki></code> e variáveis semelhantes.",
-       "apihelp-expandtemplates-param-prop": "As informações que devem ser obtidas:\n\nNote que se não for selecionado nenhum valor, o resultado irá conter texto em notação wiki mas a saída estará num formato obsoleto.",
-       "apihelp-expandtemplates-paramvalue-prop-wikitext": "O texto em notação wiki expandido.",
-       "apihelp-expandtemplates-paramvalue-prop-categories": "Quaisquer categorias existentes na entrada que não estão representadas no texto em notação wiki de saída.",
-       "apihelp-expandtemplates-paramvalue-prop-properties": "Propriedades da página, definidas por palavras mágicas expandidas, no texto em notação wiki.",
+       "apihelp-expandtemplates-param-prop": "As informações que devem ser obtidas:\n\nNote que, se não for selecionado nenhum valor, o resultado irá conter o texto wiki mas a saída estará num formato obsoleto.",
+       "apihelp-expandtemplates-paramvalue-prop-wikitext": "O texto wiki expandido.",
+       "apihelp-expandtemplates-paramvalue-prop-categories": "Quaisquer categorias existentes na entrada que não estão representadas no texto wiki de saída.",
+       "apihelp-expandtemplates-paramvalue-prop-properties": "Propriedades da página, definidas por palavras mágicas expandidas, no texto wiki.",
        "apihelp-expandtemplates-paramvalue-prop-volatile": "Indica se o resultado é volátil e não deve ser reutilizado noutra parte da página.",
        "apihelp-expandtemplates-paramvalue-prop-ttl": "O período máximo a partir do qual os armazenamentos do resultado na cache devem ser invalidados.",
        "apihelp-expandtemplates-paramvalue-prop-modules": "Quaisquer módulos ResourceLoader que as funções do analisador sintático solicitaram que fossem adicionados ao resultado de saída. Um dos valores <kbd>jsconfigvars</kbd> ou <kbd>encodedjsconfigvars</kbd> tem de ser solicitado em conjunto com o valor <kbd>modules</kbd>.",
        "apihelp-expandtemplates-paramvalue-prop-parsetree": "A árvore de análise sintática em XML do texto de entrada.",
        "apihelp-expandtemplates-param-includecomments": "Indica se devem ser incluídos comentários HTML no resultado.",
        "apihelp-expandtemplates-param-generatexml": "Gerar a árvore de análise sintática em XML (substituído por $1prop=parsetree).",
-       "apihelp-expandtemplates-example-simple": "Expandir o texto em notação wiki <kbd><nowiki>{{Project:Sandbox}}</nowiki></kbd>.",
+       "apihelp-expandtemplates-example-simple": "Expandir o texto wiki <kbd><nowiki>{{Project:Sandbox}}</nowiki></kbd>.",
        "apihelp-feedcontributions-summary": "Devolve um ''feed'' das contribuições do utilizador.",
        "apihelp-feedcontributions-param-feedformat": "O formato do ''feed''.",
        "apihelp-feedcontributions-param-user": "Os utilizadores dos quais serão obtidas as contribuições.",
        "apihelp-parse-param-redirects": "Se <var>$1page</var> ou <var>$1pageid</var> estiverem definidos para um redirecionamento, resolvê-lo.",
        "apihelp-parse-param-oldid": "Analisar o conteúdo desta revisão. Tem precedência sobre <var>$1page</var> e <var>$1pageid</var>.",
        "apihelp-parse-param-prop": "As informações que devem ser obtidas:",
-       "apihelp-parse-paramvalue-prop-text": "Fornece o texto analisado, de um texto com notação wiki.",
+       "apihelp-parse-paramvalue-prop-text": "Fornece o texto analisado resultante do texto wiki.",
        "apihelp-parse-paramvalue-prop-langlinks": "Fornece as hiperligações interlínguas do texto wiki analisado.",
        "apihelp-parse-paramvalue-prop-categories": "Fornece as categorias do texto wiki analisado.",
        "apihelp-parse-paramvalue-prop-categorieshtml": "Fornece a versão HTML das categorias.",
        "apihelp-parse-paramvalue-prop-encodedjsconfigvars": "Fornece as variáveis de configuração JavaScript específicas da página, no formato de uma ''string'' JSON.",
        "apihelp-parse-paramvalue-prop-indicators": "Fornece o HTML dos indicadores de estado de página que são usados na página.",
        "apihelp-parse-paramvalue-prop-iwlinks": "Fornece as hiperligações interwikis do texto wiki analisado.",
-       "apihelp-parse-paramvalue-prop-wikitext": "Fornece o texto original com notação wiki que foi analisado.",
+       "apihelp-parse-paramvalue-prop-wikitext": "Fornece o texto wiki original que foi analisado.",
        "apihelp-parse-paramvalue-prop-properties": "Fornece várias propriedades definidas no texto analisado.",
        "apihelp-parse-paramvalue-prop-limitreportdata": "Fornece o relatório de limites de forma estruturada. Não fornece dados quando <var>$1disablelimitreport</var> está definido.",
        "apihelp-parse-paramvalue-prop-limitreporthtml": "Fornece a versão HTML do relatório de limites. Não fornece dados quando <var>$1disablelimitreport</var> está definido.",
        "apihelp-parse-param-contentformat": "O formato da seriação de conteúdo, usado para o texto de entrada. Só é válido quando usado com $1text.",
        "apihelp-parse-param-contentmodel": "Modelo de conteúdo do texto de entrada. Se omitido, $1title tem de ser especificado e o valor por omissão será o modelo do título especificado. Só é válido quando usado com $1text.",
        "apihelp-parse-example-page": "Fazer a análise sintática de uma página.",
-       "apihelp-parse-example-text": "Fazer a análise sintática do texto com notação wiki.",
-       "apihelp-parse-example-texttitle": "Fazer a análise sintática do texto com notação wiki, especificando o título da página.",
+       "apihelp-parse-example-text": "Fazer a análise sintática do texto wiki.",
+       "apihelp-parse-example-texttitle": "Fazer a análise sintática do texto wiki, especificando o título da página.",
        "apihelp-parse-example-summary": "Fazer a análise sintática de um resumo.",
        "apihelp-patrol-summary": "Patrulhar uma página ou revisão.",
        "apihelp-patrol-param-rcid": "Identificador da mudança recente a patrulhar.",
        "apihelp-query+allmessages-summary": "Devolver as mensagens deste ''site''.",
        "apihelp-query+allmessages-param-messages": "Mensagens a serem produzidas no resultado. <kbd>*</kbd> (o valor por omissão) significa todas as mensagens.",
        "apihelp-query+allmessages-param-prop": "As propriedades a serem obtidas:",
-       "apihelp-query+allmessages-param-enableparser": "Definir, para ativar o analisador sintático e pré-processar o texto da mensagem com notação wiki (substituir palavras mágicas, processar predefinições, etc.).",
+       "apihelp-query+allmessages-param-enableparser": "Definir para ativar o analisador sintático; irá pré-processar o texto wiki da mensagem (substituir palavras mágicas, processar predefinições, etc.).",
        "apihelp-query+allmessages-param-nocontent": "Se definido, não incluir o conteúdo das mensagens no resultado de saída.",
        "apihelp-query+allmessages-param-includelocal": "Incluir também as mensagens locais, isto é, mensagens que não existem no software mas existem como uma página no espaço nominal {{ns:MediaWiki}}.\nIsto lista todas as páginas do espaço nominal {{ns:MediaWiki}}, portanto, também irá listar aquelas que não são verdadeiramente mensagens, como [[MediaWiki:Common.js|Common.js]].",
        "apihelp-query+allmessages-param-args": "Os argumentos a serem substituídos na mensagem.",
index 0f8d7f7..6e171d5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\LoadBalancer;
 
 /**
@@ -56,7 +56,7 @@ abstract class DBAccessBase implements IDBAccessObject {
         * @param int $id Which connection to use
         * @param array $groups Query groups
         *
-        * @return Database
+        * @return IDatabase
         */
        protected function getConnection( $id, $groups = [] ) {
                $loadBalancer = wfGetLB( $this->wiki );
@@ -71,9 +71,9 @@ abstract class DBAccessBase implements IDBAccessObject {
         *
         * @since 1.21
         *
-        * @param Database $db The database connection to release.
+        * @param IDatabase $db The database connection to release.
         */
-       protected function releaseConnection( Database $db ) {
+       protected function releaseConnection( IDatabase $db ) {
                if ( $this->wiki !== false ) {
                        $loadBalancer = $this->getLoadBalancer();
                        $loadBalancer->reuseConnection( $db );
index e39a2c3..db5b9bf 100644 (file)
@@ -39,7 +39,7 @@ class WikiProcessor {
                $record['extra']['wiki'] = wfWikiID();
                $record['extra']['mwversion'] = $wgVersion;
                $record['extra']['reqId'] = \WebRequest::getRequestId();
-               if ( PHP_SAPI === 'cli' && isset( $_SERVER['argv'] ) ) {
+               if ( wfIsCLI() && isset( $_SERVER['argv'] ) ) {
                        $record['extra']['cli_argv'] = implode( ' ', $_SERVER['argv'] );
                }
                return $record;
index f3d61f0..d863a2b 100644 (file)
@@ -121,7 +121,7 @@ class MWExceptionHandler {
                self::handleException( $e );
 
                // Make sure we don't claim success on exit for CLI scripts (T177414)
-               if ( PHP_SAPI === 'cli' ) {
+               if ( wfIsCLI() ) {
                        register_shutdown_function(
                                function () {
                                        exit( 255 );
diff --git a/includes/export/BaseDump.php b/includes/export/BaseDump.php
new file mode 100644 (file)
index 0000000..6a2d3bf
--- /dev/null
@@ -0,0 +1,219 @@
+<?php
+/**
+ * Helper class for the --prefetch option of dumpTextPass.php
+ *
+ * Copyright © 2005 Brion Vibber <brion@pobox.com>
+ * https://www.mediawiki.org/
+ *
+ * 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 Maintenance
+ */
+
+/**
+ * Readahead helper for making large MediaWiki data dumps;
+ * reads in a previous XML dump to sequentially prefetch text
+ * records already normalized and decompressed.
+ *
+ * This can save load on the external database servers, hopefully.
+ *
+ * Assumes that dumps will be recorded in the canonical order:
+ * - ascending by page_id
+ * - ascending by rev_id within each page
+ * - text contents are immutable and should not change once
+ *   recorded, so the previous dump is a reliable source
+ *
+ * @ingroup Maintenance
+ */
+class BaseDump {
+       /** @var XMLReader */
+       protected $reader = null;
+       protected $atEnd = false;
+       protected $atPageEnd = false;
+       protected $lastPage = 0;
+       protected $lastRev = 0;
+       protected $infiles = null;
+
+       public function __construct( $infile ) {
+               $this->infiles = explode( ';', $infile );
+               $this->reader = new XMLReader();
+               $infile = array_shift( $this->infiles );
+               if ( defined( 'LIBXML_PARSEHUGE' ) ) {
+                       $this->reader->open( $infile, null, LIBXML_PARSEHUGE );
+               } else {
+                       $this->reader->open( $infile );
+               }
+       }
+
+       /**
+        * Attempts to fetch the text of a particular page revision
+        * from the dump stream. May return null if the page is
+        * unavailable.
+        *
+        * @param int $page ID number of page to read
+        * @param int $rev ID number of revision to read
+        * @return string|null
+        */
+       function prefetch( $page, $rev ) {
+               $page = intval( $page );
+               $rev = intval( $rev );
+               while ( $this->lastPage < $page && !$this->atEnd ) {
+                       $this->debug( "BaseDump::prefetch at page $this->lastPage, looking for $page" );
+                       $this->nextPage();
+               }
+               if ( $this->lastPage > $page || $this->atEnd ) {
+                       $this->debug( "BaseDump::prefetch already past page $page "
+                               . "looking for rev $rev  [$this->lastPage, $this->lastRev]" );
+
+                       return null;
+               }
+               while ( $this->lastRev < $rev && !$this->atEnd && !$this->atPageEnd ) {
+                       $this->debug( "BaseDump::prefetch at page $this->lastPage, rev $this->lastRev, "
+                               . "looking for $page, $rev" );
+                       $this->nextRev();
+               }
+               if ( $this->lastRev == $rev && !$this->atEnd ) {
+                       $this->debug( "BaseDump::prefetch hit on $page, $rev [$this->lastPage, $this->lastRev]" );
+
+                       return $this->nextText();
+               } else {
+                       $this->debug( "BaseDump::prefetch already past rev $rev on page $page "
+                               . "[$this->lastPage, $this->lastRev]" );
+
+                       return null;
+               }
+       }
+
+       function debug( $str ) {
+               wfDebug( $str . "\n" );
+               // global $dumper;
+               // $dumper->progress( $str );
+       }
+
+       /**
+        * @access private
+        */
+       function nextPage() {
+               if ( $this->skipTo( 'page', 'mediawiki' ) ) {
+                       if ( $this->skipTo( 'id' ) ) {
+                               $this->lastPage = intval( $this->nodeContents() );
+                               $this->lastRev = 0;
+                               $this->atPageEnd = false;
+                       }
+               } else {
+                       $this->close();
+                       if ( count( $this->infiles ) ) {
+                               $infile = array_shift( $this->infiles );
+                               $this->reader->open( $infile );
+                               $this->atEnd = false;
+                       }
+               }
+       }
+
+       /**
+        * @access private
+        */
+       function nextRev() {
+               if ( $this->skipTo( 'revision' ) ) {
+                       if ( $this->skipTo( 'id' ) ) {
+                               $this->lastRev = intval( $this->nodeContents() );
+                       }
+               } else {
+                       $this->atPageEnd = true;
+               }
+       }
+
+       /**
+        * @access private
+        * @return string
+        */
+       function nextText() {
+               $this->skipTo( 'text' );
+
+               return strval( $this->nodeContents() );
+       }
+
+       /**
+        * @access private
+        * @param string $name
+        * @param string $parent
+        * @return bool|null
+        */
+       function skipTo( $name, $parent = 'page' ) {
+               if ( $this->atEnd ) {
+                       return false;
+               }
+               while ( $this->reader->read() ) {
+                       if ( $this->reader->nodeType == XMLReader::ELEMENT
+                               && $this->reader->name == $name
+                       ) {
+                               return true;
+                       }
+                       if ( $this->reader->nodeType == XMLReader::END_ELEMENT
+                               && $this->reader->name == $parent
+                       ) {
+                               $this->debug( "BaseDump::skipTo found </$parent> searching for <$name>" );
+
+                               return false;
+                       }
+               }
+
+               return $this->close();
+       }
+
+       /**
+        * Shouldn't something like this be built-in to XMLReader?
+        * Fetches text contents of the current element, assuming
+        * no sub-elements or such scary things.
+        *
+        * @return string
+        * @access private
+        */
+       function nodeContents() {
+               if ( $this->atEnd ) {
+                       return null;
+               }
+               if ( $this->reader->isEmptyElement ) {
+                       return "";
+               }
+               $buffer = "";
+               while ( $this->reader->read() ) {
+                       switch ( $this->reader->nodeType ) {
+                               case XMLReader::TEXT:
+                               // case XMLReader::WHITESPACE:
+                               case XMLReader::SIGNIFICANT_WHITESPACE:
+                                       $buffer .= $this->reader->value;
+                                       break;
+                               case XMLReader::END_ELEMENT:
+                                       return $buffer;
+                       }
+               }
+
+               return $this->close();
+       }
+
+       /**
+        * @access private
+        * @return null
+        */
+       function close() {
+               $this->reader->close();
+               $this->atEnd = true;
+
+               return null;
+       }
+}
index 242f148..176d0af 100644 (file)
@@ -1230,4 +1230,15 @@ abstract class DatabaseUpdater {
                }
        }
 
+       /**
+        * Migrate ar_text to modern storage
+        * @since 1.31
+        */
+       protected function migrateArchiveText() {
+               $this->output( "Migrating archive ar_text to modern storage.\n" );
+               $task = $this->maintenance->runChild( 'MigrateArchiveText', 'migrateArchiveText.php' );
+               $task->execute();
+               $this->output( "done.\n" );
+       }
+
 }
index cb7a6ba..b4b34de 100644 (file)
@@ -111,6 +111,7 @@ class MssqlUpdater extends DatabaseUpdater {
                        [ 'addTable', 'content', 'patch-content.sql' ],
                        [ 'addTable', 'slot_roles', 'patch-slot_roles.sql' ],
                        [ 'addTable', 'content_models', 'patch-content_models.sql' ],
+                       [ 'migrateArchiveText' ],
                ];
        }
 
index bc7725e..a3caa07 100644 (file)
@@ -335,6 +335,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        [ 'addTable', 'content', 'patch-content.sql' ],
                        [ 'addTable', 'slot_roles', 'patch-slot_roles.sql' ],
                        [ 'addTable', 'content_models', 'patch-content_models.sql' ],
+                       [ 'migrateArchiveText' ],
                ];
        }
 
index 67150ee..ea68412 100644 (file)
@@ -132,6 +132,7 @@ class OracleUpdater extends DatabaseUpdater {
                        [ 'addTable', 'content', 'patch-content.sql' ],
                        [ 'addTable', 'slot_roles', 'patch-slot_roles.sql' ],
                        [ 'addTable', 'content_models', 'patch-content_models.sql' ],
+                       [ 'migrateArchiveText' ],
 
                        // KEEP THIS AT THE BOTTOM!!
                        [ 'doRebuildDuplicateFunction' ],
index fe8a1b1..367d431 100644 (file)
@@ -489,6 +489,7 @@ class PostgresUpdater extends DatabaseUpdater {
                        [ 'addTable', 'content', 'patch-content-table.sql' ],
                        [ 'addTable', 'content_models', 'patch-content_models-table.sql' ],
                        [ 'addTable', 'slot_roles', 'patch-slot_roles-table.sql' ],
+                       [ 'migrateArchiveText' ],
                ];
        }
 
index 88dfa6c..afb8b22 100644 (file)
@@ -198,7 +198,8 @@ class SqliteUpdater extends DatabaseUpdater {
                        [ 'addTable', 'content', 'patch-content.sql' ],
                        [ 'addTable', 'content_models', 'patch-content_models.sql' ],
                        [ 'addTable', 'slots', 'patch-slots.sql' ],
-                       [ 'addTable', 'slot_roles', 'patch-slot_roles.sql' ]
+                       [ 'addTable', 'slot_roles', 'patch-slot_roles.sql' ],
+                       [ 'migrateArchiveText' ],
                ];
        }
 
index a9cbba2..e85f02d 100644 (file)
@@ -143,7 +143,14 @@ class CSSMin {
                                '%2F' => '/', // Unencode slashes
                                '%3A' => ':', // Unencode colons
                                '%3D' => '=', // Unencode equals signs
+                               '%0A' => ' ', // Change newlines to spaces
+                               '%0D' => ' ', // Change carriage returns to spaces
+                               '%09' => ' ', // Change tabs to spaces
                        ] );
+                       // Consolidate runs of multiple spaces in a row
+                       $encoded = preg_replace( '/ {2,}/', ' ', $encoded );
+                       // Remove leading and trailing spaces
+                       $encoded = preg_replace( '/^ | $/', '', $encoded );
                        $uri = 'data:' . $type . ',' . $encoded;
                        if ( !$ie8Compat || strlen( $uri ) < self::DATA_URI_SIZE_LIMIT ) {
                                return $uri;
index a6257bf..6b3cfb4 100644 (file)
@@ -83,7 +83,7 @@ abstract class LockManager {
                $this->domain = isset( $config['domain'] ) ? $config['domain'] : 'global';
                if ( isset( $config['lockTTL'] ) ) {
                        $this->lockTTL = max( 5, $config['lockTTL'] );
-               } elseif ( PHP_SAPI === 'cli' ) {
+               } elseif ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ) {
                        $this->lockTTL = 3600;
                } else {
                        $met = ini_get( 'max_execution_time' ); // this is 0 in CLI mode
index 0ee10ed..2eb5c54 100644 (file)
@@ -394,7 +394,9 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        $p['variables'] = isset( $p['variables'] ) ? $p['variables'] : [];
                        $p['tablePrefix'] = isset( $p['tablePrefix'] ) ? $p['tablePrefix'] : '';
                        $p['schema'] = isset( $p['schema'] ) ? $p['schema'] : '';
-                       $p['cliMode'] = isset( $p['cliMode'] ) ? $p['cliMode'] : ( PHP_SAPI === 'cli' );
+                       $p['cliMode'] = isset( $p['cliMode'] )
+                               ? $p['cliMode']
+                               : ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' );
                        $p['agent'] = isset( $p['agent'] ) ? $p['agent'] : '';
                        if ( !isset( $p['connLogger'] ) ) {
                                $p['connLogger'] = new \Psr\Log\NullLogger();
index deacc42..a75dc4d 100644 (file)
@@ -232,7 +232,9 @@ class LoadBalancer implements ILoadBalancer {
                $this->host = isset( $params['hostname'] )
                        ? $params['hostname']
                        : ( gethostname() ?: 'unknown' );
-               $this->cliMode = isset( $params['cliMode'] ) ? $params['cliMode'] : PHP_SAPI === 'cli';
+               $this->cliMode = isset( $params['cliMode'] )
+                       ? $params['cliMode']
+                       : ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' );
                $this->agent = isset( $params['agent'] ) ? $params['agent'] : '';
 
                if ( isset( $params['chronologyProtector'] ) ) {
index 4da7976..81449be 100644 (file)
@@ -74,7 +74,8 @@ abstract class Profiler {
                        }
 
                        $inSample = mt_rand( 0, $params['sampling'] - 1 ) === 0;
-                       if ( PHP_SAPI === 'cli' || !$inSample ) {
+                       // wfIsCLI() is not available yet
+                       if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' || !$inSample ) {
                                $params['class'] = 'ProfilerStub';
                        }
 
index dc24f18..100304f 100644 (file)
@@ -59,7 +59,7 @@ class ProfilerOutputText extends ProfilerOutput {
                        );
 
                        $contentType = $this->collector->getContentType();
-                       if ( PHP_SAPI === 'cli' ) {
+                       if ( wfIsCLI() ) {
                                print "<!--\n{$out}\n-->\n";
                        } elseif ( $contentType === 'text/html' ) {
                                $visible = isset( $this->params['visible'] ) ?
index d2940e4..09ea9ea 100644 (file)
@@ -29,6 +29,7 @@
 use MediaWiki\Linker\LinkRenderer;
 use MediaWiki\Linker\LinkTarget;
 use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\DBReadOnlyError;
 
 /**
  * Provides the UI through which users can perform editing
@@ -451,6 +452,10 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         * Remove all titles from a user's watchlist
         */
        private function clearWatchlist() {
+               if ( $this->getConfig()->get( 'ReadOnlyWatchedItemStore' ) ) {
+                       throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' );
+               }
+
                $dbw = wfGetDB( DB_MASTER );
                $dbw->delete(
                        'watchlist',
index 736109b..68ef57a 100644 (file)
@@ -367,7 +367,7 @@ class UIDGenerator {
                // Use APC/eAccelerator/xcache if requested, available, and not in CLI mode;
                // Counter values would not survive accross script instances in CLI mode.
                $cache = null;
-               if ( ( $flags & self::QUICK_VOLATILE ) && PHP_SAPI !== 'cli' ) {
+               if ( ( $flags & self::QUICK_VOLATILE ) && !wfIsCLI() ) {
                        $cache = MediaWikiServices::getInstance()->getLocalServerObjectCache();
                }
                if ( $cache ) {
diff --git a/includes/watcheditem/NoWriteWatchedItemStore.php b/includes/watcheditem/NoWriteWatchedItemStore.php
new file mode 100644 (file)
index 0000000..1439421
--- /dev/null
@@ -0,0 +1,134 @@
+<?php
+/**
+ * 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 Watchlist
+ */
+use MediaWiki\Linker\LinkTarget;
+use Wikimedia\Rdbms\DBReadOnlyError;
+
+/**
+ * @internal
+ * @since 1.31
+ */
+class NoWriteWatchedItemStore implements WatchedItemStoreInterface {
+
+       /**
+        * @var WatchedItemStoreInterface
+        */
+       private $actualStore;
+
+       /**
+        * Initialy set WatchedItemStore that will be used in cases where writing is not needed.
+        * @param WatchedItemStoreInterface $actualStore
+        */
+       public function __construct( WatchedItemStoreInterface $actualStore ) {
+               $this->actualStore = $actualStore;
+       }
+
+       public function countWatchedItems( User $user ) {
+               return $this->actualStore->countWatchedItems( $user );
+       }
+
+       public function countWatchers( LinkTarget $target ) {
+               return $this->actualStore->countWatchers( $target );
+       }
+
+       public function countVisitingWatchers( LinkTarget $target, $threshold ) {
+               return $this->actualStore->countVisitingWatchers( $target, $threshold );
+       }
+
+       public function countWatchersMultiple( array $targets, array $options = [] ) {
+               return $this->actualStore->countVisitingWatchersMultiple( $targets, $options );
+       }
+
+       public function countVisitingWatchersMultiple(
+               array $targetsWithVisitThresholds,
+               $minimumWatchers = null
+       ) {
+               return $this->actualStore->countVisitingWatchersMultiple(
+                       $targetsWithVisitThresholds,
+                       $minimumWatchers
+               );
+       }
+
+       public function getWatchedItem( User $user, LinkTarget $target ) {
+               return $this->actualStore->getWatchedItem( $user, $target );
+       }
+
+       public function loadWatchedItem( User $user, LinkTarget $target ) {
+               return $this->actualStore->loadWatchedItem( $user, $target );
+       }
+
+       public function getWatchedItemsForUser( User $user, array $options = [] ) {
+               return $this->actualStore->getWatchedItemsForUser( $user, $options );
+       }
+
+       public function isWatched( User $user, LinkTarget $target ) {
+               return $this->actualStore->isWatched( $user, $target );
+       }
+
+       public function getNotificationTimestampsBatch( User $user, array $targets ) {
+               return $this->actualStore->getNotificationTimestampsBatch( $user, $targets );
+       }
+
+       public function countUnreadNotifications( User $user, $unreadLimit = null ) {
+               return $this->actualStore->countUnreadNotifications( $user, $unreadLimit );
+       }
+
+       public function duplicateAllAssociatedEntries( LinkTarget $oldTarget, LinkTarget $newTarget ) {
+               throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' );
+       }
+
+       public function duplicateEntry( LinkTarget $oldTarget, LinkTarget $newTarget ) {
+               throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' );
+       }
+
+       public function addWatch( User $user, LinkTarget $target ) {
+               throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' );
+       }
+
+       public function addWatchBatchForUser( User $user, array $targets ) {
+               throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' );
+       }
+
+       public function removeWatch( User $user, LinkTarget $target ) {
+               throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' );
+       }
+
+       public function setNotificationTimestampsForUser(
+               User $user,
+               $timestamp,
+               array $targets = []
+       ) {
+               throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' );
+       }
+
+       public function updateNotificationTimestamp( User $editor, LinkTarget $target, $timestamp ) {
+               throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' );
+       }
+
+       public function resetNotificationTimestamp(
+               User $user,
+               Title $title,
+               $force = '',
+               $oldid = 0
+       ) {
+               throw new DBReadOnlyError( null, 'The watchlist is currently readonly.' );
+       }
+
+}
index 90f1d12..4899b9d 100644 (file)
        "userrights-no-interwiki": "Вы ня маеце дазволу зьмяняць правы ўдзельнікаў іншых вікаў.",
        "userrights-nodatabase": "Базы зьвестак $1 не існуе альбо яна не зьяўляецца лякальнай.",
        "userrights-changeable-col": "Групы, якія вы можаце зьмяняць",
-       "userrights-unchangeable-col": "Ð\93Ñ\80Ñ\83пÑ\8b, Ñ\8fкÑ\96Ñ\8f Ð\92Ñ\8b Ð½Ñ\8f Ð¼Ð¾Ð¶Ð°Ñ\86е мяняць",
+       "userrights-unchangeable-col": "Ð\93Ñ\80Ñ\83пÑ\8b, Ñ\8fкÑ\96Ñ\8f Ð²Ñ\8b Ð½Ñ\8f Ð¼Ð¾Ð¶Ð°Ñ\86е Ð·Ñ\8cмяняць",
        "userrights-expiry-current": "Сканчаецца $1",
        "userrights-expiry-none": "Бестэрмінова",
        "userrights-expiry": "Сканчаецца:",
        "rcfilters-activefilters": "Актыўныя фільтры",
        "rcfilters-advancedfilters": "Пашыраныя фільтры",
        "rcfilters-limit-title": "Паказаць вынікаў",
-       "rcfilters-limit-and-date-label": "$1 {{PLURAL:$1|зьмены|зьмены|зьменаў}}, $2",
+       "rcfilters-limit-and-date-label": "$1 {{PLURAL:$1|зьмена|зьмены|зьменаў}}, $2",
        "rcfilters-date-popup-title": "Пэрыяд часу для пошуку",
        "rcfilters-days-title": "Апошнія дні",
        "rcfilters-hours-title": "Апошнія гадзіны",
index 61fa6e6..51d034f 100644 (file)
        "log-action-filter-block-unblock": "Отблокиране",
        "log-action-filter-contentmodel-change": "Промяна на модела на съдържанието",
        "log-action-filter-delete-delete": "Изтриване на страница",
+       "log-action-filter-delete-delete_redir": "Замяна на пренасочване",
        "log-action-filter-delete-restore": "Възстановяване на страница",
+       "log-action-filter-delete-event": "Изтриване на дневник",
+       "log-action-filter-delete-revision": "Изтриване на версия",
+       "log-action-filter-import-interwiki": "Transwiki внасяне",
+       "log-action-filter-import-upload": "Внасяне чрез качване на XML",
        "log-action-filter-managetags-create": "Създаване на етикет",
        "log-action-filter-managetags-delete": "Премахване на етикет",
        "log-action-filter-managetags-activate": "Активиране на етикет",
index 3b551d9..3147d4c 100644 (file)
        "rcfilters-activefilters": "Siloù oberiant",
        "rcfilters-advancedfilters": "Siloù araokaet",
        "rcfilters-limit-title": "Kemmoù da vezañ diskouezet",
+       "rcfilters-limit-and-date-label": "$1 {{PLURAL:$1|kemm|kemmoù}}, $2",
        "rcfilters-days-title": "Deizioù paseet",
        "rcfilters-hours-title": "Eurioù paseet",
        "rcfilters-days-show-days": "($1 {{PLURAL:$1|deiz}})",
        "rcfilters-filter-lastrevision-description": "Kemm diwezhañ graet ouzh ur bajenn.",
        "rcfilters-filter-previousrevision-label": "Stummoù koshoc'h",
        "rcfilters-filter-previousrevision-description": "An holl gemmoù nemet ar c'hemm diwezhañ graet ouzh ur bajenn.",
+       "rcfilters-filter-showlinkedto-label": "Diskouez ar c'hemmoù war ar bajennoù liammet",
+       "rcfilters-target-page-placeholder": "Skrivañ anv ar bajenn (pe rummad)",
        "rcnotefrom": "Setu aze {{PLURAL:$5|ar c'hemm|ar c'hemmoù}} c'hoarvezet abaoe an <strong>$3, $4</strong> (<strong>$1</strong> d'ar muiañ).",
        "rclistfromreset": "adderaouekaat dibab an deiziad",
        "rclistfrom": "Diskouez ar c'hemmoù diwezhañ abaoe an/ar $3 $2",
index c59e965..3fcf23c 100644 (file)
        "suppress": "Supressió",
        "querypage-disabled": "Aquesta pàgina especial està desactivada per a no perjudicar el rendiment.",
        "apihelp": "Ajuda de l'API",
-       "apihelp-no-such-module": "No s'ha trobat el mòdul \"$1\".",
+       "apihelp-no-such-module": "No s’ha trobat el mòdul «$1».",
        "apisandbox": "Pàgina de proves de l'API",
        "apisandbox-jsonly": "Es necessita JavaScript per utilitzar l'espai de proves API.",
        "apisandbox-api-disabled": "L'API està desactivada en aquest lloc.",
index ab4080d..2b48338 100644 (file)
        "rcfilters-activefilters": "Active filters",
        "rcfilters-advancedfilters": "Advanced filters",
        "rcfilters-limit-title": "Results to show",
-       "rcfilters-limit-and-date-label": "{{PLURAL:$1|change|$1 changes}}, $2",
+       "rcfilters-limit-and-date-label": "$1 {{PLURAL:$1|change|changes}}, $2",
        "rcfilters-date-popup-title": "Time period to search",
        "rcfilters-days-title": "Recent days",
        "rcfilters-hours-title": "Recent hours",
index 2056034..0b642fc 100644 (file)
        "suppress": "Forigu",
        "querypage-disabled": "Tiu ĉi speciala paĝo estas malfunkciigita pro rendimentaj kialoj.",
        "apihelp": "Helpo pri API",
-       "apihelp-no-such-module": "Modulo \"$1\" ne estis trovita.",
+       "apihelp-no-such-module": "La modjulo „$1” ne estis trovita.",
        "apisandbox": "API testejo",
        "apisandbox-jsonly": "JavaScript estas postulita por uzi la API provejon.",
        "apisandbox-api-disabled": "API estas malŝalta en ĉi tiu retejo.",
index b2ac122..f370955 100644 (file)
        "rcfilters-activefilters": "Filtros activos",
        "rcfilters-advancedfilters": "Filtros avanzados",
        "rcfilters-limit-title": "Resultados que mostrar",
-       "rcfilters-limit-and-date-label": "{{PLURAL:$1|cambio|$1 cambios}}, $2",
+       "rcfilters-limit-and-date-label": "$1 {{PLURAL:$1|cambio|cambios}}, $2",
        "rcfilters-date-popup-title": "Período de tiempo en que buscar",
        "rcfilters-days-title": "Días recientes",
        "rcfilters-hours-title": "Horas recientes",
        "suppress": "Supresor",
        "querypage-disabled": "Esta página especial está deshabilitada por motivos de rendimiento.",
        "apihelp": "Ayuda de la API",
-       "apihelp-no-such-module": "No se encontró el módulo \"$1\".",
+       "apihelp-no-such-module": "No se encontró el módulo «$1».",
        "apisandbox": "Zona de pruebas de la API",
        "apisandbox-jsonly": "Se requiere JavaScript para utilizar la zona de pruebas de API.",
        "apisandbox-api-disabled": "La API está desactivada en este sitio.",
index daf47c7..e7a4d83 100644 (file)
        "rcfilters-filter-showlinkedfrom-option-label": "<strong>Páxinas ligadas desde</strong> a páxina seleccionada",
        "rcfilters-filter-showlinkedto-label": "Amosar os cambios en páxinas que ligan con",
        "rcfilters-filter-showlinkedto-option-label": "<strong>Páxinas que ligan</strong> para a páxina seleccionada",
-       "rcfilters-target-page-placeholder": "Insire un nome de páxina",
+       "rcfilters-target-page-placeholder": "Insire un nome de páxina (ou categoría)",
        "rcnotefrom": "A continuación {{PLURAL:$5|móstrase o cambio feito|móstranse os cambios feitos}} desde o <strong>$3</strong> ás <strong>$4</strong> (móstranse <strong>$1</strong> como máximo).",
        "rclistfromreset": "Reinicializar a selección da data",
        "rclistfrom": "Mostrar os cambios novos desde o $3 ás $2",
        "version-poweredby-others": "outros",
        "version-poweredby-translators": "os tradutores de translatewiki.net",
        "version-credits-summary": "Queremos recoñecer as seguintes persoas polas súas achegas a [[Special:Version|MediaWiki]].",
-       "version-license-info": "MediaWiki é software libre; pode redistribuílo e/ou modificalo segundo os termos da licenza pública xeral GNU publicada pola Free Software Foundation; versión 2 ou (na súa escolla) calquera outra posterior.\n\nMediaWiki distribúese coa esperanza de que poida ser útil, pero SEN GARANTÍA NINGUNHA; nin sequera a garantía implícita de COMERCIALIZACIÓN ou ADECUACIÓN A UNHA FINALIDADE ESPECÍFICA. Olle a licenza pública xeral GNU para obter máis detalles.\n\nDebería recibir [{{SERVER}}{{SCRIPTPATH}}/COPYING unha copia da licenza pública xeral GNU] xunto ao programa; se non é así, escriba á Free Software Foundation, Inc., rúa Franklin, número 51, quinto andar, Boston, Massachusetts, 02110-1301, Estados Unidos de América ou [//www.gnu.org/licenses/old-licenses/gpl-2.0.html lea a licenza en liña].",
+       "version-license-info": "MediaWiki é software libre; pode redistribuílo e/ou modificalo segundo os termos da licenza pública xeral GNU publicada pola Free Software Foundation; versión 2 ou (na súa escolla) calquera outra posterior.\n\nMediaWiki distribúese coa esperanza de que poida ser útil, pero <em>SEN GARANTÍA NINGUNHA</em>; nin sequera a garantía implícita de <strong>COMERCIALIZACIÓN</strong> ou <strong>ADECUACIÓN A UNHA FINALIDADE ESPECÍFICA</strong>. Olle a licenza pública xeral GNU para obter máis detalles.\n\nDebería recibir [{{SERVER}}{{SCRIPTPATH}}/COPYING unha copia da licenza pública xeral GNU] xunto ao programa; se non é así, escriba á Free Software Foundation, Inc., rúa Franklin, número 51, quinto andar, Boston, Massachusetts, 02110-1301, Estados Unidos de América ou [//www.gnu.org/licenses/old-licenses/gpl-2.0.html lea a licenza en liña].",
        "version-software": "Software instalado",
        "version-software-product": "Produto",
        "version-software-version": "Versión",
index ee3352c..9e83550 100644 (file)
@@ -57,7 +57,8 @@
                        "Arifpedia",
                        "Uchup19",
                        "Archd",
-                       "Empu"
+                       "Empu",
+                       "Dodolzk"
                ]
        },
        "tog-underline": "Garis bawahi pranala:",
        "timezoneregion-indian": "Samudera Hindia",
        "timezoneregion-pacific": "Samudera Pasifik",
        "allowemail": "Izinkan pengguna lain mengirim surel kepada saya",
+       "email-allow-new-users-label": "Izinkan email dari pengguna baru",
        "email-blacklist-label": "Cegah para pengguna ini mengirim saya surel:",
        "prefs-searchoptions": "Cari",
        "prefs-namespaces": "Ruang nama",
        "right-siteadmin": "Mengunci dan membuka kunci basis data",
        "right-override-export-depth": "Ekspor halaman termasuk halaman-halaman terkait hingga kedalaman 5",
        "right-sendemail": "Mengirim surel ke pengguna lain",
+       "right-sendemail-new-users": "Kirim email ke pengguna yang tidak melakukan login",
        "right-managechangetags": "Buat dan matikan [[Special:Tags|tag]]",
        "right-applychangetags": "Terapkan [[Special:Tags|tags]] bersamaan dengan perubahan pengguna",
        "right-changetags": "Tambah dan hapus [[Special:Tags|tag]] arbitrari pada revisi masing-masing dan entri log",
        "recentchanges-noresult": "Tidak ada perubahan dalam rentang waktu ini yang cocok dengan kriteria.",
        "recentchanges-timeout": "Waktu pencarian ini telah habis. Anda mungkin ingin mencoba parameter pencarian lain.",
        "recentchanges-network": "Selama terjadi kesalahan teknis, tidak ada hasil yang bisa dimuat. Silakan coba untuk menyegarkan kembali halaman.",
+       "recentchanges-notargetpage": "Masukkan nama halaman di atas untuk melihat perubahan yang terkait dengan halaman itu.",
        "recentchanges-feed-description": "Temukan perubahan terbaru dalam wiki di umpan ini.",
        "recentchanges-label-newpage": "Suntingan ini membuat halaman baru",
        "recentchanges-label-minor": "Ini adalah suntingan kecil",
        "rcfilters-group-results-by-page": "Kelompokkan hasil menurut halaman",
        "rcfilters-activefilters": "Filter aktif",
        "rcfilters-advancedfilters": "Penyaringan lebih lanjut",
-       "rcfilters-limit-title": "Perubahan untuk ditampilkan",
+       "rcfilters-limit-title": "Hasil untuk ditampilkan",
+       "rcfilters-date-popup-title": "Periode waktu untuk dicari",
        "rcfilters-days-title": "Hari-hari terakhir",
        "rcfilters-hours-title": "Jam-jam terakhir",
        "rcfilters-days-show-days": "$1 {{PLURAL:$1|hari|hari}}",
        "rcfilters-watchlist-showupdated": "Perubahan di halaman-halaman yang belum Anda kunjungi sejak perubahan terjadi ditampilkan dalam <strong>huruf terbal</strong>, dan tanda titik tebal di daftar.",
        "rcfilters-preference-label": "Sembunyikan versi terkini dari Perubahan Terbaru",
        "rcfilters-preference-help": "Kembalikan perubahan antarmuka 2017 dan semua peralatan yang ditambahkan sejak saat itu.",
+       "rcfilters-filter-showlinkedfrom-label": "Tampilkan perubahan pada halaman yang ditautkan dari",
        "rcfilters-target-page-placeholder": "Masukkan nama halaman",
        "rcnotefrom": "Di bawah ini adalah {{PLURAL:$5|perubahan}} sejak <strong>$3, $4</strong> (ditampilkan sampai <strong>$1</strong> perubahan).",
        "rclistfromreset": "Atur ulang pilihan tanggal",
index 55b9cb4..75ec38c 100644 (file)
        "rcfilters-activefilters": "Filtri attivi",
        "rcfilters-advancedfilters": "Filtri avanzati",
        "rcfilters-limit-title": "Risultati da mostrare",
-       "rcfilters-limit-and-date-label": "{{PLURAL:$1|modifica|$1 modifiche}}, $2",
+       "rcfilters-limit-and-date-label": "$1 {{PLURAL:$1|modifica|modifiche}}, $2",
        "rcfilters-date-popup-title": "Periodo di tempo per la ricerca",
        "rcfilters-days-title": "Giorni recenti",
        "rcfilters-hours-title": "Ore recenti",
index 7318df4..10418b0 100644 (file)
        "rcfilters-activefilters": "사용 중인 필터",
        "rcfilters-advancedfilters": "고급 필터",
        "rcfilters-limit-title": "표시할 결과 수",
-       "rcfilters-limit-and-date-label": "{{PLURAL:$1|변경사항|변경사항 $1개}}, $2",
+       "rcfilters-limit-and-date-label": "{{PLURAL:$1|변경사항}} $1개, $2",
        "rcfilters-date-popup-title": "검색 시한",
        "rcfilters-days-title": "최근 날",
        "rcfilters-hours-title": "최근 시간",
index 46ee0d5..4fc3f59 100644 (file)
        "rcfilters-activefilters": "Actieve filters",
        "rcfilters-advancedfilters": "Geavanceerde filters",
        "rcfilters-limit-title": "Resultaten om te tonen",
-       "rcfilters-limit-and-date-label": "{{PLURAL:$1|wijziging|$1 wijzigingen}}, $2",
+       "rcfilters-limit-and-date-label": "$1 {{PLURAL:$1|wijziging|wijzigingen}}, $2",
        "rcfilters-date-popup-title": "Tijdsperiode om te doorzoeken",
        "rcfilters-days-title": "Afgelopen dagen",
        "rcfilters-hours-title": "Afgelopen uren",
        "movenologintext": "U moet [[Special:UserLogin|aangemeld]] zijn om een pagina te hernoemen.",
        "movenotallowed": "U hebt geen rechten om pagina's te hernoemen.",
        "movenotallowedfile": "U hebt geen rechten om bestanden te hernoemen.",
-       "cant-move-user-page": "U hebt geen rechten om gebruikerspagina's te hernoemen (met uitzondering van subpagina's).",
-       "cant-move-to-user-page": "U hebt geen rechten om een pagina naar een gebruikerspagina te hernoemen. Hernoemen naar een subpagina is wel mogelijk.",
+       "cant-move-user-page": "U hebt geen rechten om gebruikerspagina's te hernoemen (met uitzondering van deelpagina's).",
+       "cant-move-to-user-page": "U hebt geen rechten om een pagina naar een gebruikerspagina te hernoemen. Hernoemen naar een deelpagina is wel mogelijk.",
        "cant-move-category-page": "U hebt geen rechten om categoriepagina's te hernoemen.",
        "cant-move-to-category-page": "U hebt geen rechten om een pagina naar een categoriepagina te hernoemen.",
        "cant-move-subpages": "U hebt geen rechten om deelpagina's te hernoemen.",
        "undelete-cantedit": "U kunt deze pagina niet terug plaatsen omdat u niet het recht hebt om deze pagina te bewerken.",
        "undelete-cantcreate": "U kunt deze pagina niet terugplaatsen omdat er geen bestaande pagina met deze naam is en u geen toestemming hebt om deze pagina aan te maken.",
        "pagedata-title": "Pagina data",
-       "pagedata-text": "Deze pagina biedt een data-interface voor pagina's. Geef een paginatitel op door deze in de URL op te nemen, op de manier van een subpagina.\n* De inhoud wordt afgestemd op de door de client meegestuurde Accept Header. Dit betekent dat de gegevens voor de pagina worden aangeboden in het voorkeursformaat van uw client.",
+       "pagedata-text": "Deze pagina biedt een data-interface voor pagina's. Geef een paginatitel op door deze in de URL op te nemen, op de manier van een deelpagina.\n* De inhoud wordt afgestemd op de door de client meegestuurde Accept Header. Dit betekent dat de gegevens voor de pagina worden aangeboden in het voorkeursformaat van uw client.",
        "pagedata-not-acceptable": "Er is geen overeenkomende indeling gevonden. Ondersteunde MIME-typen: $1",
        "pagedata-bad-title": "Ongeldige titel: $1."
 }
index e32ea47..2b9c349 100644 (file)
        "cant-move-subpages": "Não tem permissão para mover subpáginas.",
        "namespace-nosubpages": "O espaço nominal \"$1\" não permite subpáginas.",
        "newtitle": "Novo título:",
-       "move-watch": "Vigiar esta página",
+       "move-watch": "Vigiar a página original e a nova",
        "movepagebtn": "Mover página",
-       "pagemovedsub": "Página movida com sucesso",
+       "pagemovedsub": "Página movida",
        "movepage-moved": "<strong>\"$1\" foi movida para \"$2\"</strong>",
        "movepage-moved-redirect": "Foi criado um redirecionamento.",
        "movepage-moved-noredirect": "A criação de um redirecionamento foi suprimida.",
-       "articleexists": "Uma página com este nome já existe, ou o nome que escolheu é inválido.\nEscolha outro nome, por favor.",
+       "articleexists": "Ou já existe uma página com este nome ou o nome que escolheu é inválido.\nEscolha outro nome, por favor.",
        "cantmove-titleprotected": "Não pode mover uma página para esse destino, porque o novo título foi protegido para evitar a sua criação",
        "movetalk": "Mover também a página de discussão associada",
        "move-subpages": "Mover subpáginas (até $1)",
index e39d7a8..e4f3e9f 100644 (file)
@@ -33,7 +33,8 @@
                        "Turbojet",
                        "Stephanecbisson",
                        "Matrafox",
-                       "Cybernenea11"
+                       "Cybernenea11",
+                       "Andreyyshore"
                ]
        },
        "tog-underline": "Sublinierea legăturilor:",
        "timezoneregion-indian": "Oceanul Indian",
        "timezoneregion-pacific": "Oceanul Pacific",
        "allowemail": "Acceptă e-mail de la alți utilizatori",
+       "email-allow-new-users-label": "Acceptă e-mail de la utilizatorii noi",
+       "email-blacklist-label": "Respinge e-mail de la acești utilizatori:",
        "prefs-searchoptions": "Căutare",
        "prefs-namespaces": "Spații de nume",
        "default": "standard",
index 6949d59..b264263 100644 (file)
        "tag-list-wrapper": "([[Special:Tags|{{PLURAL:$1|1=Метка|Метки}}]]: $2)",
        "tag-mw-contentmodelchange": "изменение модели содержимого",
        "tag-mw-contentmodelchange-description": "Правки, которые [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:ChangeContentModel изменяют модель содержимого] страницы",
-       "tag-mw-new-redirect": "Ð\9dовое перенаправление",
+       "tag-mw-new-redirect": "новое перенаправление",
        "tag-mw-new-redirect-description": "Правки, которые создают новое перенаправление или изменяют страницу на перенаправление",
        "tag-mw-removed-redirect": "удалённое перенаправление",
        "tag-mw-removed-redirect-description": "Правки, которые изменяют существующее перенаправление на не-перенаправление",
index 6c29aab..22afadc 100644 (file)
        "right-bigdelete": "ڊگھيون سوانح رکندڙ صفحا ڊاهيو",
        "right-browsearchive": "ڊاٺل صفحا ڳوليو",
        "right-undelete": "ڪو صفحو اڻڊاهيو",
+       "right-suppressionlog": "خانگي لاگ ڏسو",
        "right-unblockself": "ڪنهن تان بندش ختم ڪريو",
        "right-editinterface": "واپرائيندڙ باهمرُو کي سنواريو",
        "right-viewmywatchlist": "پنهنجي نظر ۾ فھرست ڏسو",
        "rcfilters-other-review-tools": "نظرثانيءَ جا ٻيا اوزار",
        "rcfilters-activefilters": "سرگرم ڇاڻيون",
        "rcfilters-advancedfilters": "متقدم ڇاڻيون",
-       "rcfilters-limit-and-date-label": "{{PLURAL:$1|تبديلي|$1 تبديليون}}، $2",
+       "rcfilters-limit-and-date-label": "$1 {{PLURAL:$1|تبديلي|$1 تبديليون}}، $2",
        "rcfilters-days-title": "ھاڻوڪا ڏينھن",
        "rcfilters-days-show-days": "$1 {{PLURAL:$1|ڏينھُن|ڏينھَن}}",
        "rcfilters-highlighted-filters-list": "نمايان-ٿيل:$1",
        "exif-objectname": "مختصر عنوان",
        "exif-headline": "سرخي",
        "exif-source": "ذريعو",
+       "exif-contact": "رابطي جي معلومات",
        "exif-writer": "لکندڙ",
        "exif-languagecode": "ٻولي",
        "exif-disclaimer": "غيرجوابدارينامو",
index 8bfead3..861a613 100644 (file)
@@ -414,7 +414,7 @@ abstract class Maintenance {
                        $this->fatalError( $err, intval( $die ) );
                }
                $this->outputChanneled( false );
-               if ( PHP_SAPI == 'cli' ) {
+               if ( PHP_SAPI == 'cli' || PHP_SAPI == 'phpdbg' ) {
                        fwrite( STDERR, $err . "\n" );
                } else {
                        print $err;
@@ -676,7 +676,8 @@ abstract class Maintenance {
                global $IP, $wgCommandLineMode, $wgRequestTime;
 
                # Abort if called from a web server
-               if ( PHP_SAPI !== 'cli' ) {
+               # wfIsCLI() is not available yet
+               if ( PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg' ) {
                        $this->fatalError( 'This script must be run from the command line' );
                }
 
diff --git a/maintenance/backupPrefetch.inc b/maintenance/backupPrefetch.inc
deleted file mode 100644 (file)
index 6a2d3bf..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-<?php
-/**
- * Helper class for the --prefetch option of dumpTextPass.php
- *
- * Copyright © 2005 Brion Vibber <brion@pobox.com>
- * https://www.mediawiki.org/
- *
- * 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 Maintenance
- */
-
-/**
- * Readahead helper for making large MediaWiki data dumps;
- * reads in a previous XML dump to sequentially prefetch text
- * records already normalized and decompressed.
- *
- * This can save load on the external database servers, hopefully.
- *
- * Assumes that dumps will be recorded in the canonical order:
- * - ascending by page_id
- * - ascending by rev_id within each page
- * - text contents are immutable and should not change once
- *   recorded, so the previous dump is a reliable source
- *
- * @ingroup Maintenance
- */
-class BaseDump {
-       /** @var XMLReader */
-       protected $reader = null;
-       protected $atEnd = false;
-       protected $atPageEnd = false;
-       protected $lastPage = 0;
-       protected $lastRev = 0;
-       protected $infiles = null;
-
-       public function __construct( $infile ) {
-               $this->infiles = explode( ';', $infile );
-               $this->reader = new XMLReader();
-               $infile = array_shift( $this->infiles );
-               if ( defined( 'LIBXML_PARSEHUGE' ) ) {
-                       $this->reader->open( $infile, null, LIBXML_PARSEHUGE );
-               } else {
-                       $this->reader->open( $infile );
-               }
-       }
-
-       /**
-        * Attempts to fetch the text of a particular page revision
-        * from the dump stream. May return null if the page is
-        * unavailable.
-        *
-        * @param int $page ID number of page to read
-        * @param int $rev ID number of revision to read
-        * @return string|null
-        */
-       function prefetch( $page, $rev ) {
-               $page = intval( $page );
-               $rev = intval( $rev );
-               while ( $this->lastPage < $page && !$this->atEnd ) {
-                       $this->debug( "BaseDump::prefetch at page $this->lastPage, looking for $page" );
-                       $this->nextPage();
-               }
-               if ( $this->lastPage > $page || $this->atEnd ) {
-                       $this->debug( "BaseDump::prefetch already past page $page "
-                               . "looking for rev $rev  [$this->lastPage, $this->lastRev]" );
-
-                       return null;
-               }
-               while ( $this->lastRev < $rev && !$this->atEnd && !$this->atPageEnd ) {
-                       $this->debug( "BaseDump::prefetch at page $this->lastPage, rev $this->lastRev, "
-                               . "looking for $page, $rev" );
-                       $this->nextRev();
-               }
-               if ( $this->lastRev == $rev && !$this->atEnd ) {
-                       $this->debug( "BaseDump::prefetch hit on $page, $rev [$this->lastPage, $this->lastRev]" );
-
-                       return $this->nextText();
-               } else {
-                       $this->debug( "BaseDump::prefetch already past rev $rev on page $page "
-                               . "[$this->lastPage, $this->lastRev]" );
-
-                       return null;
-               }
-       }
-
-       function debug( $str ) {
-               wfDebug( $str . "\n" );
-               // global $dumper;
-               // $dumper->progress( $str );
-       }
-
-       /**
-        * @access private
-        */
-       function nextPage() {
-               if ( $this->skipTo( 'page', 'mediawiki' ) ) {
-                       if ( $this->skipTo( 'id' ) ) {
-                               $this->lastPage = intval( $this->nodeContents() );
-                               $this->lastRev = 0;
-                               $this->atPageEnd = false;
-                       }
-               } else {
-                       $this->close();
-                       if ( count( $this->infiles ) ) {
-                               $infile = array_shift( $this->infiles );
-                               $this->reader->open( $infile );
-                               $this->atEnd = false;
-                       }
-               }
-       }
-
-       /**
-        * @access private
-        */
-       function nextRev() {
-               if ( $this->skipTo( 'revision' ) ) {
-                       if ( $this->skipTo( 'id' ) ) {
-                               $this->lastRev = intval( $this->nodeContents() );
-                       }
-               } else {
-                       $this->atPageEnd = true;
-               }
-       }
-
-       /**
-        * @access private
-        * @return string
-        */
-       function nextText() {
-               $this->skipTo( 'text' );
-
-               return strval( $this->nodeContents() );
-       }
-
-       /**
-        * @access private
-        * @param string $name
-        * @param string $parent
-        * @return bool|null
-        */
-       function skipTo( $name, $parent = 'page' ) {
-               if ( $this->atEnd ) {
-                       return false;
-               }
-               while ( $this->reader->read() ) {
-                       if ( $this->reader->nodeType == XMLReader::ELEMENT
-                               && $this->reader->name == $name
-                       ) {
-                               return true;
-                       }
-                       if ( $this->reader->nodeType == XMLReader::END_ELEMENT
-                               && $this->reader->name == $parent
-                       ) {
-                               $this->debug( "BaseDump::skipTo found </$parent> searching for <$name>" );
-
-                               return false;
-                       }
-               }
-
-               return $this->close();
-       }
-
-       /**
-        * Shouldn't something like this be built-in to XMLReader?
-        * Fetches text contents of the current element, assuming
-        * no sub-elements or such scary things.
-        *
-        * @return string
-        * @access private
-        */
-       function nodeContents() {
-               if ( $this->atEnd ) {
-                       return null;
-               }
-               if ( $this->reader->isEmptyElement ) {
-                       return "";
-               }
-               $buffer = "";
-               while ( $this->reader->read() ) {
-                       switch ( $this->reader->nodeType ) {
-                               case XMLReader::TEXT:
-                               // case XMLReader::WHITESPACE:
-                               case XMLReader::SIGNIFICANT_WHITESPACE:
-                                       $buffer .= $this->reader->value;
-                                       break;
-                               case XMLReader::END_ELEMENT:
-                                       return $buffer;
-                       }
-               }
-
-               return $this->close();
-       }
-
-       /**
-        * @access private
-        * @return null
-        */
-       function close() {
-               $this->reader->close();
-               $this->atEnd = true;
-
-               return null;
-       }
-}
index 0604f48..e18d0b8 100644 (file)
@@ -143,8 +143,6 @@ TEXT
        }
 
        function processOptions() {
-               global $IP;
-
                parent::processOptions();
 
                if ( $this->hasOption( 'buffersize' ) ) {
@@ -152,7 +150,6 @@ TEXT
                }
 
                if ( $this->hasOption( 'prefetch' ) ) {
-                       require_once "$IP/maintenance/backupPrefetch.inc";
                        $url = $this->processFileOpt( $this->getOption( 'prefetch' ) );
                        $this->prefetch = new BaseDump( $url );
                }
index bec11a0..189858c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-if ( PHP_SAPI != 'cli' ) {
+if ( PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg' ) {
        die( "This script can only be run from the command line.\n" );
 }
 
diff --git a/maintenance/migrateArchiveText.php b/maintenance/migrateArchiveText.php
new file mode 100644 (file)
index 0000000..dd78a7d
--- /dev/null
@@ -0,0 +1,159 @@
+<?php
+/**
+ * Migrate archive.ar_text and ar_flags to modern storage
+ *
+ * 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 Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+/**
+ * Maintenance script that migrates archive.ar_text and ar_flags to modern storage
+ *
+ * @ingroup Maintenance
+ * @since 1.31
+ */
+class MigrateArchiveText extends LoggedUpdateMaintenance {
+       public function __construct() {
+               parent::__construct();
+               $this->addDescription(
+                       'Migrates comments from pre-1.5 ar_text and ar_flags columns to modern storage'
+               );
+               $this->addOption(
+                       'replace-missing',
+                       "For rows with missing or unloadable data, throw away whatever is there and\n"
+                       . "mark them as \"error\" in the database."
+               );
+       }
+
+       /**
+        * Sets whether a run of this maintenance script has the force parameter set
+        * @param bool $forced
+        */
+       public function setForce( $forced = true ) {
+               $this->mOptions['force'] = $forced;
+       }
+
+       protected function getUpdateKey() {
+               return __CLASS__;
+       }
+
+       protected function doDBUpdates() {
+               global $wgDefaultExternalStore;
+
+               $replaceMissing = $this->hasOption( 'replace-missing' );
+               $batchSize = $this->getBatchSize();
+
+               $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] );
+               $dbw = $this->getDB( DB_MASTER );
+               if ( !$dbr->fieldExists( 'archive', 'ar_text', __METHOD__ ) ||
+                       !$dbw->fieldExists( 'archive', 'ar_text', __METHOD__ )
+               ) {
+                       $this->output( "No ar_text field, so nothing to migrate.\n" );
+                       return true;
+               }
+
+               $this->output( "Migrating ar_text to modern storage...\n" );
+               $last = 0;
+               $count = 0;
+               $errors = 0;
+               while ( true ) {
+                       $res = $dbr->select(
+                               'archive',
+                               [ 'ar_id', 'ar_text', 'ar_flags' ],
+                               [
+                                       'ar_text_id' => null,
+                                       "ar_id > $last",
+                               ],
+                               __METHOD__,
+                               [ 'LIMIT' => $batchSize, 'ORDER BY' => [ 'ar_id' ] ]
+                       );
+                       $numRows = $res->numRows();
+
+                       foreach ( $res as $row ) {
+                               $last = $row->ar_id;
+
+                               // Recompress the text (and store in external storage, if
+                               // applicable) if it's not already in external storage.
+                               if ( !in_array( 'external', explode( ',', $row->ar_flags ), true ) ) {
+                                       $data = Revision::getRevisionText( $row, 'ar_' );
+                                       if ( $data !== false ) {
+                                               $flags = Revision::compressRevisionText( $data );
+
+                                               if ( $wgDefaultExternalStore ) {
+                                                       $data = ExternalStore::insertToDefault( $data );
+                                                       if ( !$data ) {
+                                                               throw new MWException( "Unable to store text to external storage" );
+                                                       }
+                                                       if ( $flags ) {
+                                                               $flags .= ',';
+                                                       }
+                                                       $flags .= 'external';
+                                               }
+                                       } elseif ( $replaceMissing ) {
+                                               $this->error( "Replacing missing data for row ar_id=$row->ar_id" );
+                                               $data = 'Missing data in migrateArchiveText.php on ' . date( 'c' );
+                                               $flags = 'error';
+                                       } else {
+                                               $this->error( "No data for row ar_id=$row->ar_id" );
+                                               $errors++;
+                                               continue;
+                                       }
+                               } else {
+                                       $flags = $row->ar_flags;
+                                       $data = $row->ar_text;
+                               }
+
+                               $this->beginTransaction( $dbw, __METHOD__ );
+                               $dbw->insert(
+                                       'text',
+                                       [ 'old_text' => $data, 'old_flags' => $flags ],
+                                       __METHOD__
+                               );
+                               $id = $dbw->insertId();
+                               $dbw->update(
+                                       'archive',
+                                       [ 'ar_text_id' => $id, 'ar_text' => '', 'ar_flags' => '' ],
+                                       [ 'ar_id' => $row->ar_id, 'ar_text_id' => null ],
+                                       __METHOD__
+                               );
+                               $count += $dbw->affectedRows();
+                               $this->commitTransaction( $dbw, __METHOD__ );
+                       }
+
+                       if ( $numRows < $batchSize ) {
+                               // We must have reached the end
+                               break;
+                       }
+
+                       $this->output( "... $last\n" );
+                       // $this->commitTransaction() already waited for slaves, no need to re-wait here.
+               }
+
+               $this->output( "Completed ar_text migration, $count rows updated, $errors missing data.\n" );
+               if ( $errors ) {
+                       $this->output( "Run with --replace-missing to overwrite missing data with an error message.\n" );
+               }
+
+               return $errors === 0;
+       }
+}
+
+$maintClass = "MigrateArchiveText";
+require_once RUN_MAINTENANCE_IF_MAIN;
index feaad12..89fc44b 100644 (file)
@@ -39,7 +39,7 @@
  */
 
 // Warning: Converting this to a Maintenance script may reduce performance.
-if ( PHP_SAPI != 'cli' ) {
+if ( PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg' ) {
        die( "This filter can only be run from the command line.\n" );
 }
 
index 7d37b50..109ab7d 100644 (file)
@@ -1474,16 +1474,6 @@ return [
        'mediawiki.action.history.styles' => [
                'styles' => 'resources/src/mediawiki.action/mediawiki.action.history.styles.css',
        ],
-       // using this module is deprecated, for diff styles use mediawiki.diff.styles instead
-       'mediawiki.action.history.diff' => [
-               'styles' => [
-                       'resources/src/mediawiki/mediawiki.diff.styles.css',
-                       'resources/src/mediawiki/mediawiki.diff.styles.print.css' => [
-                               'media' => 'print'
-                       ],
-               ],
-               'targets' => [ 'desktop', 'mobile' ],
-       ],
        'mediawiki.action.view.dblClickEdit' => [
                'scripts' => 'resources/src/mediawiki.action/mediawiki.action.view.dblClickEdit.js',
                'dependencies' => [
index a78ad82..98d07f3 100644 (file)
                value = mw.widgets.TitleInputWidget.parent.prototype.cleanUpValue.call( this, value );
 
                return $.trimByteLength( this.value, value, this.maxLength, function ( value ) {
-                       var title = widget.getTitle( value );
+                       var title = widget.getMWTitle( value );
                        return title ? title.getMain() : value;
                } ).newVal;
        };
index 5670ce4..0c6385b 100644 (file)
         * @param {string} [value] Value to get a title for
         * @return {mw.Title|null} Title object, or null if value is invalid
         */
-       mw.widgets.TitleWidget.prototype.getTitle = function ( value ) {
+       mw.widgets.TitleWidget.prototype.getMWTitle = function ( value ) {
                var title = value !== undefined ? value : this.getQueryValue(),
                        // mw.Title doesn't handle null well
                        titleObj = mw.Title.newFromText( title, this.namespace !== null ? this.namespace : undefined );
         * @return {boolean} The query is valid
         */
        mw.widgets.TitleWidget.prototype.isQueryValid = function () {
-               return this.validateTitle ? !!this.getTitle() : true;
+               return this.validateTitle ? !!this.getMWTitle() : true;
        };
 
 }( jQuery, mediaWiki ) );
index 0df8357..52a565c 100644 (file)
@@ -41,7 +41,6 @@ return [
                [
                        'maintenance/7zip.inc',
                        'maintenance/backup.inc',
-                       'maintenance/backupPrefetch.inc',
                        'maintenance/cleanupTable.inc',
                        'maintenance/CodeCleanerGlobalsPass.inc',
                        'maintenance/commandLine.inc',
diff --git a/tests/phpunit/data/composer/installed.json b/tests/phpunit/data/composer/installed.json
new file mode 100644 (file)
index 0000000..ddac980
--- /dev/null
@@ -0,0 +1,1682 @@
+[
+    {
+        "name": "leafo/lessphp",
+        "version": "v0.5.0",
+        "version_normalized": "0.5.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/leafo/lessphp.git",
+            "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/leafo/lessphp/zipball/0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283",
+            "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283",
+            "shasum": ""
+        },
+        "time": "2014-11-24T18:39:20+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "0.4.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "lessc.inc.php"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT",
+            "GPL-3.0"
+        ],
+        "authors": [
+            {
+                "name": "Leaf Corcoran",
+                "email": "leafot@gmail.com",
+                "homepage": "http://leafo.net"
+            }
+        ],
+        "description": "lessphp is a compiler for LESS written in PHP.",
+        "homepage": "http://leafo.net/lessphp/"
+    },
+    {
+        "name": "psr/log",
+        "version": "1.0.0",
+        "version_normalized": "1.0.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/php-fig/log.git",
+            "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
+            "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
+            "shasum": ""
+        },
+        "time": "2012-12-21T11:40:51+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-0": {
+                "Psr\\Log\\": ""
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "PHP-FIG",
+                "homepage": "http://www.php-fig.org/"
+            }
+        ],
+        "description": "Common interface for logging libraries",
+        "keywords": [
+            "log",
+            "psr",
+            "psr-3"
+        ]
+    },
+    {
+        "name": "cssjanus/cssjanus",
+        "version": "v1.1.1",
+        "version_normalized": "1.1.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/cssjanus/php-cssjanus.git",
+            "reference": "62a9c32e6e140de09082b40a6e99d868ad14d4e0"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/cssjanus/php-cssjanus/zipball/62a9c32e6e140de09082b40a6e99d868ad14d4e0",
+            "reference": "62a9c32e6e140de09082b40a6e99d868ad14d4e0",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.3.3"
+        },
+        "require-dev": {
+            "jakub-onderka/php-parallel-lint": "0.8.*",
+            "phpunit/phpunit": "3.7.*",
+            "squizlabs/php_codesniffer": "1.*"
+        },
+        "time": "2014-11-14T20:00:50+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-0": {
+                "": "src/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "Apache-2.0"
+        ],
+        "description": "Convert CSS stylesheets between left-to-right and right-to-left."
+    },
+    {
+        "name": "cdb/cdb",
+        "version": "1.0.0",
+        "version_normalized": "1.0.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/wikimedia/cdb.git",
+            "reference": "918601ea3d31b8c37312e9c0e54446aa8bfb3425"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/wikimedia/cdb/zipball/918601ea3d31b8c37312e9c0e54446aa8bfb3425",
+            "reference": "918601ea3d31b8c37312e9c0e54446aa8bfb3425",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.3.2"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "*"
+        },
+        "time": "2014-11-12T19:03:26+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "GPLv2"
+        ],
+        "authors": [
+            {
+                "name": "Tim Starling",
+                "email": "tstarling@wikimedia.org"
+            },
+            {
+                "name": "Chad Horohoe",
+                "email": "chad@wikimedia.org"
+            }
+        ],
+        "description": "Constant Database (CDB) wrapper library for PHP. Provides pure-PHP fallback when dba_* functions are absent.",
+        "homepage": "https://www.mediawiki.org/wiki/CDB",
+        "abandoned": "wikimedia/cdb"
+    },
+    {
+        "name": "sebastian/version",
+        "version": "2.0.1",
+        "version_normalized": "2.0.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/version.git",
+            "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
+            "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.6"
+        },
+        "time": "2016-10-03T07:35:21+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "2.0.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de",
+                "role": "lead"
+            }
+        ],
+        "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+        "homepage": "https://github.com/sebastianbergmann/version"
+    },
+    {
+        "name": "sebastian/resource-operations",
+        "version": "1.0.0",
+        "version_normalized": "1.0.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/resource-operations.git",
+            "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+            "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.6.0"
+        },
+        "time": "2015-07-28T20:34:47+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.0.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            }
+        ],
+        "description": "Provides a list of PHP built-in functions that operate on resources",
+        "homepage": "https://www.github.com/sebastianbergmann/resource-operations"
+    },
+    {
+        "name": "sebastian/recursion-context",
+        "version": "3.0.0",
+        "version_normalized": "3.0.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/recursion-context.git",
+            "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8",
+            "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.0"
+        },
+        "time": "2017-03-03T06:23:57+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "3.0.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Jeff Welch",
+                "email": "whatthejeff@gmail.com"
+            },
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            },
+            {
+                "name": "Adam Harvey",
+                "email": "aharvey@php.net"
+            }
+        ],
+        "description": "Provides functionality to recursively process PHP variables",
+        "homepage": "http://www.github.com/sebastianbergmann/recursion-context"
+    },
+    {
+        "name": "sebastian/object-reflector",
+        "version": "1.1.1",
+        "version_normalized": "1.1.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/object-reflector.git",
+            "reference": "773f97c67f28de00d397be301821b06708fca0be"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be",
+            "reference": "773f97c67f28de00d397be301821b06708fca0be",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.0"
+        },
+        "time": "2017-03-29T09:07:27+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.1-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            }
+        ],
+        "description": "Allows reflection of object attributes, including inherited and non-public ones",
+        "homepage": "https://github.com/sebastianbergmann/object-reflector/"
+    },
+    {
+        "name": "sebastian/object-enumerator",
+        "version": "3.0.3",
+        "version_normalized": "3.0.3.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/object-enumerator.git",
+            "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5",
+            "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.0",
+            "sebastian/object-reflector": "^1.1.1",
+            "sebastian/recursion-context": "^3.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.0"
+        },
+        "time": "2017-08-03T12:35:26+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "3.0.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            }
+        ],
+        "description": "Traverses array structures and object graphs to enumerate all referenced objects",
+        "homepage": "https://github.com/sebastianbergmann/object-enumerator/"
+    },
+    {
+        "name": "sebastian/global-state",
+        "version": "2.0.0",
+        "version_normalized": "2.0.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/global-state.git",
+            "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4",
+            "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.0"
+        },
+        "suggest": {
+            "ext-uopz": "*"
+        },
+        "time": "2017-04-27T15:39:26+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "2.0-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            }
+        ],
+        "description": "Snapshotting of global state",
+        "homepage": "http://www.github.com/sebastianbergmann/global-state",
+        "keywords": [
+            "global state"
+        ]
+    },
+    {
+        "name": "sebastian/exporter",
+        "version": "3.1.0",
+        "version_normalized": "3.1.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/exporter.git",
+            "reference": "234199f4528de6d12aaa58b612e98f7d36adb937"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937",
+            "reference": "234199f4528de6d12aaa58b612e98f7d36adb937",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.0",
+            "sebastian/recursion-context": "^3.0"
+        },
+        "require-dev": {
+            "ext-mbstring": "*",
+            "phpunit/phpunit": "^6.0"
+        },
+        "time": "2017-04-03T13:19:02+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "3.1.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Jeff Welch",
+                "email": "whatthejeff@gmail.com"
+            },
+            {
+                "name": "Volker Dusch",
+                "email": "github@wallbash.com"
+            },
+            {
+                "name": "Bernhard Schussek",
+                "email": "bschussek@2bepublished.at"
+            },
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            },
+            {
+                "name": "Adam Harvey",
+                "email": "aharvey@php.net"
+            }
+        ],
+        "description": "Provides the functionality to export PHP variables for visualization",
+        "homepage": "http://www.github.com/sebastianbergmann/exporter",
+        "keywords": [
+            "export",
+            "exporter"
+        ]
+    },
+    {
+        "name": "sebastian/environment",
+        "version": "3.1.0",
+        "version_normalized": "3.1.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/environment.git",
+            "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5",
+            "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.1"
+        },
+        "time": "2017-07-01T08:51:00+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "3.1.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            }
+        ],
+        "description": "Provides functionality to handle HHVM/PHP environments",
+        "homepage": "http://www.github.com/sebastianbergmann/environment",
+        "keywords": [
+            "Xdebug",
+            "environment",
+            "hhvm"
+        ]
+    },
+    {
+        "name": "sebastian/diff",
+        "version": "2.0.1",
+        "version_normalized": "2.0.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/diff.git",
+            "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd",
+            "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.2"
+        },
+        "time": "2017-08-03T08:09:46+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "2.0-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Kore Nordmann",
+                "email": "mail@kore-nordmann.de"
+            },
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            }
+        ],
+        "description": "Diff implementation",
+        "homepage": "https://github.com/sebastianbergmann/diff",
+        "keywords": [
+            "diff"
+        ]
+    },
+    {
+        "name": "sebastian/comparator",
+        "version": "2.1.1",
+        "version_normalized": "2.1.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/comparator.git",
+            "reference": "b11c729f95109b56a0fe9650c6a63a0fcd8c439f"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b11c729f95109b56a0fe9650c6a63a0fcd8c439f",
+            "reference": "b11c729f95109b56a0fe9650c6a63a0fcd8c439f",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.0",
+            "sebastian/diff": "^2.0",
+            "sebastian/exporter": "^3.1"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.4"
+        },
+        "time": "2017-12-22T14:50:35+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "2.1.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Jeff Welch",
+                "email": "whatthejeff@gmail.com"
+            },
+            {
+                "name": "Volker Dusch",
+                "email": "github@wallbash.com"
+            },
+            {
+                "name": "Bernhard Schussek",
+                "email": "bschussek@2bepublished.at"
+            },
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            }
+        ],
+        "description": "Provides the functionality to compare PHP values for equality",
+        "homepage": "https://github.com/sebastianbergmann/comparator",
+        "keywords": [
+            "comparator",
+            "compare",
+            "equality"
+        ]
+    },
+    {
+        "name": "doctrine/instantiator",
+        "version": "1.1.0",
+        "version_normalized": "1.1.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/doctrine/instantiator.git",
+            "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+            "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.1"
+        },
+        "require-dev": {
+            "athletic/athletic": "~0.1.8",
+            "ext-pdo": "*",
+            "ext-phar": "*",
+            "phpunit/phpunit": "^6.2.3",
+            "squizlabs/php_codesniffer": "^3.0.2"
+        },
+        "time": "2017-07-22T11:58:36+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.2.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Marco Pivetta",
+                "email": "ocramius@gmail.com",
+                "homepage": "http://ocramius.github.com/"
+            }
+        ],
+        "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+        "homepage": "https://github.com/doctrine/instantiator",
+        "keywords": [
+            "constructor",
+            "instantiate"
+        ]
+    },
+    {
+        "name": "phpunit/php-text-template",
+        "version": "1.2.1",
+        "version_normalized": "1.2.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/php-text-template.git",
+            "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+            "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.3.3"
+        },
+        "time": "2015-06-21T13:50:34+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de",
+                "role": "lead"
+            }
+        ],
+        "description": "Simple template engine.",
+        "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+        "keywords": [
+            "template"
+        ]
+    },
+    {
+        "name": "phpunit/phpunit-mock-objects",
+        "version": "5.0.6",
+        "version_normalized": "5.0.6.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+            "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
+            "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
+            "shasum": ""
+        },
+        "require": {
+            "doctrine/instantiator": "^1.0.5",
+            "php": "^7.0",
+            "phpunit/php-text-template": "^1.2.1",
+            "sebastian/exporter": "^3.1"
+        },
+        "conflict": {
+            "phpunit/phpunit": "<6.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.5"
+        },
+        "suggest": {
+            "ext-soap": "*"
+        },
+        "time": "2018-01-06T05:45:45+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "5.0.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de",
+                "role": "lead"
+            }
+        ],
+        "description": "Mock Object library for PHPUnit",
+        "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+        "keywords": [
+            "mock",
+            "xunit"
+        ]
+    },
+    {
+        "name": "phpunit/php-timer",
+        "version": "1.0.9",
+        "version_normalized": "1.0.9.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/php-timer.git",
+            "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+            "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^5.3.3 || ^7.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+        },
+        "time": "2017-02-26T11:10:40+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.0-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sb@sebastian-bergmann.de",
+                "role": "lead"
+            }
+        ],
+        "description": "Utility class for timing",
+        "homepage": "https://github.com/sebastianbergmann/php-timer/",
+        "keywords": [
+            "timer"
+        ]
+    },
+    {
+        "name": "phpunit/php-file-iterator",
+        "version": "1.4.5",
+        "version_normalized": "1.4.5.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+            "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
+            "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.3.3"
+        },
+        "time": "2017-11-27T13:52:08+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.4.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sb@sebastian-bergmann.de",
+                "role": "lead"
+            }
+        ],
+        "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+        "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+        "keywords": [
+            "filesystem",
+            "iterator"
+        ]
+    },
+    {
+        "name": "theseer/tokenizer",
+        "version": "1.1.0",
+        "version_normalized": "1.1.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/theseer/tokenizer.git",
+            "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b",
+            "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b",
+            "shasum": ""
+        },
+        "require": {
+            "ext-dom": "*",
+            "ext-tokenizer": "*",
+            "ext-xmlwriter": "*",
+            "php": "^7.0"
+        },
+        "time": "2017-04-07T12:08:54+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Arne Blankerts",
+                "email": "arne@blankerts.de",
+                "role": "Developer"
+            }
+        ],
+        "description": "A small library for converting tokenized PHP source code into XML and potentially other formats"
+    },
+    {
+        "name": "sebastian/code-unit-reverse-lookup",
+        "version": "1.0.1",
+        "version_normalized": "1.0.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
+            "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
+            "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^5.6 || ^7.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^5.7 || ^6.0"
+        },
+        "time": "2017-03-04T06:30:41+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.0.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            }
+        ],
+        "description": "Looks up which function or method a line of code belongs to",
+        "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/"
+    },
+    {
+        "name": "phpunit/php-token-stream",
+        "version": "2.0.2",
+        "version_normalized": "2.0.2.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+            "reference": "791198a2c6254db10131eecfe8c06670700904db"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
+            "reference": "791198a2c6254db10131eecfe8c06670700904db",
+            "shasum": ""
+        },
+        "require": {
+            "ext-tokenizer": "*",
+            "php": "^7.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.2.4"
+        },
+        "time": "2017-11-27T05:48:46+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "2.0-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de"
+            }
+        ],
+        "description": "Wrapper around PHP's tokenizer extension.",
+        "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+        "keywords": [
+            "tokenizer"
+        ]
+    },
+    {
+        "name": "phpunit/php-code-coverage",
+        "version": "5.3.0",
+        "version_normalized": "5.3.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+            "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1",
+            "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1",
+            "shasum": ""
+        },
+        "require": {
+            "ext-dom": "*",
+            "ext-xmlwriter": "*",
+            "php": "^7.0",
+            "phpunit/php-file-iterator": "^1.4.2",
+            "phpunit/php-text-template": "^1.2.1",
+            "phpunit/php-token-stream": "^2.0.1",
+            "sebastian/code-unit-reverse-lookup": "^1.0.1",
+            "sebastian/environment": "^3.0",
+            "sebastian/version": "^2.0.1",
+            "theseer/tokenizer": "^1.1"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^6.0"
+        },
+        "suggest": {
+            "ext-xdebug": "^2.5.5"
+        },
+        "time": "2017-12-06T09:29:45+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "5.3.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de",
+                "role": "lead"
+            }
+        ],
+        "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+        "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+        "keywords": [
+            "coverage",
+            "testing",
+            "xunit"
+        ]
+    },
+    {
+        "name": "webmozart/assert",
+        "version": "1.2.0",
+        "version_normalized": "1.2.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/webmozart/assert.git",
+            "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f",
+            "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^5.3.3 || ^7.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^4.6",
+            "sebastian/version": "^1.0.1"
+        },
+        "time": "2016-11-23T20:04:58+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.3-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "Webmozart\\Assert\\": "src/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Bernhard Schussek",
+                "email": "bschussek@gmail.com"
+            }
+        ],
+        "description": "Assertions to validate method input/output with nice error messages.",
+        "keywords": [
+            "assert",
+            "check",
+            "validate"
+        ]
+    },
+    {
+        "name": "phpdocumentor/reflection-common",
+        "version": "1.0.1",
+        "version_normalized": "1.0.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
+            "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+            "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.5"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^4.6"
+        },
+        "time": "2017-09-11T18:02:19+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.0.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "phpDocumentor\\Reflection\\": [
+                    "src"
+                ]
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Jaap van Otterdijk",
+                "email": "opensource@ijaap.nl"
+            }
+        ],
+        "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+        "homepage": "http://www.phpdoc.org",
+        "keywords": [
+            "FQSEN",
+            "phpDocumentor",
+            "phpdoc",
+            "reflection",
+            "static analysis"
+        ]
+    },
+    {
+        "name": "phpdocumentor/type-resolver",
+        "version": "0.4.0",
+        "version_normalized": "0.4.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/phpDocumentor/TypeResolver.git",
+            "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
+            "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^5.5 || ^7.0",
+            "phpdocumentor/reflection-common": "^1.0"
+        },
+        "require-dev": {
+            "mockery/mockery": "^0.9.4",
+            "phpunit/phpunit": "^5.2||^4.8.24"
+        },
+        "time": "2017-07-14T14:27:02+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.0.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "phpDocumentor\\Reflection\\": [
+                    "src/"
+                ]
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Mike van Riel",
+                "email": "me@mikevanriel.com"
+            }
+        ]
+    },
+    {
+        "name": "phpdocumentor/reflection-docblock",
+        "version": "4.2.0",
+        "version_normalized": "4.2.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
+            "reference": "66465776cfc249844bde6d117abff1d22e06c2da"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da",
+            "reference": "66465776cfc249844bde6d117abff1d22e06c2da",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^7.0",
+            "phpdocumentor/reflection-common": "^1.0.0",
+            "phpdocumentor/type-resolver": "^0.4.0",
+            "webmozart/assert": "^1.0"
+        },
+        "require-dev": {
+            "doctrine/instantiator": "~1.0.5",
+            "mockery/mockery": "^1.0",
+            "phpunit/phpunit": "^6.4"
+        },
+        "time": "2017-11-27T17:38:31+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "4.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "phpDocumentor\\Reflection\\": [
+                    "src/"
+                ]
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Mike van Riel",
+                "email": "me@mikevanriel.com"
+            }
+        ],
+        "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock."
+    },
+    {
+        "name": "phpspec/prophecy",
+        "version": "1.7.3",
+        "version_normalized": "1.7.3.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/phpspec/prophecy.git",
+            "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
+            "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
+            "shasum": ""
+        },
+        "require": {
+            "doctrine/instantiator": "^1.0.2",
+            "php": "^5.3|^7.0",
+            "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
+            "sebastian/comparator": "^1.1|^2.0",
+            "sebastian/recursion-context": "^1.0|^2.0|^3.0"
+        },
+        "require-dev": {
+            "phpspec/phpspec": "^2.5|^3.2",
+            "phpunit/phpunit": "^4.8.35 || ^5.7"
+        },
+        "time": "2017-11-24T13:59:53+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.7.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "psr-0": {
+                "Prophecy\\": "src/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "authors": [
+            {
+                "name": "Konstantin Kudryashov",
+                "email": "ever.zet@gmail.com",
+                "homepage": "http://everzet.com"
+            },
+            {
+                "name": "Marcello Duarte",
+                "email": "marcello.duarte@gmail.com"
+            }
+        ],
+        "description": "Highly opinionated mocking framework for PHP 5.3+",
+        "homepage": "https://github.com/phpspec/prophecy",
+        "keywords": [
+            "Double",
+            "Dummy",
+            "fake",
+            "mock",
+            "spy",
+            "stub"
+        ]
+    },
+    {
+        "name": "phar-io/version",
+        "version": "1.0.1",
+        "version_normalized": "1.0.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/phar-io/version.git",
+            "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df",
+            "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^5.6 || ^7.0"
+        },
+        "time": "2017-03-05T17:38:23+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Arne Blankerts",
+                "email": "arne@blankerts.de",
+                "role": "Developer"
+            },
+            {
+                "name": "Sebastian Heuer",
+                "email": "sebastian@phpeople.de",
+                "role": "Developer"
+            },
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de",
+                "role": "Developer"
+            }
+        ],
+        "description": "Library for handling version information and constraints"
+    },
+    {
+        "name": "phar-io/manifest",
+        "version": "1.0.1",
+        "version_normalized": "1.0.1.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/phar-io/manifest.git",
+            "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0",
+            "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0",
+            "shasum": ""
+        },
+        "require": {
+            "ext-dom": "*",
+            "ext-phar": "*",
+            "phar-io/version": "^1.0.1",
+            "php": "^5.6 || ^7.0"
+        },
+        "time": "2017-03-05T18:14:27+00:00",
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "1.0.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Arne Blankerts",
+                "email": "arne@blankerts.de",
+                "role": "Developer"
+            },
+            {
+                "name": "Sebastian Heuer",
+                "email": "sebastian@phpeople.de",
+                "role": "Developer"
+            },
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de",
+                "role": "Developer"
+            }
+        ],
+        "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)"
+    },
+    {
+        "name": "myclabs/deep-copy",
+        "version": "1.7.0",
+        "version_normalized": "1.7.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/myclabs/DeepCopy.git",
+            "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
+            "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
+            "shasum": ""
+        },
+        "require": {
+            "php": "^5.6 || ^7.0"
+        },
+        "require-dev": {
+            "doctrine/collections": "^1.0",
+            "doctrine/common": "^2.6",
+            "phpunit/phpunit": "^4.1"
+        },
+        "time": "2017-10-19T19:58:43+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-4": {
+                "DeepCopy\\": "src/DeepCopy/"
+            },
+            "files": [
+                "src/DeepCopy/deep_copy.php"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "MIT"
+        ],
+        "description": "Create deep copies (clones) of your objects",
+        "keywords": [
+            "clone",
+            "copy",
+            "duplicate",
+            "object",
+            "object graph"
+        ]
+    },
+    {
+        "name": "phpunit/phpunit",
+        "version": "6.5.5",
+        "version_normalized": "6.5.5.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/sebastianbergmann/phpunit.git",
+            "reference": "83d27937a310f2984fd575686138597147bdc7df"
+        },
+        "dist": {
+            "type": "zip",
+            "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/83d27937a310f2984fd575686138597147bdc7df",
+            "reference": "83d27937a310f2984fd575686138597147bdc7df",
+            "shasum": ""
+        },
+        "require": {
+            "ext-dom": "*",
+            "ext-json": "*",
+            "ext-libxml": "*",
+            "ext-mbstring": "*",
+            "ext-xml": "*",
+            "myclabs/deep-copy": "^1.6.1",
+            "phar-io/manifest": "^1.0.1",
+            "phar-io/version": "^1.0",
+            "php": "^7.0",
+            "phpspec/prophecy": "^1.7",
+            "phpunit/php-code-coverage": "^5.3",
+            "phpunit/php-file-iterator": "^1.4.3",
+            "phpunit/php-text-template": "^1.2.1",
+            "phpunit/php-timer": "^1.0.9",
+            "phpunit/phpunit-mock-objects": "^5.0.5",
+            "sebastian/comparator": "^2.1",
+            "sebastian/diff": "^2.0",
+            "sebastian/environment": "^3.1",
+            "sebastian/exporter": "^3.1",
+            "sebastian/global-state": "^2.0",
+            "sebastian/object-enumerator": "^3.0.3",
+            "sebastian/resource-operations": "^1.0",
+            "sebastian/version": "^2.0.1"
+        },
+        "conflict": {
+            "phpdocumentor/reflection-docblock": "3.0.2",
+            "phpunit/dbunit": "<3.0"
+        },
+        "require-dev": {
+            "ext-pdo": "*"
+        },
+        "suggest": {
+            "ext-xdebug": "*",
+            "phpunit/php-invoker": "^1.1"
+        },
+        "time": "2017-12-17T06:31:19+00:00",
+        "bin": [
+            "phpunit"
+        ],
+        "type": "library",
+        "extra": {
+            "branch-alias": {
+                "dev-master": "6.5.x-dev"
+            }
+        },
+        "installation-source": "dist",
+        "autoload": {
+            "classmap": [
+                "src/"
+            ]
+        },
+        "notification-url": "https://packagist.org/downloads/",
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Sebastian Bergmann",
+                "email": "sebastian@phpunit.de",
+                "role": "lead"
+            }
+        ],
+        "description": "The PHP Unit Testing framework.",
+        "homepage": "https://phpunit.de/",
+        "keywords": [
+            "phpunit",
+            "testing",
+            "xunit"
+        ]
+    }
+]
index a6efc85..81ceb59 100644 (file)
@@ -271,9 +271,9 @@ class CSSMinTest extends MediaWikiTestCase {
                // data: URIs for red.gif, green.gif, circle.svg
                $red   = 'data:image/gif;base64,R0lGODlhAQABAIAAAP8AADAAACwAAAAAAQABAAACAkQBADs=';
                $green = 'data:image/gif;base64,R0lGODlhAQABAIAAAACAADAAACwAAAAAAQABAAACAkQBADs=';
-               $svg = 'data:image/svg+xml,%3C%3Fxml version=%221.0%22 encoding=%22UTF-8%22%3F%3E%0A'
+               $svg = 'data:image/svg+xml,%3C%3Fxml version=%221.0%22 encoding=%22UTF-8%22%3F%3E '
                        . '%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%228%22 height='
-                       . '%228%22%3E%0A%09%3Ccircle cx=%224%22 cy=%224%22 r=%222%22/%3E%0A%3C/svg%3E%0A';
+                       . '%228%22%3E %3Ccircle cx=%224%22 cy=%224%22 r=%222%22/%3E %3C/svg%3E';
 
                // phpcs:disable Generic.Files.LineLength
                return [
diff --git a/tests/phpunit/includes/libs/composer/ComposerInstalledTest.php b/tests/phpunit/includes/libs/composer/ComposerInstalledTest.php
new file mode 100644 (file)
index 0000000..23225b6
--- /dev/null
@@ -0,0 +1,499 @@
+<?php
+
+class ComposerInstalledTest extends MediaWikiTestCase {
+
+       private $installed;
+
+       public function setUp() {
+               parent::setUp();
+               global $IP;
+               $this->installed = "$IP/tests/phpunit/data/composer/installed.json";
+       }
+
+       /**
+        * @covers ComposerInstalled::__construct
+        * @covers ComposerInstalled::getInstalledDependencies
+        */
+       public function testGetInstalledDependencies() {
+               $installed = new ComposerInstalled( $this->installed );
+               $this->assertArrayEquals( [
+               'leafo/lessphp' => [
+                       'version' => '0.5.0',
+                       'type' => 'library',
+                       'licenses' => [ 'MIT', 'GPL-3.0' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Leaf Corcoran',
+                                       'email' => 'leafot@gmail.com',
+                                       'homepage' => 'http://leafo.net',
+                               ],
+                       ],
+                       'description' => 'lessphp is a compiler for LESS written in PHP.',
+               ],
+               'psr/log' => [
+                       'version' => '1.0.0',
+                       'type' => 'library',
+                       'licenses' => [ 'MIT' ],
+                       'authors' => [
+                               [
+                                       'name' => 'PHP-FIG',
+                                       'homepage' => 'http://www.php-fig.org/',
+                               ],
+                       ],
+                       'description' => 'Common interface for logging libraries',
+               ],
+               'cssjanus/cssjanus' => [
+                       'version' => '1.1.1',
+                       'type' => 'library',
+                       'licenses' => [ 'Apache-2.0' ],
+                       'authors' => [
+                       ],
+                       'description' => 'Convert CSS stylesheets between left-to-right ' .
+                               'and right-to-left.',
+               ],
+               'cdb/cdb' => [
+                       'version' => '1.0.0',
+                       'type' => 'library',
+                       'licenses' => [ 'GPLv2' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Tim Starling',
+                                       'email' => 'tstarling@wikimedia.org',
+                               ],
+                               [
+                                       'name' => 'Chad Horohoe',
+                                       'email' => 'chad@wikimedia.org',
+                               ],
+                       ],
+                       'description' => 'Constant Database (CDB) wrapper library for PHP. ' .
+                               'Provides pure-PHP fallback when dba_* functions are absent.',
+               ],
+               'sebastian/version' => [
+                       'version' => '2.0.1',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                                       'role' => 'lead',
+                               ],
+                       ],
+                       'description' => 'Library that helps with managing the version ' .
+                               'number of Git-hosted PHP projects',
+               ],
+               'sebastian/resource-operations' => [
+                       'version' => '1.0.0',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                       ],
+                       'description' => 'Provides a list of PHP built-in functions that ' .
+                               'operate on resources',
+               ],
+               'sebastian/recursion-context' => [
+                       'version' => '3.0.0',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Jeff Welch',
+                                       'email' => 'whatthejeff@gmail.com',
+                               ],
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                               [
+                                       'name' => 'Adam Harvey',
+                                       'email' => 'aharvey@php.net',
+                               ],
+                       ],
+                       'description' => 'Provides functionality to recursively process PHP ' .
+                               'variables',
+               ],
+               'sebastian/object-reflector' => [
+                       'version' => '1.1.1',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                       ],
+                       'description' => 'Allows reflection of object attributes, including ' .
+                               'inherited and non-public ones',
+               ],
+               'sebastian/object-enumerator' => [
+                       'version' => '3.0.3',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                       ],
+                       'description' => 'Traverses array structures and object graphs ' .
+                               'to enumerate all referenced objects',
+               ],
+               'sebastian/global-state' => [
+                       'version' => '2.0.0',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                       ],
+                       'description' => 'Snapshotting of global state',
+               ],
+               'sebastian/exporter' => [
+                       'version' => '3.1.0',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Jeff Welch',
+                                       'email' => 'whatthejeff@gmail.com',
+                               ],
+                               [
+                                       'name' => 'Volker Dusch',
+                                       'email' => 'github@wallbash.com',
+                               ],
+                               [
+                                       'name' => 'Bernhard Schussek',
+                                       'email' => 'bschussek@2bepublished.at',
+                               ],
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                               [
+                                       'name' => 'Adam Harvey',
+                                       'email' => 'aharvey@php.net',
+                               ],
+                       ],
+                       'description' => 'Provides the functionality to export PHP ' .
+                               'variables for visualization',
+               ],
+               'sebastian/environment' => [
+                       'version' => '3.1.0',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                       ],
+                       'description' => 'Provides functionality to handle HHVM/PHP ' .
+                               'environments',
+               ],
+               'sebastian/diff' => [
+                       'version' => '2.0.1',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Kore Nordmann',
+                                       'email' => 'mail@kore-nordmann.de',
+                               ],
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                       ],
+                       'description' => 'Diff implementation',
+               ],
+               'sebastian/comparator' => [
+                       'version' => '2.1.1',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Jeff Welch',
+                                       'email' => 'whatthejeff@gmail.com',
+                               ],
+                               [
+                                       'name' => 'Volker Dusch',
+                                       'email' => 'github@wallbash.com',
+                               ],
+                               [
+                                       'name' => 'Bernhard Schussek',
+                                       'email' => 'bschussek@2bepublished.at',
+                               ],
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                       ],
+                       'description' => 'Provides the functionality to compare PHP ' .
+                               'values for equality',
+               ],
+               'doctrine/instantiator' => [
+                       'version' => '1.1.0',
+                       'type' => 'library',
+                       'licenses' => [ 'MIT' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Marco Pivetta',
+                                       'email' => 'ocramius@gmail.com',
+                                       'homepage' => 'http://ocramius.github.com/',
+                               ],
+                       ],
+                       'description' => 'A small, lightweight utility to instantiate ' .
+                               'objects in PHP without invoking their constructors',
+               ],
+               'phpunit/php-text-template' => [
+                       'version' => '1.2.1',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                                       'role' => 'lead',
+                               ],
+                       ],
+                       'description' => 'Simple template engine.',
+               ],
+               'phpunit/phpunit-mock-objects' => [
+                       'version' => '5.0.6',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                                       'role' => 'lead',
+                               ],
+                       ],
+                       'description' => 'Mock Object library for PHPUnit',
+               ],
+               'phpunit/php-timer' => [
+                       'version' => '1.0.9',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sb@sebastian-bergmann.de',
+                                       'role' => 'lead',
+                               ],
+                       ],
+                       'description' => 'Utility class for timing',
+               ],
+               'phpunit/php-file-iterator' => [
+                       'version' => '1.4.5',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sb@sebastian-bergmann.de',
+                                       'role' => 'lead',
+                               ],
+                       ],
+                       'description' => 'FilterIterator implementation that filters ' .
+                               'files based on a list of suffixes.',
+               ],
+               'theseer/tokenizer' => [
+                       'version' => '1.1.0',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Arne Blankerts',
+                                       'email' => 'arne@blankerts.de',
+                                       'role' => 'Developer',
+                               ],
+                       ],
+                       'description' => 'A small library for converting tokenized PHP ' .
+                               'source code into XML and potentially other formats',
+               ],
+               'sebastian/code-unit-reverse-lookup' => [
+                       'version' => '1.0.1',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                       ],
+                       'description' => 'Looks up which function or method a line of ' .
+                               'code belongs to',
+               ],
+               'phpunit/php-token-stream' => [
+                       'version' => '2.0.2',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                               ],
+                       ],
+                       'description' => 'Wrapper around PHP\'s tokenizer extension.',
+               ],
+               'phpunit/php-code-coverage' => [
+                       'version' => '5.3.0',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                                       'role' => 'lead',
+                               ],
+                       ],
+                       'description' => 'Library that provides collection, processing, ' .
+                               'and rendering functionality for PHP code coverage information.',
+               ],
+               'webmozart/assert' => [
+                       'version' => '1.2.0',
+                       'type' => 'library',
+                       'licenses' => [ 'MIT' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Bernhard Schussek',
+                                       'email' => 'bschussek@gmail.com',
+                               ],
+                       ],
+                       'description' => 'Assertions to validate method input/output with ' .
+                               'nice error messages.',
+               ],
+               'phpdocumentor/reflection-common' => [
+                       'version' => '1.0.1',
+                       'type' => 'library',
+                       'licenses' => [ 'MIT' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Jaap van Otterdijk',
+                                       'email' => 'opensource@ijaap.nl',
+                               ],
+                       ],
+                       'description' => 'Common reflection classes used by phpdocumentor to ' .
+                               'reflect the code structure',
+               ],
+               'phpdocumentor/type-resolver' => [
+                       'version' => '0.4.0',
+                       'type' => 'library',
+                       'licenses' => [ 'MIT' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Mike van Riel',
+                                       'email' => 'me@mikevanriel.com',
+                               ],
+                       ],
+                       'description' => '',
+               ],
+               'phpdocumentor/reflection-docblock' => [
+                       'version' => '4.2.0',
+                       'type' => 'library',
+                       'licenses' => [ 'MIT' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Mike van Riel',
+                                       'email' => 'me@mikevanriel.com',
+                               ],
+                       ],
+                       'description' => 'With this component, a library can provide support for ' .
+                               'annotations via DocBlocks or otherwise retrieve information that ' .
+                               'is embedded in a DocBlock.',
+               ],
+               'phpspec/prophecy' => [
+                       'version' => '1.7.3',
+                       'type' => 'library',
+                       'licenses' => [ 'MIT' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Konstantin Kudryashov',
+                                       'email' => 'ever.zet@gmail.com',
+                                       'homepage' => 'http://everzet.com',
+                               ],
+                               [
+                                       'name' => 'Marcello Duarte',
+                                       'email' => 'marcello.duarte@gmail.com',
+                               ],
+                       ],
+                       'description' => 'Highly opinionated mocking framework for PHP 5.3+',
+               ],
+               'phar-io/version' => [
+                       'version' => '1.0.1',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Arne Blankerts',
+                                       'email' => 'arne@blankerts.de',
+                                       'role' => 'Developer',
+                               ],
+                               [
+                                       'name' => 'Sebastian Heuer',
+                                       'email' => 'sebastian@phpeople.de',
+                                       'role' => 'Developer',
+                               ],
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                                       'role' => 'Developer',
+                               ],
+                       ],
+                       'description' => 'Library for handling version information and constraints',
+               ],
+               'phar-io/manifest' => [
+                       'version' => '1.0.1',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Arne Blankerts',
+                                       'email' => 'arne@blankerts.de',
+                                       'role' => 'Developer',
+                               ],
+                               [
+                                       'name' => 'Sebastian Heuer',
+                                       'email' => 'sebastian@phpeople.de',
+                                       'role' => 'Developer',
+                               ],
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                                       'role' => 'Developer',
+                               ],
+                       ],
+                       'description' => 'Component for reading phar.io manifest ' .
+                               'information from a PHP Archive (PHAR)',
+               ],
+               'myclabs/deep-copy' => [
+                       'version' => '1.7.0',
+                       'type' => 'library',
+                       'licenses' => [ 'MIT' ],
+                       'authors' => [
+                       ],
+                       'description' => 'Create deep copies (clones) of your objects',
+               ],
+               'phpunit/phpunit' => [
+                       'version' => '6.5.5',
+                       'type' => 'library',
+                       'licenses' => [ 'BSD-3-Clause' ],
+                       'authors' => [
+                               [
+                                       'name' => 'Sebastian Bergmann',
+                                       'email' => 'sebastian@phpunit.de',
+                                       'role' => 'lead',
+                               ],
+                       ],
+                       'description' => 'The PHP Unit Testing framework.',
+               ],
+               ], $installed->getInstalledDependencies(), false, true );
+       }
+}
diff --git a/tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php b/tests/phpunit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php
new file mode 100644 (file)
index 0000000..a8761e3
--- /dev/null
@@ -0,0 +1,246 @@
+<?php
+
+/**
+ * @author Addshore
+ *
+ * @covers NoWriteWatchedItemStore
+ */
+class NoWriteWatchedItemStoreUnitTest extends MediaWikiTestCase {
+
+       public function testAddWatch() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->never() )->method( 'addWatch' );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $this->setExpectedException( DBReadOnlyError::class );
+               $noWriteService->addWatch( $this->getTestSysop()->getUser(), new TitleValue( 0, 'Foo' ) );
+       }
+
+       public function testAddWatchBatchForUser() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->never() )->method( 'addWatchBatchForUser' );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $this->setExpectedException( DBReadOnlyError::class );
+               $noWriteService->addWatchBatchForUser( $this->getTestSysop()->getUser(), [] );
+       }
+
+       public function testRemoveWatch() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->never() )->method( 'removeWatch' );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $this->setExpectedException( DBReadOnlyError::class );
+               $noWriteService->removeWatch( $this->getTestSysop()->getUser(), new TitleValue( 0, 'Foo' ) );
+       }
+
+       public function testSetNotificationTimestampsForUser() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->never() )->method( 'setNotificationTimestampsForUser' );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $this->setExpectedException( DBReadOnlyError::class );
+               $noWriteService->setNotificationTimestampsForUser(
+                       $this->getTestSysop()->getUser(),
+                       'timestamp',
+                       []
+               );
+       }
+
+       public function testUpdateNotificationTimestamp() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->never() )->method( 'updateNotificationTimestamp' );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $this->setExpectedException( DBReadOnlyError::class );
+               $noWriteService->updateNotificationTimestamp(
+                       $this->getTestSysop()->getUser(),
+                       new TitleValue( 0, 'Foo' ),
+                       'timestamp'
+               );
+       }
+
+       public function testResetNotificationTimestamp() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->never() )->method( 'resetNotificationTimestamp' );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $this->setExpectedException( DBReadOnlyError::class );
+               $noWriteService->resetNotificationTimestamp(
+                       $this->getTestSysop()->getUser(),
+                       Title::newFromText( 'Foo' )
+               );
+       }
+
+       public function testCountWatchedItems() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )->method( 'countWatchedItems' )->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->countWatchedItems(
+                       $this->getTestSysop()->getUser()
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testCountWatchers() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )->method( 'countWatchers' )->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->countWatchers(
+                       new TitleValue( 0, 'Foo' )
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testCountVisitingWatchers() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )
+                       ->method( 'countVisitingWatchers' )
+                       ->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->countVisitingWatchers(
+                       new TitleValue( 0, 'Foo' ),
+                       9
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testCountWatchersMultiple() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )
+                       ->method( 'countVisitingWatchersMultiple' )
+                       ->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->countWatchersMultiple(
+                       [ new TitleValue( 0, 'Foo' ) ],
+                       []
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testCountVisitingWatchersMultiple() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )
+                       ->method( 'countVisitingWatchersMultiple' )
+                       ->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->countVisitingWatchersMultiple(
+                       [ [ new TitleValue( 0, 'Foo' ), 99 ] ],
+                       11
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testGetWatchedItem() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )->method( 'getWatchedItem' )->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->getWatchedItem(
+                       $this->getTestSysop()->getUser(),
+                       new TitleValue( 0, 'Foo' )
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testLoadWatchedItem() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )->method( 'loadWatchedItem' )->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->loadWatchedItem(
+                       $this->getTestSysop()->getUser(),
+                       new TitleValue( 0, 'Foo' )
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testGetWatchedItemsForUser() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )
+                       ->method( 'getWatchedItemsForUser' )
+                       ->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->getWatchedItemsForUser(
+                       $this->getTestSysop()->getUser(),
+                       []
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testIsWatched() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )->method( 'isWatched' )->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->isWatched(
+                       $this->getTestSysop()->getUser(),
+                       new TitleValue( 0, 'Foo' )
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testGetNotificationTimestampsBatch() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )
+                       ->method( 'getNotificationTimestampsBatch' )
+                       ->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->getNotificationTimestampsBatch(
+                       $this->getTestSysop()->getUser(),
+                       [ new TitleValue( 0, 'Foo' ) ]
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testCountUnreadNotifications() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $innerService->expects( $this->once() )
+                       ->method( 'countUnreadNotifications' )
+                       ->willReturn( __METHOD__ );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $return = $noWriteService->countUnreadNotifications(
+                       $this->getTestSysop()->getUser(),
+                       88
+               );
+               $this->assertEquals( __METHOD__, $return );
+       }
+
+       public function testDuplicateAllAssociatedEntries() {
+               /** @var WatchedItemStoreInterface|PHPUnit_Framework_MockObject_MockObject $innerService */
+               $innerService = $this->getMockForAbstractClass( WatchedItemStoreInterface::class );
+               $noWriteService = new NoWriteWatchedItemStore( $innerService );
+
+               $this->setExpectedException( DBReadOnlyError::class );
+               $noWriteService->duplicateAllAssociatedEntries(
+                       new TitleValue( 0, 'Foo' ),
+                       new TitleValue( 0, 'Bar' )
+               );
+       }
+
+}
index 010bb17..0e2e145 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-require_once __DIR__ . "/../../../maintenance/backupPrefetch.inc";
-
 /**
  * Tests for BaseDump
  *