| @@ 36-46 (lines=11) @@ | ||
| 33 | * @param HTMLPurifier_DefinitionCacheFactory $prototype |
|
| 34 | * @return HTMLPurifier_DefinitionCacheFactory |
|
| 35 | */ |
|
| 36 | public static function instance($prototype = null) |
|
| 37 | { |
|
| 38 | static $instance; |
|
| 39 | if ($prototype !== null) { |
|
| 40 | $instance = $prototype; |
|
| 41 | } elseif ($instance === null || $prototype === true) { |
|
| 42 | $instance = new HTMLPurifier_DefinitionCacheFactory(); |
|
| 43 | $instance->setup(); |
|
| 44 | } |
|
| 45 | return $instance; |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * Registers a new definition cache object |
|
| @@ 59-69 (lines=11) @@ | ||
| 56 | * or bool true to reset to default factory. |
|
| 57 | * @return HTMLPurifier_LanguageFactory |
|
| 58 | */ |
|
| 59 | public static function instance($prototype = null) |
|
| 60 | { |
|
| 61 | static $instance = null; |
|
| 62 | if ($prototype !== null) { |
|
| 63 | $instance = $prototype; |
|
| 64 | } elseif ($instance === null || $prototype == true) { |
|
| 65 | $instance = new HTMLPurifier_LanguageFactory(); |
|
| 66 | $instance->setup(); |
|
| 67 | } |
|
| 68 | return $instance; |
|
| 69 | } |
|
| 70 | ||
| 71 | /** |
|
| 72 | * Sets up the singleton, much like a constructor |
|