ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
flush-definition-cache.php
Go to the documentation of this file.
1 #!/usr/bin/php
2 <?php
3 
4 chdir(dirname(__FILE__));
5 require_once 'common.php';
6 assertCli();
7 
19 echo "Flushing cache... \n";
20 
21 require_once(dirname(__FILE__) . '/../library/HTMLPurifier.auto.php');
22 
24 
25 $names = array('HTML', 'CSS', 'URI', 'Test');
26 if (isset($argv[1])) {
27  if (in_array($argv[1], $names)) {
28  $names = array($argv[1]);
29  } else {
30  throw new Exception("Cache parameter {$argv[1]} is not a valid cache");
31  }
32 }
33 
34 foreach ($names as $name) {
35  echo " - Flushing $name\n";
36  $cache = new HTMLPurifier_DefinitionCache_Serializer($name);
37  $cache->flush($config);
38 }
39 
40 echo "Cache flushed successfully.\n";
41 
42 // vim: et sw=4 sts=4
$argv
static createDefault()
Convenience constructor that creates a default configuration object.
Definition: Config.php:154
Create styles array
The data for the language used.
assertCli()
Definition: common.php:3