ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
HTMLPurifier_EntityLookup Class Reference

Object that provides entity lookup table from entity name to character. More...

+ Collaboration diagram for HTMLPurifier_EntityLookup:

Public Member Functions

 setup ($file=false)
 Sets up the entity lookup table from the serialized file contents. More...
 

Static Public Member Functions

static instance ($prototype=false)
 Retrieves sole instance of the object. More...
 

Data Fields

 $table
 Assoc array of entity name to character represented. More...
 

Detailed Description

Object that provides entity lookup table from entity name to character.

Definition at line 6 of file EntityLookup.php.

Member Function Documentation

◆ instance()

static HTMLPurifier_EntityLookup::instance (   $prototype = false)
static

Retrieves sole instance of the object.

Parameters
bool | HTMLPurifier_EntityLookup$prototypeOptional prototype of custom lookup table to overload with.
Returns
HTMLPurifier_EntityLookup

Definition at line 34 of file EntityLookup.php.

Referenced by HTMLPurifier_EntityParser\nonSpecialEntityCallback().

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  }
Object that provides entity lookup table from entity name to character.
Definition: EntityLookup.php:6
+ Here is the caller graph for this function:

◆ setup()

HTMLPurifier_EntityLookup::setup (   $file = false)

Sets up the entity lookup table from the serialized file contents.

Parameters
bool$file
Note
The serialized contents are versioned, but were generated using the maintenance script generate_entity_file.php
Warning
This is not in constructor to help enforce the Singleton

Definition at line 21 of file EntityLookup.php.

References $file.

22  {
23  if (!$file) {
24  $file = HTMLPURIFIER_PREFIX . '/HTMLPurifier/EntityLookup/entities.ser';
25  }
26  $this->table = unserialize(file_get_contents($file));
27  }
print $file

Field Documentation

◆ $table

HTMLPurifier_EntityLookup::$table

Assoc array of entity name to character represented.

array

Definition at line 12 of file EntityLookup.php.


The documentation for this class was generated from the following file: