4 * Generates XML and HTML documents describing configuration.
10 - make XML format richer
11 - extend XSLT transformation (see the corresponding XSLT file)
12 - allow generation of packaged docs that can be easily moved
13 - multipage documentation
14 - determine how to multilingualize
18 if (version_compare(PHP_VERSION
, '5.2', '<')) exit('PHP 5.2+ required.');
19 error_reporting(E_ALL | E_STRICT
);
21 chdir(dirname(__FILE__
));
23 // load dual-libraries
24 require_once '../extras/HTMLPurifierExtras.auto.php';
25 require_once '../library/HTMLPurifier.auto.php';
27 // setup HTML Purifier singleton
28 HTMLPurifier
::getInstance(array(
29 'AutoFormat.PurifierLinkify' => true
32 $interchange = HTMLPurifier_ConfigSchema_InterchangeBuilder
::buildFromDirectory();
33 $interchange->validate();
35 $style = 'plain'; // use $_GET in the future, careful to validate!
36 $configdoc_xml = 'configdoc.xml';
38 $xml_builder = new HTMLPurifier_ConfigSchema_Builder_Xml();
39 $xml_builder->openURI($configdoc_xml);
40 $xml_builder->build($interchange);
41 unset($xml_builder); // free handle
43 $xslt = new ConfigDoc_HTMLXSLTProcessor();
44 $xslt->importStylesheet(dirname(__FILE__
) . "/styles/$style.xsl");
45 $output = $xslt->transformToHTML($configdoc_xml);
48 echo "Error in generating files\n";
53 file_put_contents("$style.html", $output);
55 if (php_sapi_name() != 'cli') {
56 // output (instant feedback if it's a browser)
59 echo 'Files generated successfully.';