\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

$keys

$keys

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

$validator

$validator

Instance to validate language codes.

$dir

$dir

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

$mergeable_keys_map

$mergeable_keys_map

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

$mergeable_keys_list

$mergeable_keys_list

Keys whose contents are a list and can be merged.

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() : mixed

Sets up the singleton, much like a constructor

Returns

mixed —

create()

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

Creates a language object, handles class fallbacks

Parameters

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

Code to override configuration with. Private parameter.

Returns

\HTMLPurifier_Language —

getFallbackFor()

getFallbackFor(string  $code) : string|bool

Returns the fallback language for language

Parameters

string $code

language code

Returns

string|bool —

loadLanguage()

loadLanguage(string  $code) : mixed

Loads language into the cache, handles message file and fallbacks

Parameters

string $code

language code

Returns

mixed —