Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
HTMLPurifier_LanguageFactory Class Reference

Public Member Functions

 create ($config, $context, $code=false)
 Creates a language object, handles class fallbacks.
 
 getFallbackFor ($code)
 Returns the fallback language for language.
 
 loadLanguage ($code)
 Loads language into the cache, handles message file and fallbacks.
 
 setup ()
 Sets up the singleton, much like a constructor.
 

Static Public Member Functions

static instance ($prototype=null)
 Retrieve sole instance of the factory.
 

Public Attributes

 $cache
 Cache of language code information used to load HTMLPurifier_Language objects.
 
 $keys = array('fallback', 'messages', 'errorNames')
 Valid keys in the HTMLPurifier_Language object.
 

Protected Attributes

 $dir
 Cached copy of dirname(FILE), directory of current file without trailing slash.
 
 $mergeable_keys_list = array()
 Keys whose contents are a list and can be merged.
 
 $mergeable_keys_map = array('messages' => true, 'errorNames' => true)
 Keys whose contents are a hash map and can be merged.
 
 $validator
 Instance to validate language codes.
 

Member Function Documentation

◆ create()

HTMLPurifier_LanguageFactory::create ( $config,
$context,
$code = false )

Creates a language object, handles class fallbacks.

Parameters
HTMLPurifier_Config$config
HTMLPurifier_Context$context
bool | string$codeCode to override configuration with. Private parameter.
Return values
HTMLPurifier_Language

◆ getFallbackFor()

HTMLPurifier_LanguageFactory::getFallbackFor ( $code)

Returns the fallback language for language.

Note
Loads the original language into cache
Parameters
string$codelanguage code
Return values
string|bool

◆ instance()

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

Retrieve sole instance of the factory.

Parameters
HTMLPurifier_LanguageFactory$prototypeOptional prototype to overload sole instance with, or bool true to reset to default factory.
Return values
HTMLPurifier_LanguageFactory

◆ loadLanguage()

HTMLPurifier_LanguageFactory::loadLanguage ( $code)

Loads language into the cache, handles message file and fallbacks.

Parameters
string$codelanguage code

◆ setup()

HTMLPurifier_LanguageFactory::setup ( )

Sets up the singleton, much like a constructor.

Note
Prevents people from getting this outside of the singleton

Member Data Documentation

◆ $cache

HTMLPurifier_LanguageFactory::$cache

Cache of language code information used to load HTMLPurifier_Language objects.

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

◆ $dir

HTMLPurifier_LanguageFactory::$dir
protected

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

@type string

◆ $keys

HTMLPurifier_LanguageFactory::$keys = array('fallback', 'messages', 'errorNames')

Valid keys in the HTMLPurifier_Language object.

Designates which variables to slurp out of a message file. @type array

◆ $mergeable_keys_list

HTMLPurifier_LanguageFactory::$mergeable_keys_list = array()
protected

Keys whose contents are a list and can be merged.

@value array lookup

◆ $mergeable_keys_map

HTMLPurifier_LanguageFactory::$mergeable_keys_map = array('messages' => true, 'errorNames' => true)
protected

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

@type array

◆ $validator

HTMLPurifier_LanguageFactory::$validator
protected

Instance to validate language codes.

@type HTMLPurifier_AttrDef_Lang


The documentation for this class was generated from the following file: