3 require_once 'common.php';
5 if (isset($_GET['doc'])) {
8 file_exists('testSchema.html') &&
9 filemtime('testSchema.php') < filemtime('testSchema.html') &&
10 !isset($_GET['purge'])
12 echo file_get_contents('testSchema.html');
16 if (version_compare('5', PHP_VERSION
, '>')) exit('Requires PHP 5 or higher.');
18 // setup schema for parsing
19 require_once 'testSchema.php';
20 $new_schema = $custom_schema; // dereference the reference
21 HTMLPurifier_ConfigSchema
::instance($old); // restore old version
23 // setup ConfigDoc environment
24 require_once '../configdoc/library/ConfigDoc.auto.php';
26 // perform the ConfigDoc generation
27 $configdoc = new ConfigDoc();
28 $html = $configdoc->generate($new_schema, 'plain', array(
29 'css' => '../configdoc/styles/plain.css',
30 'title' => 'Sample Configuration Documentation'
32 $configdoc->cleanup();
34 file_put_contents('testSchema.html', $html);
41 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
42 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
45 <title
>HTML Purifier Config Form Smoketest
</title
>
46 <meta http
-equiv
="Content-Type" content
="text/html; charset=UTF-8" />
47 <link rel
="stylesheet" href
="../library/HTMLPurifier/Printer/ConfigForm.css" type
="text/css" />
48 <script defer
="defer" type
="text/javascript" src
="../library/HTMLPurifier/Printer/ConfigForm.js"></script
>
51 <h1
>HTML Purifier Config Form Smoketest
</h1
>
52 <p
>This file outputs the configuration form
for every single type
53 of directive possible
.</p
>
54 <form id
="htmlpurifier-config" name
="htmlpurifier-config" method
="get" action
=""
58 require_once 'HTMLPurifier/Printer/ConfigForm.php';
60 // fictional set, attempts to cover every possible data-type
61 // see source at ConfigTest.php
62 require_once 'testSchema.php';
64 // cleanup ( this should be rolled into Config )
65 $config = HTMLPurifier_Config
::loadArrayFromForm($_GET, 'config');
66 $printer = new HTMLPurifier_Printer_ConfigForm('config', '?doc#%s');
67 echo $printer->render($config);
73 echo htmlspecialchars(print_r($config->getAll(), true));