PHP Class HTMLPurifier_LanguageFactory, yii

Mostra file Open project: yiisoft/yii Class Usage Examples

Public Properties

Property Type Description
$cache Structure is: $factory->cache[$language_code][$key] = $value
$keys Valid keys in the HTMLPurifier_Language object. Designates which variables to slurp out of a message file.

Protected Properties

Property Type Description
$dir Cached copy of dirname(__FILE__), directory of current file without trailing slash.
$mergeable_keys_list Keys whose contents are a list and can be merged.
$mergeable_keys_map Keys whose contents are a hash map and can be merged.
$validator Instance to validate language codes.

Public Methods

Method Description
create ( HTMLPurifier_Config $config, HTMLPurifier_Context $context, boolean | string $code = false ) : HTMLPurifier_Language Creates a language object, handles class fallbacks
getFallbackFor ( string $code ) : string | boolean Returns the fallback language for language
instance ( HTMLPurifier_LanguageFactory $prototype = null ) : HTMLPurifier_LanguageFactory Retrieve sole instance of the factory.
loadLanguage ( string $code ) Loads language into the cache, handles message file and fallbacks
setup ( ) Sets up the singleton, much like a constructor

Method Details

create() public method

Creates a language object, handles class fallbacks
public create ( HTMLPurifier_Config $config, HTMLPurifier_Context $context, boolean | string $code = false ) : HTMLPurifier_Language
$config HTMLPurifier_Config
$context HTMLPurifier_Context
$code boolean | string Code to override configuration with. Private parameter.
return HTMLPurifier_Language

getFallbackFor() public method

Returns the fallback language for language
public getFallbackFor ( string $code ) : string | boolean
$code string language code
return string | boolean

instance() public static method

Retrieve sole instance of the factory.
public static instance ( HTMLPurifier_LanguageFactory $prototype = null ) : HTMLPurifier_LanguageFactory
$prototype HTMLPurifier_LanguageFactory Optional prototype to overload sole instance with, or bool true to reset to default factory.
return HTMLPurifier_LanguageFactory

loadLanguage() public method

Loads language into the cache, handles message file and fallbacks
public loadLanguage ( string $code )
$code string language code

setup() public method

Sets up the singleton, much like a constructor
public setup ( )

Property Details

$cache public_oe property

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

$dir protected_oe property

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

$keys public_oe property

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

$mergeable_keys_list protected_oe property

Keys whose contents are a list and can be merged.
protected $mergeable_keys_list

$mergeable_keys_map protected_oe property

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

$validator protected_oe property

Instance to validate language codes.
protected $validator