ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
EntityLookup.php
Go to the documentation of this file.
1 <?php
2 
7 {
12  public $table;
13 
21  public function setup($file = false)
22  {
23  if (!$file) {
24  $file = HTMLPURIFIER_PREFIX . '/HTMLPurifier/EntityLookup/entities.ser';
25  }
26  $this->table = unserialize(file_get_contents($file));
27  }
28 
34  public static function instance($prototype = false)
35  {
36  // no references, since PHP doesn't copy unless modified
37  static $instance = null;
38  if ($prototype) {
39  $instance = $prototype;
40  } elseif (!$instance) {
41  $instance = new HTMLPurifier_EntityLookup();
42  $instance->setup();
43  }
44  return $instance;
45  }
46 }
47 
48 // vim: et sw=4 sts=4
setup($file=false)
Sets up the entity lookup table from the serialized file contents.
Object that provides entity lookup table from entity name to character.
Definition: EntityLookup.php:6
$table
Assoc array of entity name to character represented.
static instance($prototype=false)
Retrieves sole instance of the object.