4 require_once 'common.php';
8 * Flushes the default HTMLDefinition serial cache
9 * @param Accepts one argument, cache type to flush; otherwise flushes all
13 echo "Flushing cache... \n";
15 require_once(dirname(__FILE__
) . '/../library/HTMLPurifier.auto.php');
17 $config = HTMLPurifier_Config
::createDefault();
19 $names = array('HTML', 'CSS', 'URI', 'Test');
20 if (isset($argv[1])) {
21 if (in_array($argv[1], $names)) {
22 $names = array($argv[1]);
24 echo "Did not recognized cache parameter {$argv[1]} as valid cache, aborting.\n";
29 foreach ($names as $name) {
30 echo " - Flushing $name\n";
31 $cache = new HTMLPurifier_DefinitionCache_Serializer($name);
32 $cache->flush($config);
35 echo 'Cache flushed successfully.';