Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4152506
domdiff.test.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
846 B
Referenced Files
None
Subscribers
None
domdiff.test.php
View Options
<?php
// PORT-FIXME: Incomplete. Doesn't support CLI flags of the JS version
require_once
__DIR__
.
'/../vendor/autoload.php'
;
use
Wikimedia\Parsoid\Html2Wt\DOMDiff
;
use
Wikimedia\Parsoid\Mocks\MockEnv
;
use
Wikimedia\Parsoid\Utils\ContentUtils
;
use
Wikimedia\Parsoid\Utils\DOMCompat
;
$html1
=
file_get_contents
(
$argv
[
1
]
);
$html2
=
file_get_contents
(
$argv
[
2
]
);
$mockEnv
=
new
MockEnv
(
[]
);
$doc1
=
ContentUtils
::
createAndLoadDocument
(
$html1
,
[
"markNew"
=>
true
]
);
$doc2
=
ContentUtils
::
createAndLoadDocument
(
$html2
,
[
"markNew"
=>
true
]
);
$body1
=
DOMCompat
::
getBody
(
$doc1
);
$body2
=
DOMCompat
::
getBody
(
$doc2
);
$domDiff
=
new
DOMDiff
(
$mockEnv
);
$domDiff
->
diff
(
$body1
,
$body2
);
$opts
=
[
'keepTmp'
=>
true
,
'storeDiffMark'
=>
true
,
'quiet'
=>
true
];
print
ContentUtils
::
dumpDOM
(
$body2
,
'DIFF-marked DOM'
,
$opts
);
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 20:22 (7 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
93/74/af95e4d8acf7f16efddffe03027d
Default Alt Text
domdiff.test.php (846 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment