|
20 | 20 | */
|
21 | 21 |
|
22 | 22 | error_reporting(-1);
|
| 23 | +ob_implicit_flush(); |
23 | 24 | $cvs_id = '$Id$';
|
24 | 25 |
|
25 | 26 | echo "configure.php: $cvs_id\n";
|
@@ -757,22 +758,37 @@ function getFileModificationHistory(): array {
|
757 | 758 | checking('whether to save an invalid .manual.xml');
|
758 | 759 | checkvalue($ac['FORCE_DOM_SAVE']);
|
759 | 760 |
|
760 |
| -echo "Loading and parsing {$ac["INPUT_FILENAME"]}... "; |
761 |
| -flush(); |
762 |
| - |
763 | 761 | $dom = new DOMDocument();
|
764 | 762 |
|
765 |
| -// realpath() is important: omitting it causes severe performance degradation |
766 |
| -// and doubled memory usage on Windows. |
767 |
| -$didLoad = $dom->load(realpath("{$ac['srcdir']}/{$ac["INPUT_FILENAME"]}"), $LIBXML_OPTS); |
| 763 | +function dom_load( DOMDocument $dom , string $filename ) : bool |
| 764 | +{ |
| 765 | + global $LIBXML_OPTS; |
| 766 | + $filename = realpath( $filename ); |
| 767 | + return $dom->load( $filename , $LIBXML_OPTS ); |
| 768 | +} |
| 769 | + |
| 770 | +function dom_save( DOMDocument $dom , string $filename ) |
| 771 | +{ |
| 772 | + $dom->save( $filename ); |
| 773 | +} |
| 774 | + |
| 775 | +function dom_saveload( DOMDocument $dom , string $filename ) |
| 776 | +{ |
| 777 | + dom_save( $dom , $filename ); |
| 778 | + dom_load( $dom , $filename ); |
| 779 | +} |
768 | 780 |
|
769 |
| -// Check if the XML was simply broken, if so then just bail out |
770 |
| -if ($didLoad === false) { |
| 781 | +echo "Loading and parsing {$ac["INPUT_FILENAME"]}... "; |
| 782 | + |
| 783 | +if ( ! dom_load( $dom , "{$ac['srcdir']}/{$ac["INPUT_FILENAME"]}" ) ) |
| 784 | +{ |
771 | 785 | echo "failed.\n";
|
772 | 786 | print_xml_errors();
|
773 | 787 | errors_are_bad(1);
|
774 | 788 | }
|
775 |
| -echo "done.\n"; |
| 789 | +else |
| 790 | + echo "done.\n"; |
| 791 | + |
776 | 792 |
|
777 | 793 | echo "Running XInclude/XPointer... ";
|
778 | 794 |
|
@@ -845,8 +861,13 @@ function xinclude_run_xpointer( DOMDocument $dom ) : int
|
845 | 861 | {
|
846 | 862 | echo "$run ";
|
847 | 863 | $status = (int) $dom->xinclude();
|
| 864 | + |
| 865 | +xinclude_report(); die(x); |
| 866 | + |
848 | 867 | if ( $status <= 0 )
|
| 868 | + { |
849 | 869 | return $total;
|
| 870 | + } |
850 | 871 | $total += $status;
|
851 | 872 | libxml_clear_errors();
|
852 | 873 | }
|
|
0 commit comments