2008-02-10 20:34:39 +00:00
|
|
|
#!/usr/bin/php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
chdir(dirname(__FILE__));
|
|
|
|
require_once 'common.php';
|
|
|
|
require_once '../library/HTMLPurifier.auto.php';
|
|
|
|
assertCli();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
2008-04-22 01:58:06 +00:00
|
|
|
* Generates a schema cache file, saving it to
|
2008-04-03 22:39:50 +00:00
|
|
|
* 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.
|
2008-02-10 20:34:39 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
$target = '../library/HTMLPurifier/ConfigSchema/schema.ser';
|
|
|
|
|
2008-04-22 01:58:06 +00:00
|
|
|
$interchange = HTMLPurifier_ConfigSchema_InterchangeBuilder::buildFromDirectory();
|
|
|
|
$interchange->validate();
|
2008-03-22 20:26:04 +00:00
|
|
|
|
2008-03-22 03:55:59 +00:00
|
|
|
$schema_builder = new HTMLPurifier_ConfigSchema_Builder_ConfigSchema();
|
|
|
|
$schema = $schema_builder->build($interchange);
|
2008-02-10 20:34:39 +00:00
|
|
|
|
2008-02-24 05:06:39 +00:00
|
|
|
echo "Saving schema... ";
|
2008-02-10 20:34:39 +00:00
|
|
|
file_put_contents($target, serialize($schema));
|
2008-02-24 05:06:39 +00:00
|
|
|
echo "done!\n";
|