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