A base Config File class for File based configs.

 Methods

Sets up the file to be parsed and variables

__construct(string $file, array $vars) 

Parameters

$file

string

Config file name

$vars

array

Variables to parse in the file

Gets the default group name.

group() : string

Returns

string

Loads the config file(s).

load(bool $overwrite, bool $cache) : array

Parameters

$overwrite

bool

Whether to overwrite existing values

$cache

bool

Whether to cache this path or not

Returns

arraythe config array

Formats the output and saved it to disc.

save(array $contents) : bool

Parameters

$contents

array

config array to save

Returns

bool\File::update result

Must be implemented by child class.

export_format(array $contents) : string

Gets called when saving a config file.

Parameters

$contents

array

config array to save

Returns

stringformatted output

Finds the given config files

find_file(bool $cache) : array

Parameters

$cache

bool

Whether to cache this path or not

Exceptions

\ConfigException

Returns

array

Must be implemented by child class.

load_file(string $file) 

Gets called for each file to load.

Parameters

$file

string

the path to the file

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 

 

$vars

$vars