PHP Class phpbb\language\language_file_loader

Mostra file Open project: phpbb/phpbb

Protected Properties

Property Type Description
$extension_manager Extension manager
$php_ext Extension of PHP files
$phpbb_root_path Path to phpBB's root

Public Methods

Method Description
__construct ( string $phpbb_root_path, string $php_ext ) Constructor
load ( string $component, string | array $locale, array &$lang ) Loads language array for the given component
load_extension ( string $extension, string $component, string | array $locale, array &$lang ) Loads language array for the given extension component
set_extension_manager ( phpbb\extension\manager $extension_manager ) Extension manager setter

Protected Methods

Method Description
get_language_file_path ( string $path, string $filename, $locales ) : string This function implements language fallback logic
load_file ( string $path, string $component, array $locale, array &$lang ) Prepares language file loading
load_language_file ( string $path, array &$lang ) Loads language file

Method Details

__construct() public method

Constructor
public __construct ( string $phpbb_root_path, string $php_ext )
$phpbb_root_path string Path to phpBB's root
$php_ext string Extension of PHP files

get_language_file_path() protected method

This function implements language fallback logic
protected get_language_file_path ( string $path, string $filename, $locales ) : string
$path string Path to language directory
$filename string Filename to load language strings from
return string Relative path to language file

load() public method

Loads language array for the given component
public load ( string $component, string | array $locale, array &$lang )
$component string Name of the language component
$locale string | array ISO code of the language to load, or array of ISO codes if you want to specify additional language fallback steps
$lang array Array reference containing language strings

load_extension() public method

Loads language array for the given extension component
public load_extension ( string $extension, string $component, string | array $locale, array &$lang )
$extension string Name of the extension
$component string Name of the language component
$locale string | array ISO code of the language to load, or array of ISO codes if you want to specify additional language fallback steps
$lang array Array reference containing language strings

load_file() protected method

Prepares language file loading
protected load_file ( string $path, string $component, array $locale, array &$lang )
$path string Path to search for file in
$component string Name of the language component
$locale array Array containing language fallback options
$lang array Array reference of language strings

load_language_file() protected method

Loads language file
protected load_language_file ( string $path, array &$lang )
$path string Path to language file to load
$lang array Reference of the array of language strings

set_extension_manager() public method

Extension manager setter
public set_extension_manager ( phpbb\extension\manager $extension_manager )
$extension_manager phpbb\extension\manager Extension manager

Property Details

$extension_manager protected_oe property

Extension manager
protected $extension_manager

$php_ext protected_oe property

Extension of PHP files
protected $php_ext

$phpbb_root_path protected_oe property

Path to phpBB's root
protected $phpbb_root_path