class Loader extends AbstractOptionable implements LoaderInterface

Properties

static $defaults The default options

Methods

__construct( array $user_options = array())

Creation of a Loader with an optional user defined set of options

$this
addPath( null|string $db_filename = null, null|string $db_directory = null, null|string $file = null)

Add a path to the registry

mixed
getParsedOption( string $name, string|array $lang = null, mixed $default = null)

Parse an option value replacing %s by the actual language code

string
buildLanguageFileName( string $lang, string $db_filename = null)

Build the file name for the language database

string
buildLanguageDirName( string $lang)

Build the directory name for the language database

string
buildLanguageFilePath( string $lang)

Build the absolute file path for the language database

string
buildLanguageVarname( string $lang)

Build the variable name for the language database

string
buildLanguageDBFileName()

Build the file name for the language CSV database

string
buildLanguageDBDirName()

Build the directory name for the language CSV database

string
buildLanguageDBFilePath()

Build the file path for the language CSV database

null|string
findLanguageDBFile( string $db_filename = null, string $db_directory = null)

Find (and add if needed) a language file from options directories

Details

at line 76
__construct( array $user_options = array())

Creation of a Loader with an optional user defined set of options

Parameters

array $user_options An array of options values to over-write defaults

at line 88
$this addPath( null|string $db_filename = null, null|string $db_directory = null, null|string $file = null)

Add a path to the registry

Parameters

null|string $db_filename
null|string $db_directory
null|string $file

Return Value

$this

at line 111
mixed getParsedOption( string $name, string|array $lang = null, mixed $default = null)

Parse an option value replacing %s by the actual language code

Parameters

string $name The option name
string|array $lang The language code to use or an array to pass to the 'sprintf()' method
mixed $default The value to return if the option can't be found

Return Value

mixed The value of the option if found, with replacement if so

at line 140
string buildLanguageFileName( string $lang, string $db_filename = null)

Build the file name for the language database

Parameters

string $lang The language code to use
string $db_filename A base filename to use

Return Value

string The file name for the concerned language

at line 155
string buildLanguageDirName( string $lang)

Build the directory name for the language database

Parameters

string $lang The language code to use

Return Value

string The directory name for the concerned language with trailing slash

at line 166
string buildLanguageFilePath( string $lang)

Build the absolute file path for the language database

Parameters

string $lang The language code to use

Return Value

string The file path for the concerned language

at line 177
string buildLanguageVarname( string $lang)

Build the variable name for the language database

Parameters

string $lang The language code to use

Return Value

string The variable name for the concerned language

at line 187
string buildLanguageDBFileName()

Build the file name for the language CSV database

Return Value

string

at line 197
string buildLanguageDBDirName()

Build the directory name for the language CSV database

Return Value

string

at line 207
string buildLanguageDBFilePath()

Build the file path for the language CSV database

Return Value

string

at line 219
null|string findLanguageDBFile( string $db_filename = null, string $db_directory = null)

Find (and add if needed) a language file from options directories

Parameters

string $db_filename
string $db_directory

Return Value

null|string