2007-05-24 22:08:29 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Super-class for definition datatype objects, implements serialization
|
|
|
|
* functions for the class.
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
abstract class HTMLPurifier_Definition
|
2007-05-24 22:08:29 +00:00
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-05-24 22:08:29 +00:00
|
|
|
/**
|
|
|
|
* Has setup() been called yet?
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
public $setup = false;
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-05-25 01:32:29 +00:00
|
|
|
/**
|
|
|
|
* What type of definition is it?
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
public $type;
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-05-24 22:08:29 +00:00
|
|
|
/**
|
|
|
|
* Sets up the definition object into the final form, something
|
|
|
|
* not done by the constructor
|
|
|
|
* @param $config HTMLPurifier_Config instance
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
abstract protected function doSetup($config);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-05-24 22:08:29 +00:00
|
|
|
/**
|
|
|
|
* Setup function that aborts if already setup
|
|
|
|
* @param $config HTMLPurifier_Config instance
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
public function setup($config) {
|
2007-05-24 22:08:29 +00:00
|
|
|
if ($this->setup) return;
|
|
|
|
$this->setup = true;
|
|
|
|
$this->doSetup($config);
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-05-24 22:08:29 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|