Fix two bugs with caching of customized raw definitions.
[htmlpurifier.git] / library / HTMLPurifier / ConfigSchema / Interchange / Id.php
blobb9b3c6f5cfbdd0819a34579e857f2e724dcb4edc
1 <?php
3 /**
4 * Represents a directive ID in the interchange format.
5 */
6 class HTMLPurifier_ConfigSchema_Interchange_Id
9 public $key;
11 public function __construct($key) {
12 $this->key = $key;
15 /**
16 * @warning This is NOT magic, to ensure that people don't abuse SPL and
17 * cause problems for PHP 5.0 support.
19 public function toString() {
20 return $this->key;
23 public function getRootNamespace() {
24 return substr($this->key, 0, strpos($this->key, "."));
27 public function getDirective() {
28 return substr($this->key, strpos($this->key, ".") + 1);
31 public static function make($id) {
32 return new HTMLPurifier_ConfigSchema_Interchange_Id($id);
37 // vim: et sw=4 sts=4