2007-05-27 14:27:54 +00:00
|
|
|
#!/usr/bin/php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2007-06-20 21:39:28 +00:00
|
|
|
* Flushes the default HTMLDefinition serial cache
|
2007-05-27 14:27:54 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
if (php_sapi_name() != 'cli') {
|
|
|
|
echo 'Script cannot be called from web-browser.';
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2007-08-01 14:55:09 +00:00
|
|
|
echo "Flushing cache... \n";
|
2007-05-27 14:27:54 +00:00
|
|
|
|
|
|
|
require_once(dirname(__FILE__) . '/../library/HTMLPurifier.auto.php');
|
|
|
|
|
2007-06-20 21:39:28 +00:00
|
|
|
$config = HTMLPurifier_Config::createDefault();
|
|
|
|
|
2007-08-01 14:55:09 +00:00
|
|
|
$names = array('HTML', 'CSS', 'Test');
|
|
|
|
foreach ($names as $name) {
|
|
|
|
echo " - Flushing $name\n";
|
|
|
|
$cache = new HTMLPurifier_DefinitionCache_Serializer($name);
|
|
|
|
$cache->flush($config);
|
|
|
|
}
|
2007-05-27 14:27:54 +00:00
|
|
|
|
|
|
|
echo 'Cache flushed successfully.';
|
|
|
|
|