1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

Add docs and facilities for having separate directories of schemas.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
Edward Z. Yang
2009-05-29 22:10:47 -04:00
parent a025203b18
commit 5bf7ac4e9f
10 changed files with 91 additions and 30 deletions

View File

@@ -1,9 +1,8 @@
#!/usr/bin/php
<?php
chdir(dirname(__FILE__));
require_once 'common.php';
require_once '../library/HTMLPurifier.auto.php';
require_once dirname(__FILE__) . '/common.php';
require_once dirname(__FILE__) . '/../library/HTMLPurifier.auto.php';
assertCli();
/**
@@ -12,13 +11,28 @@ assertCli();
* library/HTMLPurifier/ConfigSchema/schema.ser.
*
* This should be run when new configuration options are added to
* HTML Purifier. A cached version is available via SVN so this does not
* normally have to be regenerated.
* HTML Purifier. A cached version is available via the repository
* so this does not normally have to be regenerated.
*
* If you have a directory containing custom configuration schema files,
* you can simple add a path to that directory as a parameter to
* this, and they will get included.
*/
$target = '../library/HTMLPurifier/ConfigSchema/schema.ser';
$target = dirname(__FILE__) . '/../library/HTMLPurifier/ConfigSchema/schema.ser';
$builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder();
$interchange = new HTMLPurifier_ConfigSchema_Interchange();
$builder->buildDir($interchange);
$loader = dirname(__FILE__) . '/../config-schema.php';
if (file_exists($loader)) include $loader;
foreach ($_SERVER['argv'] as $i => $dir) {
if ($i === 0) continue;
$builder->buildDir($interchange, realpath($dir));
}
$interchange = HTMLPurifier_ConfigSchema_InterchangeBuilder::buildFromDirectory();
$interchange->validate();
$schema_builder = new HTMLPurifier_ConfigSchema_Builder_ConfigSchema();