dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Rename autonym for 'no' from 'norsk bokmål' to 'norsk'"
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialExport.php
diff --git
a/includes/specials/SpecialExport.php
b/includes/specials/SpecialExport.php
index
3e66ab0
..
d5c5528
100644
(file)
--- a/
includes/specials/SpecialExport.php
+++ b/
includes/specials/SpecialExport.php
@@
-23,6
+23,8
@@
* @ingroup SpecialPage
*/
* @ingroup SpecialPage
*/
+use Mediawiki\MediaWikiServices;
+
/**
* A special page that allows users to export pages in a XML file
*
/**
* A special page that allows users to export pages in a XML file
*
@@
-201,6
+203,7
@@
class SpecialExport extends SpecialPage {
'buttontype' => 'submit',
'buttonname' => 'addcat',
'buttondefault' => $this->msg( 'export-addcat' )->text(),
'buttontype' => 'submit',
'buttonname' => 'addcat',
'buttondefault' => $this->msg( 'export-addcat' )->text(),
+ 'hide-if' => [ '===', 'exportall', '1' ],
],
];
if ( $config->get( 'ExportFromNamespaces' ) ) {
],
];
if ( $config->get( 'ExportFromNamespaces' ) ) {
@@
-216,6
+219,7
@@
class SpecialExport extends SpecialPage {
'buttontype' => 'submit',
'buttonname' => 'addns',
'buttondefault' => $this->msg( 'export-addns' )->text(),
'buttontype' => 'submit',
'buttonname' => 'addns',
'buttondefault' => $this->msg( 'export-addns' )->text(),
+ 'hide-if' => [ '===', 'exportall', '1' ],
],
];
}
],
];
}
@@
-240,6
+244,7
@@
class SpecialExport extends SpecialPage {
'nodata' => true,
'rows' => 10,
'default' => $page,
'nodata' => true,
'rows' => 10,
'default' => $page,
+ 'hide-if' => [ '===', 'exportall', '1' ],
],
];
],
];
@@
-325,7
+330,6
@@
class SpecialExport extends SpecialPage {
* @param bool $exportall Whether to export everything
*/
private function doExport( $page, $history, $list_authors, $exportall ) {
* @param bool $exportall Whether to export everything
*/
private function doExport( $page, $history, $list_authors, $exportall ) {
-
// If we are grabbing everything, enable full history and ignore the rest
if ( $exportall ) {
$history = WikiExporter::FULL;
// If we are grabbing everything, enable full history and ignore the rest
if ( $exportall ) {
$history = WikiExporter::FULL;
@@
-356,7
+360,7
@@
class SpecialExport extends SpecialPage {
$pages = array_keys( $pageSet );
$pages = array_keys( $pageSet );
- // Normalize titles to the same format and remove dupes, see
bug 17
374
+ // Normalize titles to the same format and remove dupes, see
T19
374
foreach ( $pages as $k => $v ) {
$pages[$k] = str_replace( " ", "_", $v );
}
foreach ( $pages as $k => $v ) {
$pages[$k] = str_replace( " ", "_", $v );
}
@@
-367,12
+371,12
@@
class SpecialExport extends SpecialPage {
/* Ok, let's get to it... */
if ( $history == WikiExporter::CURRENT ) {
$lb = false;
/* Ok, let's get to it... */
if ( $history == WikiExporter::CURRENT ) {
$lb = false;
- $db = wfGetDB( DB_
SLAVE
);
+ $db = wfGetDB( DB_
REPLICA
);
$buffer = WikiExporter::BUFFER;
} else {
// Use an unbuffered query; histories may be very long!
$buffer = WikiExporter::BUFFER;
} else {
// Use an unbuffered query; histories may be very long!
- $lb =
wfGetLB
Factory()->newMainLB();
- $db = $lb->getConnection( DB_
SLAVE
);
+ $lb =
MediaWikiServices::getInstance()->getDBLoadBalancer
Factory()->newMainLB();
+ $db = $lb->getConnection( DB_
REPLICA
);
$buffer = WikiExporter::STREAM;
// This might take a while... :D
$buffer = WikiExporter::STREAM;
// This might take a while... :D
@@
-389,7
+393,7
@@
class SpecialExport extends SpecialPage {
$exporter->allPages();
} else {
foreach ( $pages as $page ) {
$exporter->allPages();
} else {
foreach ( $pages as $page ) {
- #
Bug 8
824: Only export pages the user can read
+ #
T10
824: Only export pages the user can read
$title = Title::newFromText( $page );
if ( is_null( $title ) ) {
// @todo Perhaps output an <error> tag or something.
$title = Title::newFromText( $page );
if ( is_null( $title ) ) {
// @todo Perhaps output an <error> tag or something.
@@
-423,7
+427,7
@@
class SpecialExport extends SpecialPage {
$name = $title->getDBkey();
$name = $title->getDBkey();
- $dbr = wfGetDB( DB_
SLAVE
);
+ $dbr = wfGetDB( DB_
REPLICA
);
$res = $dbr->select(
[ 'page', 'categorylinks' ],
[ 'page_namespace', 'page_title' ],
$res = $dbr->select(
[ 'page', 'categorylinks' ],
[ 'page_namespace', 'page_title' ],
@@
-456,7
+460,7
@@
class SpecialExport extends SpecialPage {
$maxPages = $this->getConfig()->get( 'ExportPagelistLimit' );
$maxPages = $this->getConfig()->get( 'ExportPagelistLimit' );
- $dbr = wfGetDB( DB_
SLAVE
);
+ $dbr = wfGetDB( DB_
REPLICA
);
$res = $dbr->select(
'page',
[ 'page_namespace', 'page_title' ],
$res = $dbr->select(
'page',
[ 'page_namespace', 'page_title' ],
@@
-553,7
+557,7
@@
class SpecialExport extends SpecialPage {
* @return array
*/
private function getLinks( $inputPages, $pageSet, $table, $fields, $join ) {
* @return array
*/
private function getLinks( $inputPages, $pageSet, $table, $fields, $join ) {
- $dbr = wfGetDB( DB_
SLAVE
);
+ $dbr = wfGetDB( DB_
REPLICA
);
foreach ( $inputPages as $page ) {
$title = Title::newFromText( $page );
foreach ( $inputPages as $page ) {
$title = Title::newFromText( $page );