API - XOOPS 2.5.11 Beta 2
By monxoops.fr
HTMLPurifier_LanguageFactory Class Reference

Public Member Functions

 setup ()
 
 create ($config, $context, $code=false)
 
 getFallbackFor ($code)
 
 loadLanguage ($code)
 

Static Public Member Functions

static instance ($prototype=null)
 

Data Fields

 $cache
 
 $keys = array('fallback', 'messages', 'errorNames')
 

Protected Attributes

 $validator
 
 $dir
 
 $mergeable_keys_map = array('messages' => true, 'errorNames' => true)
 
 $mergeable_keys_list = array()
 

Detailed Description

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

Note
Thanks to MediaWiki for the general logic, although this version has been entirely rewritten
Todo:
Serialized cache for languages

Member Function Documentation

◆ create()

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.
Returns
HTMLPurifier_Language
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFallbackFor()

getFallbackFor (   $code)

Returns the fallback language for language

Note
Loads the original language into cache
Parameters
string$codelanguage code
Returns
string|bool
Here is the call graph for this function:
Here is the caller graph for this function:

◆ instance()

static 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.
Returns
HTMLPurifier_LanguageFactory
Here is the caller graph for this function:

◆ loadLanguage()

loadLanguage (   $code)

Loads language into the cache, handles message file and fallbacks

Parameters
string$codelanguage code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup()

setup ( )

Sets up the singleton, much like a constructor

Note
Prevents people from getting this outside of the singleton

Field Documentation

◆ $cache

$cache

Cache of language code information used to load HTMLPurifier_Language objects. Structure is: $factory->cache[$language_code][$key] = $value @type array

◆ $dir

$dir
protected

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

◆ $keys

$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

$mergeable_keys_list = array()
protected

Keys whose contents are a list and can be merged. @value array lookup

◆ $mergeable_keys_map

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

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

◆ $validator

$validator
protected

Instance to validate language codes. @type HTMLPurifier_AttrDef_Lang


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