Fix E_NOTICE from indexing into empty string.
[htmlpurifier.git] / library / HTMLPurifier / Definition.php
blobc7f82eba4303b72ccd4ab7a87ee60503d0b614c1
1 <?php
3 /**
4 * Super-class for definition datatype objects, implements serialization
5 * functions for the class.
6 */
7 abstract class HTMLPurifier_Definition
10 /**
11 * Has setup() been called yet?
13 public $setup = false;
15 /**
16 * If true, write out the final definition object to the cache after
17 * setup. This will be true only if all invocations to get a raw
18 * definition object are also optimized. This does not cause file
19 * system thrashing because on subsequent calls the cached object
20 * is used and any writes to the raw definition object are short
21 * circuited. See enduser-customize.html for the high-level
22 * picture.
24 public $optimized = null;
26 /**
27 * What type of definition is it?
29 public $type;
31 /**
32 * Sets up the definition object into the final form, something
33 * not done by the constructor
34 * @param $config HTMLPurifier_Config instance
36 abstract protected function doSetup($config);
38 /**
39 * Setup function that aborts if already setup
40 * @param $config HTMLPurifier_Config instance
42 public function setup($config) {
43 if ($this->setup) return;
44 $this->setup = true;
45 $this->doSetup($config);
50 // vim: et sw=4 sts=4