Moodle  2.2.1
http://www.collinsharper.com
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

Definition at line 10 of file LanguageFactory.php.


Member Function Documentation

create ( config,
context,
code = false 
)

Creates a language object, handles class fallbacks

Parameters:
$configInstance of HTMLPurifier_Config
$contextInstance of HTMLPurifier_Context
$codeCode to override configuration with. Private parameter.

Definition at line 83 of file LanguageFactory.php.

Here is the call graph for this function:

getFallbackFor ( code)

Returns the fallback language for language

Note:
Loads the original language into cache
Parameters:
$codestring language code

Definition at line 129 of file LanguageFactory.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static instance ( prototype = null) [static]

Retrieve sole instance of the factory.

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

Definition at line 57 of file LanguageFactory.php.

loadLanguage ( code)

Loads language into the cache, handles message file and fallbacks

Parameters:
$codestring language code

Definition at line 138 of file LanguageFactory.php.

Here is the caller graph for this function:

setup ( )

Sets up the singleton, much like a constructor

Note:
Prevents people from getting this outside of the singleton

Definition at line 72 of file LanguageFactory.php.


Field Documentation

$cache

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

Definition at line 18 of file LanguageFactory.php.

$dir [protected]

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

Definition at line 38 of file LanguageFactory.php.

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

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

Definition at line 25 of file LanguageFactory.php.

$mergeable_keys_list = array() [protected]

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

Definition at line 50 of file LanguageFactory.php.

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

Keys whose contents are a hash map and can be merged array lookup

Definition at line 44 of file LanguageFactory.php.

$validator [protected]

Instance of HTMLPurifier_AttrDef_Lang to validate language codes object HTMLPurifier_AttrDef_Lang

Definition at line 31 of file LanguageFactory.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations