Add support for unrecognized elements in MakeWellFormed.
[htmlpurifier.git] / maintenance / generate-ph5p-patch.php
blobf30ac3ad3418a2aead99ec0c54b3e5bf486f886b
1 <?php
3 /**
4 * @file
5 * This file compares our version of PH5P with Jero's original version, and
6 * generates a patch of the differences. This script should be run whenever
7 * library/HTMLPurifier/Lexer/PH5P.php is modified.
8 */
10 $orig = realpath(dirname(__FILE__) . '/PH5P.php');
11 $new = realpath(dirname(__FILE__) . '/../library/HTMLPurifier/Lexer/PH5P.php');
12 $newt = dirname(__FILE__) . '/PH5P.new.php'; // temporary file
14 // minor text-processing of new file to get into same format as original
15 $new_src = file_get_contents($new);
16 $new_src = '<?php' . PHP_EOL . substr($new_src, strpos($new_src, 'class HTML5 {'));
18 file_put_contents($newt, $new_src);
19 shell_exec("diff -u \"$orig\" \"$newt\" > PH5P.patch");
20 unlink($newt);