mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 16:31:53 +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:
parent
2b82fbacad
commit
08e32597df
3
NEWS
3
NEWS
@ -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
14
maintenance/flush-definition-cache.php
Normal file → Executable 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
0
maintenance/generate-entity-file.php
Normal file → Executable file
0
maintenance/merge-library.php
Normal file → Executable file
0
maintenance/merge-library.php
Normal file → Executable file
0
tests/index.php
Normal file → Executable file
0
tests/index.php
Normal file → Executable file
Loading…
Reference in New Issue
Block a user