Per http://php.net/manual/en/function.print.php, print always returns
1 (integer value of one) but write() doesn't actually return this value
to it's caller. So "@return bool" in this case doesn't make sense as
one will think it's returning a bool type. `write()` only takes a string
and prints it, and if we really want to return it's value (in this case),
it will be "@return int" not data of type bool.
Change-Id: I45b4a157cde2f768d77dda76d6ae0caa47e28f20
T203424 replaced streaming mode with batched queries.
However, it did not properly handle some values of
the $wgExportMaxHistory config variable, and emitted
broken XML. This change fixes that issue.
Bug: T207974
Change-Id: Iade3fc603e513da51b7a970c16275516c02ede49
WikiExporter allows streaming mode, using unbuffered mode on
the database connection. We are moving away from this technique.
Instead, do multiple normal queries and retrieve the
information in batches.
Bug: T203424
Change-Id: I582240b67c91a8be993a68c23831c9d86617350e
This is a temporary fix that forces the dump code to continue to
use the old database schema, even when MCR is in
SCHEMA_COMPAT_READ_NEW mode. This will continue to function until
SCHEMA_COMPAT_WRITE_OLD mode is disabled.
Bug: T198561
Change-Id: Ic54ee703f47d1843f70fdb7185ac1b098f148680
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.
A subsequent patch will remove the old columns.
Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
This allows CommentStore to be added to MediaWikiServices
without the need of an aditional Factory.
This change includes a compatability layer to allow the behaviour
from 1.30 to continue to be used while deprecated.
CommentStore::newKey has been deprecated.
Keys are now passed into the public methods of CommentStore
where needed.
The following CommentStore methods have had their signatures changed
to introduced a $key parameter, but when used in conjunction with
CommentStore::newKey behaviour will remain unchanged:
* CommentStore::getFields
* CommentStore::getJoin
* CommentStore::getComment
* CommentStore::getCommentLegacy
* CommentStore::insert
* CommentStore::insertWithTemplate
Change-Id: I3abb62a5cfb0dcd456da9f4eb35583476ae41cfb
There's no reason for this to have to live in Maintenance land. It's
generally useful and lets us avoid some random require/include calls
Change-Id: I60419c7f9fc52313905053bbeb3aa81666c9160c
And auto-fix all errors.
The `<exclude-pattern>` stanzas are now included in the default ruleset
and don't need to be repeated.
Change-Id: I928af549dc88ac2c6cb82058f64c7c7f3111598a
I was bored. What? Don't look at me that way.
I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.
Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0
Use of &$this doesn't work in PHP 7.1. For callbacks to methods like
array_map() it's completely unnecessary, while for hooks we still need
to pass a reference and so we need to copy $this into a local variable.
Bug: T153505
Change-Id: I8bbb26e248cd6f213fd0e7460d6d6935a3f9e468
If an XML dump of a wiki is exported using dumpBackup.php, and there are
pages in a namespace that is not registered (perhaps because of a missing
extension), they will appear in the dump in the form
<page> ... <title>PageTitle</title> <ns>1234</ns> ... </page>
This caused the ForeignTitle code to raise an undefined offset error,
because it assumed that the <title> element was of the form
"Namespace:PageTitle" when <ns> was nonzero. This assumption is not valid.
Now, the importation of such dumps will no longer throw errors and the
pages will be correctly imported, although possibly to unexpected
locations.
Bug: T114115
Change-Id: I0271435dc208e7ea118339584f8a0e359c96113a
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.
Also update some defect links.
Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
Though getOutput() is what first came to mind, I do not particularly
like the name, partly because it is used in many, many places as a
method that returns an OutputPage object.
* Renamed the method to __toString(). This is appropriate because
each instance, at any given time, corresponds to a single string
value (and exceptions cannot occur during this conversion).
* Removed unnecessary variables from ApiQuery and ExportTest. In
these and most other cases, it should no longer be necessary to
call getOutput() explicitly.
Change-Id: Icf202743d1f332f8981338f42eb6e3e5a04abdf1
Specifically, it is not necessary to use output buffering functions
to capture XML generated by the export code because it is already
possible to set the "output sink" object to be used.
* Created a DumpStringOutput class, which appends all output to a
string property rather than printing output immediately.
* Used that class, instead of ob_start() and ob_get_clean(), in
ApiQuery and ExportTest.
Change-Id: I238f5d5ec7fd442c845b25cb59ef81ac3285099f
tested for stubs, text, logging with and without start/end values,
with and without orderrevs, seems to work as expected, with the
appropriate changes to the query.
Bug: T29112
Change-Id: I94ca4a06235bdbed384bb997deb7432bb5aaa5b9
Adds a --7ziplevel param to dumpBackup.php and dumpTextPass.php,
used when an --output of type '7zip' is specified.
Bug: T78669
Change-Id: I9ee8169daf30b4d8251c7a344b593c29c81eb799
Use the Maintenance class's new $orderedOptions and support for
passing options multiple times. This allows for option "chaining".
The BackupDumper and TextPassDumper class now extend Maintenance, but
should continue to function as before. The public function processArgs()
has been removed and replaced by processOptions(), which takes no
parameters. It is unlikely that users of these classes were calling
processArgs.
Inheritors of these classes that overrode processOption() will now need to
override processOptions() and use Maintenance::getOption() and friends.
The maintenance/backupTextPass.inc file has been deleted. Users should
include maintenance/dumpTextPass.php instead.
Bug: T122587
Change-Id: I2473ee119c185d1b2b00ac4b1e70ee8a6cafe4a3
Moved classes in Export.php to seperate files in the new directory
includes/export/ and updated autoload.php to these new locations.
Bug: T122531
Change-Id: Idd3bba5a85d65c952f2ff503bea2ca76624c9b7f