ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
print $file
Object that provides entity lookup table from entity name to character.
Definition: EntityLookup.php:7
static instance($prototype=false)
Retrieves sole instance of the object.
$table
Assoc array of entity name to character represented.
setup($file=false)
Sets up the entity lookup table from the serialized file contents.