Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4149094
PageLinksTable.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PageLinksTable.php
View Options
<?php
namespace
MediaWiki\Deferred\LinksUpdate
;
use
MediaWiki\Config\Config
;
use
MediaWiki\Config\ServiceOptions
;
use
MediaWiki\MainConfigNames
;
use
MediaWiki\Parser\ParserOutput
;
use
MediaWiki\Parser\ParserOutputLinkTypes
;
/**
* pagelinks
*/
class
PageLinksTable
extends
GenericPageLinksTable
{
private
const
CONSTRUCTOR_OPTIONS
=
[
MainConfigNames
::
PageLinksSchemaMigrationStage
,
];
/** @var int */
private
$migrationStage
;
public
function
__construct
(
Config
$config
)
{
$options
=
new
ServiceOptions
(
self
::
CONSTRUCTOR_OPTIONS
,
$config
);
$options
->
assertRequiredOptions
(
self
::
CONSTRUCTOR_OPTIONS
);
$this
->
migrationStage
=
$options
->
get
(
MainConfigNames
::
PageLinksSchemaMigrationStage
);
}
public
function
setParserOutput
(
ParserOutput
$parserOutput
)
{
// Convert the format of the local links
$this
->
newLinks
=
[];
foreach
(
$parserOutput
->
getLinkList
(
ParserOutputLinkTypes
::
LOCAL
)
as
[
'link'
=>
$link
,
'pageid'
=>
$pageid
]
)
{
$this
->
newLinks
[
$link
->
getNamespace
()][
$link
->
getDBkey
()]
=
$pageid
;
}
}
protected
function
getTableName
()
{
return
'pagelinks'
;
}
protected
function
getFromField
()
{
return
'pl_from'
;
}
protected
function
getNamespaceField
()
{
return
'pl_namespace'
;
}
protected
function
getTitleField
()
{
return
'pl_title'
;
}
protected
function
getFromNamespaceField
()
{
return
'pl_from_namespace'
;
}
protected
function
getTargetIdField
()
{
return
'pl_target_id'
;
}
/**
* Normalization stage of the links table (see T222224)
*/
protected
function
linksTargetNormalizationStage
():
int
{
return
$this
->
migrationStage
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 19:03 (6 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9d/b1/1b2e5a4d7e105bb54dbfbd953533
Default Alt Text
PageLinksTable.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment