Release 2.1.3, merged in 1404 to HEAD.
[htmlpurifier/bfroehle.git] / maintenance / generate-ph5p-patch.php
blobecd9fa3f133c6bc8f61072b80cacb5c66bf10998
1 <?php
3 $orig = realpath(dirname(__FILE__) . '/PH5P.php');
4 $new = realpath(dirname(__FILE__) . '/../library/HTMLPurifier/Lexer/PH5P.php');
5 $newt = dirname(__FILE__) . '/PH5P.new.php'; // temporary file
7 // minor text-processing of new file to get into same format as original
8 $new_src = file_get_contents($new);
9 $new_src = '<?php' . PHP_EOL . substr($new_src, strpos($new_src, 'class HTML5 {'));
11 file_put_contents($newt, $new_src);
12 shell_exec("diff -u \"$orig\" \"$newt\" > PH5P.patch");
13 unlink($newt);