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 "Revert "Add type hint against LinkTarget""
[lhc/web/wiklou.git]
/
includes
/
cache
/
LinkBatch.php
diff --git
a/includes/cache/LinkBatch.php
b/includes/cache/LinkBatch.php
index
8f334cc
..
5dc8110
100644
(file)
--- a/
includes/cache/LinkBatch.php
+++ b/
includes/cache/LinkBatch.php
@@
-31,14
+31,14
@@
class LinkBatch {
/**
* 2-d array, first index namespace, second index dbkey, value arbitrary
*/
/**
* 2-d array, first index namespace, second index dbkey, value arbitrary
*/
- public $data =
array()
;
+ public $data =
[]
;
/**
* For debugging which method is using this class.
*/
protected $caller;
/**
* For debugging which method is using this class.
*/
protected $caller;
- function __construct( $arr =
array()
) {
+ function __construct( $arr =
[]
) {
foreach ( $arr as $item ) {
$this->addObj( $item );
}
foreach ( $arr as $item ) {
$this->addObj( $item );
}
@@
-75,7
+75,7
@@
class LinkBatch {
return;
}
if ( !array_key_exists( $ns, $this->data ) ) {
return;
}
if ( !array_key_exists( $ns, $this->data ) ) {
- $this->data[$ns] =
array()
;
+ $this->data[$ns] =
[]
;
}
$this->data[$ns][strtr( $dbkey, ' ', '_' )] = 1;
}
$this->data[$ns][strtr( $dbkey, ' ', '_' )] = 1;
@@
-147,12
+147,12
@@
class LinkBatch {
*/
public function addResultToCache( $cache, $res ) {
if ( !$res ) {
*/
public function addResultToCache( $cache, $res ) {
if ( !$res ) {
- return
array()
;
+ return
[]
;
}
// For each returned entry, add it to the list of good links, and remove it from $remaining
}
// For each returned entry, add it to the list of good links, and remove it from $remaining
- $ids =
array()
;
+ $ids =
[]
;
$remaining = $this->data;
foreach ( $res as $row ) {
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
$remaining = $this->data;
foreach ( $res as $row ) {
$title = Title::makeTitle( $row->page_namespace, $row->page_title );
@@
-178,7
+178,7
@@
class LinkBatch {
* @return bool|ResultWrapper
*/
public function doQuery() {
* @return bool|ResultWrapper
*/
public function doQuery() {
- global $wgContentHandlerUseDB;
+ global $wgContentHandlerUseDB
, $wgPageLanguageUseDB
;
if ( $this->isEmpty() ) {
return false;
if ( $this->isEmpty() ) {
return false;
@@
-187,12
+187,15
@@
class LinkBatch {
// This is similar to LinkHolderArray::replaceInternal
$dbr = wfGetDB( DB_SLAVE );
$table = 'page';
// This is similar to LinkHolderArray::replaceInternal
$dbr = wfGetDB( DB_SLAVE );
$table = 'page';
- $fields =
array(
'page_id', 'page_namespace', 'page_title', 'page_len',
- 'page_is_redirect', 'page_latest'
)
;
+ $fields =
[
'page_id', 'page_namespace', 'page_title', 'page_len',
+ 'page_is_redirect', 'page_latest'
]
;
if ( $wgContentHandlerUseDB ) {
$fields[] = 'page_content_model';
}
if ( $wgContentHandlerUseDB ) {
$fields[] = 'page_content_model';
}
+ if ( $wgPageLanguageUseDB ) {
+ $fields[] = 'page_lang';
+ }
$conds = $this->constructSet( 'page', $dbr );
$conds = $this->constructSet( 'page', $dbr );