A base Lang File class for File based configs.

 Methods

Sets up the file to be parsed and variables

__construct(string $file, array $languages, array $vars) 

Parameters

$file

string

Lang file name

$languages

array

Languages to scan for the lang file

$vars

array

Variables to parse in the file

Gets the default group name.

group() : string

Returns

string

Loads the language file(s).

load(bool $overwrite) : array

Parameters

$overwrite

bool

Whether to overwrite existing values

Returns

arraythe language array

Formats the output and saved it to disc.

save(string $identifier, \Fuel\Core\$contents $contents) : bool

Parameters

$identifier

string

filename

$contents

\Fuel\Core\$contents

language array to save

Returns

bool\File::update result

Must be impletmented by child class.

export_format(array $contents) : string

Gets called when saving a language file.

Parameters

$contents

array

language array to save

Returns

stringformatted output

Finds the given language files

find_file() : array

Exceptions

\LangException

Returns

array

Must be implemented by child class.

load_file(string $file) : array

Gets called for each file to load.

Parameters

$file

string

File to load

Returns

array

Parses a string using all of the previously set variables.

parse_vars(string $string) : string

Allows you to use something like %APPPATH% in non-PHP files.

Parameters

$string

string

String to parse

Returns

string

Replaces FuelPHP's path constants to their string counterparts.

prep_vars(array $array) : array

Parameters

$array

array

array to be prepped

Returns

arrayprepped array

 Properties

 

$file

$file 

 

$languages

$languages 

 

$vars

$vars