\HTMLPurifier_LanguageFactory

Class responsible for generating HTMLPurifier_Language objects, managing caching and fallbacks.

Summary

Methods
Properties
Constants
instance()
setup()
create()
getFallbackFor()
loadLanguage()
$cache
$keys
No constants found
No protected methods found
$validator
$dir
$mergeable_keys_map
$mergeable_keys_list
N/A
No private methods found
No private properties found
N/A

Properties

$cache

$cache : 

Cache of language code information used to load HTMLPurifier_Language objects.

Structure is: $factory->cache[$language_code][$key] = $value

Type

$keys

$keys : 

Valid keys in the HTMLPurifier_Language object. Designates which variables to slurp out of a message file.

Type

$validator

$validator : 

Instance to validate language codes.

Type

$dir

$dir : 

Cached copy of dirname(__FILE__), directory of current file without trailing slash.

Type

$mergeable_keys_map

$mergeable_keys_map : 

Keys whose contents are a hash map and can be merged.

Type

$mergeable_keys_list

$mergeable_keys_list : 

Keys whose contents are a list and can be merged.

Type

Methods

instance()

instance(\HTMLPurifier_LanguageFactory  $prototype = null) : \HTMLPurifier_LanguageFactory

Retrieve sole instance of the factory.

Parameters

\HTMLPurifier_LanguageFactory $prototype

Optional prototype to overload sole instance with, or bool true to reset to default factory.

Returns

\HTMLPurifier_LanguageFactory

setup()

setup() 

Sets up the singleton, much like a constructor

create()

create(\HTMLPurifier_Config  $config, \HTMLPurifier_Context  $context, boolean|string  $code = false) : \HTMLPurifier_Language

Creates a language object, handles class fallbacks

Parameters

\HTMLPurifier_Config $config
\HTMLPurifier_Context $context
boolean|string $code

Code to override configuration with. Private parameter.

Returns

\HTMLPurifier_Language

getFallbackFor()

getFallbackFor(string  $code) : string|boolean

Returns the fallback language for language

Parameters

string $code

language code

Returns

string|boolean

loadLanguage()

loadLanguage(string  $code) 

Loads language into the cache, handles message file and fallbacks

Parameters

string $code

language code