mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-08 23:08:42 +00:00
949f605857
- Abolish most classes in ConfigDoc except for HTMLXSLTProcessor - Implement Builder_Xml using XmlWriter - Add some convenience functions git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1665 48356398-32a2-884e-a903-53898d9a118a
30 lines
814 B
PHP
30 lines
814 B
PHP
#!/usr/bin/php
|
|
<?php
|
|
|
|
chdir(dirname(__FILE__));
|
|
require_once 'common.php';
|
|
require_once '../library/HTMLPurifier.auto.php';
|
|
assertCli();
|
|
|
|
/**
|
|
* @file
|
|
* Generates a schema cache file, saving it to
|
|
* 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.
|
|
*/
|
|
|
|
$target = '../library/HTMLPurifier/ConfigSchema/schema.ser';
|
|
|
|
$interchange = HTMLPurifier_ConfigSchema_InterchangeBuilder::buildFromDirectory();
|
|
$interchange->validate();
|
|
|
|
$schema_builder = new HTMLPurifier_ConfigSchema_Builder_ConfigSchema();
|
|
$schema = $schema_builder->build($interchange);
|
|
|
|
echo "Saving schema... ";
|
|
file_put_contents($target, serialize($schema));
|
|
echo "done!\n";
|