1: <?php
2:
3: /**
4: * Super-class for definition datatype objects, implements serialization
5: * functions for the class.
6: */
7: abstract class HTMLPurifier_Definition
8: {
9:
10: /**
11: * Has setup() been called yet?
12: */
13: public $setup = false;
14:
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.
23: */
24: public $optimized = null;
25:
26: /**
27: * What type of definition is it?
28: */
29: public $type;
30:
31: /**
32: * Sets up the definition object into the final form, something
33: * not done by the constructor
34: * @param $config HTMLPurifier_Config instance
35: */
36: abstract protected function doSetup($config);
37:
38: /**
39: * Setup function that aborts if already setup
40: * @param $config HTMLPurifier_Config instance
41: */
42: public function setup($config) {
43: if ($this->setup) return;
44: $this->setup = true;
45: $this->doSetup($config);
46: }
47:
48: }
49:
50: // vim: et sw=4 sts=4
51: