Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6098442
DOMPPTraverser.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
DOMPPTraverser.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Wikimedia\Parsoid\Wt2Html
;
use
Wikimedia\Parsoid\Config\Env
;
use
Wikimedia\Parsoid\DOM\Node
;
use
Wikimedia\Parsoid\Ext\ParsoidExtensionAPI
;
use
Wikimedia\Parsoid\Utils\DOMTraverser
;
use
Wikimedia\Parsoid\Utils\DTState
;
/**
* This is a class that wraps the DOMTraverser utility for use
* in the DOM Processor pipeline.
*/
class
DOMPPTraverser
implements
Wt2HtmlDOMProcessor
{
private
DOMTraverser
$dt
;
public
function
__construct
(
?
DOMPostProcessor
$domPP
,
bool
$traverseWithTplInfo
=
false
,
bool
$applyToAttributeEmbeddedHTML
=
false
)
{
$this
->
dt
=
new
DOMTraverser
(
$traverseWithTplInfo
,
$applyToAttributeEmbeddedHTML
);
}
/**
* @param ?string $nodeName An optional node name filter
* @param callable $action A callback, called on each node we traverse that matches nodeName.
* Proxies call to underlying DOMTraverser. See docs for DOMTraverser::addHandler
*/
public
function
addHandler
(
?
string
$nodeName
,
callable
$action
):
void
{
$this
->
dt
->
addHandler
(
$nodeName
,
$action
);
}
/**
* @inheritDoc
*/
public
function
run
(
Env
$env
,
Node
$root
,
array
$options
=
[],
bool
$atTopLevel
=
false
):
void
{
$state
=
new
DTState
(
$env
,
$options
,
$atTopLevel
);
$this
->
dt
->
traverse
(
new
ParsoidExtensionAPI
(
$env
),
$root
,
$state
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 6 2026, 06:03 (6 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
33/39/0122031135f97e3b0dd14098d649
Default Alt Text
DOMPPTraverser.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment