\HTMLPurifier_LanguageFactory
Class responsible for generating HTMLPurifier_Language objects, managing caching and fallbacks.
Synopsis
class HTMLPurifier_LanguageFactory
{
- // members
- public $cache;
- public array $keys = ;
- protected $validator;
- protected $dir;
- protected array $mergeable_keys_map = ;
- protected array $mergeable_keys_list = ;
- // methods
- public static void instance()
- public void setup()
- public void create()
- public void getFallbackFor()
- public void loadLanguage()
Tasks
Line | Task |
---|---|
10+ | Serialized cache for languages |
Members
protected
-
$dir
Cached copy of dirname(__FILE__), directory of current file without trailing slash -
$mergeable_keys_list
Keys whose contents are a list and can be merged -
$mergeable_keys_map
Keys whose contents are a hash map and can be merged -
$validator
Instance of HTMLPurifier_AttrDef_Lang to validate language codes
public
-
$cache
Cache of language code information used to load HTMLPurifier_Language objects Structure is: $factory->cache[$language_code][$key] = $value -
$keys
Valid keys in the HTMLPurifier_Language object. Designates which variables to slurp out of a message file.
Methods
public
- create() — Creates a language object, handles class fallbacks
- getFallbackFor() — Returns the fallback language for language
- instance() — Retrieve sole instance of the factory.
- loadLanguage() — Loads language into the cache, handles message file and fallbacks
- setup() — Sets up the singleton, much like a constructor