Convert all to new configuration get/set format.
[htmlpurifier/darkodev.git] / maintenance / generate-schema-cache.php
blobe7a59c41899fbc6feeb2180244eb579038c41f0b
1 #!/usr/bin/php
2 <?php
4 chdir(dirname(__FILE__));
5 require_once 'common.php';
6 require_once '../library/HTMLPurifier.auto.php';
7 assertCli();
9 /**
10 * @file
11 * Generates a schema cache file, saving it to
12 * library/HTMLPurifier/ConfigSchema/schema.ser.
14 * This should be run when new configuration options are added to
15 * HTML Purifier. A cached version is available via SVN so this does not
16 * normally have to be regenerated.
19 $target = '../library/HTMLPurifier/ConfigSchema/schema.ser';
21 $interchange = HTMLPurifier_ConfigSchema_InterchangeBuilder::buildFromDirectory();
22 $interchange->validate();
24 $schema_builder = new HTMLPurifier_ConfigSchema_Builder_ConfigSchema();
25 $schema = $schema_builder->build($interchange);
27 echo "Saving schema... ";
28 file_put_contents($target, serialize($schema));
29 echo "done!\n";
31 // vim: et sw=4 sts=4