0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 08:21:52 +00:00

Fix flush-definition-cache to clear everything, and make it accept a parameter specifying which cache to flush. Also, set svn:executable to CLI scripts.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1340 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2007-08-02 12:24:50 +00:00
parent 2b82fbacad
commit 08e32597df
5 changed files with 14 additions and 3 deletions

3
NEWS
View File

@ -11,7 +11,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
2.1.0, unknown release date
# flush-htmldefinition-cache.php superseded in favor of a generic
flush-definition-cache.php script
flush-definition-cache.php script, you can clear a specific cache
by passing its name as a parameter to the script
! Phorum mod implemented for HTML Purifier
! With %Core.AggressivelyFixLt, <3 and similar emoticons no longer
trigger HTML removal in PHP5 (DOMLex). This directive is not necessary

14
maintenance/flush-definition-cache.php Normal file → Executable file
View File

@ -3,6 +3,8 @@
/**
* Flushes the default HTMLDefinition serial cache
* @param Accepts one argument, cache type to flush; otherwise flushes all
* the caches.
*/
if (php_sapi_name() != 'cli') {
@ -16,8 +18,16 @@ require_once(dirname(__FILE__) . '/../library/HTMLPurifier.auto.php');
$config = HTMLPurifier_Config::createDefault();
//$names = array('HTML', 'CSS', 'URI', 'Test');
$names = array('URI');
$names = array('HTML', 'CSS', 'URI', 'Test');
if (isset($argv[1])) {
if (in_array($argv[1], $names)) {
$names = array($argv[1]);
} else {
echo "Did not recognized cache parameter {$argv[1]} as valid cache, aborting.\n";
exit;
}
}
foreach ($names as $name) {
echo " - Flushing $name\n";
$cache = new HTMLPurifier_DefinitionCache_Serializer($name);

0
maintenance/generate-entity-file.php Normal file → Executable file
View File

0
maintenance/merge-library.php Normal file → Executable file
View File

0
tests/index.php Normal file → Executable file
View File