Implementation of a Zipper, for efficient splice.
[htmlpurifier/darkodev.git] / library / HTMLPurifier / Definition.php
blobbc6d43364776493975caa4c3f7958321391c8650
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?
12 * @type bool
14 public $setup = false;
16 /**
17 * If true, write out the final definition object to the cache after
18 * setup. This will be true only if all invocations to get a raw
19 * definition object are also optimized. This does not cause file
20 * system thrashing because on subsequent calls the cached object
21 * is used and any writes to the raw definition object are short
22 * circuited. See enduser-customize.html for the high-level
23 * picture.
24 * @type bool
26 public $optimized = null;
28 /**
29 * What type of definition is it?
30 * @type string
32 public $type;
34 /**
35 * Sets up the definition object into the final form, something
36 * not done by the constructor
37 * @param HTMLPurifier_Config $config
39 abstract protected function doSetup($config);
41 /**
42 * Setup function that aborts if already setup
43 * @param HTMLPurifier_Config $config
45 public function setup($config)
47 if ($this->setup) {
48 return;
50 $this->setup = true;
51 $this->doSetup($config);
55 // vim: et sw=4 sts=4