Ejemplo n.º 1
0
        echo file_get_contents('testSchema.html');
        exit;
    }
    if (version_compare('5', PHP_VERSION, '>')) {
        exit('Requires PHP 5 or higher.');
    }
    // setup schema for parsing
    require_once 'testSchema.php';
    $new_schema = $custom_schema;
    // dereference the reference
    HTMLPurifier_ConfigSchema::instance($old);
    // restore old version
    // setup ConfigDoc environment
    require_once '../configdoc/library/ConfigDoc.auto.php';
    // perform the ConfigDoc generation
    $configdoc = new ConfigDoc();
    $html = $configdoc->generate($new_schema, 'plain', array('css' => '../configdoc/styles/plain.css', 'title' => 'Sample Configuration Documentation'));
    $configdoc->cleanup();
    file_put_contents('testSchema.html', $html);
    echo $html;
    exit;
}
?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>HTML Purifier Config Form Smoketest</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../library/HTMLPurifier/Printer/ConfigForm.css" type="text/css" />
Ejemplo n.º 2
0
- make XML format richer (see XMLSerializer_ConfigSchema)
- extend XSLT transformation (see the corresponding XSLT file)
- allow generation of packaged docs that can be easily moved
- multipage documentation
- determine how to multilingualize
- add blurbs to ToC
*/
if (version_compare('5', PHP_VERSION, '>')) {
    exit('Requires PHP 5 or higher.');
}
error_reporting(E_ALL);
// probably not possible to use E_STRICT
define('HTMLPURIFIER_SCHEMA_STRICT', true);
// description data needs to be collected
// load dual-libraries
require_once '../library/HTMLPurifier.auto.php';
require_once 'library/ConfigDoc.auto.php';
$purifier = HTMLPurifier::getInstance(array('AutoFormat.PurifierLinkify' => true));
$schema = HTMLPurifier_ConfigSchema::instance();
$style = 'plain';
// use $_GET in the future
$configdoc = new ConfigDoc();
$output = $configdoc->generate($schema, $style);
// write out
file_put_contents("{$style}.html", $output);
if (php_sapi_name() != 'cli') {
    // output = instant feedback
    echo $output;
} else {
    echo 'Files generated successfully.';
}