Class responsible for generating HTMLPurifier_Language objects, managing caching and fallbacks.
| Methods | ||||
|---|---|---|---|---|
| 
					
	public
					static
					
				 | instance(HTMLPurifier_LanguageFactory $prototype = null): HTMLPurifier_LanguageFactory
		Retrieve sole instance of the factory.
	 Retrieve sole instance of the factory. Parameters
 | # | ||
| 
					
	public
					
					
				 | setup()
		Sets up the singleton, much like a constructor
	 Sets up the singleton, much like a constructor | # | ||
| 
					
	public
					
					
				 | create(HTMLPurifier_Config $config, HTMLPurifier_Context $context, bool|string $code = false): HTMLPurifier_Language
		Creates a language object, handles class fallbacks
	 Creates a language object, handles class fallbacks Parameters
 | # | ||
| 
					
	public
					
					
				 | getFallbackFor(string $code): string|bool
		Returns the fallback language for language
	 Returns the fallback language for language Parameters
 | # | ||
| 
					
	public
					
					
				 | loadLanguage(string $code)
		Loads language into the cache, handles message file and fallbacks
	 Loads language into the cache, handles message file and fallbacks Parameters
 | # | ||
| Properties | |||
|---|---|---|---|
| 
	public
					
					
				 |  | $cache
		Cache of language code information used to load HTMLPurifier_Language objects.
Structure is: $factory->cache[$languageā¦
	 Cache of language code information used to load HTMLPurifier_Language objects. Structure is: $factory->cache[$language_code][$key] = $value | # | 
| 
	public
					
					
				 |  | $keys = ['fallback', 'messages', 'errorNames']
		Valid keys in the HTMLPurifier_Language object. Designates which
variables to slurp out of a message file.
	 Valid keys in the HTMLPurifier_Language object. Designates which variables to slurp out of a message file. | # | 
| 
	protected
					
					
				 |  | $validator
		Instance to validate language codes.
	 Instance to validate language codes. | # | 
| 
	protected
					
					
				 |  | $dir
		Cached copy of dirname(__FILE__), directory of current file without
trailing slash.
	 Cached copy of dirname(FILE), directory of current file without trailing slash. | # | 
| 
	protected
					
					
				 |  | $mergeable_keys_map = ['messages' => true, 'errorNames' => true]
		Keys whose contents are a hash map and can be merged.
	 Keys whose contents are a hash map and can be merged. | # | 
| 
	protected
					
					
				 |  | $mergeable_keys_list = []
		Keys whose contents are a list and can be merged.
	 Keys whose contents are a list and can be merged. | # |