Skip to content

class Config_File

Oliver edited this page Apr 26, 2020 · 2 revisions

www/smartylib/Config_File.class.php


Config_File

Package

Smarty

Overview

Public Properties

_config_data() | _config_path() | booleanize() | fix_newlines() | overwrite() | read_hidden() |

Constants

No constants found

Public Methods

__construct() | _set_config_var() | _trigger_error_msg() | clear() | get() | get_file_names() | get_key() | get_section_names() | get_var_names() | load_file() | parse_contents() | set_file_contents() | set_path() |

Properties

_config_data

public $_config_data

_config_path

public $_config_path

booleanize

Controls whether config values of on/true/yes and off/false/no get converted to boolean values automatically.

public $booleanize

fix_newlines

Controls whether or not to fix mac or dos formatted newlines.

If set to true, \r or \r\n will be changed to \n. public $fix_newlines

overwrite

Controls whether variables with the same name overwrite each other.

public $overwrite

read_hidden

Controls whether hidden config sections/vars are read from the file.

public $read_hidden

Methods

__construct()

Constructs a new config file class.

public __construct(string $config_path = NULL) : mixed

_set_config_var()

public _set_config_var(mixed $container, string $var_name, mixed $var_value, bool $booleanize) : mixed

_trigger_error_msg()

public _trigger_error_msg(string $error_msg, int $error_type = E_USER_WARNING) : mixed

Uses creates a PHP warning/error

clear()

Clear loaded config data for a certain file or all files.

public clear(string $file_name = NULL) : mixed

get()

Retrieves config info based on the file, section, and variable name.

public get(string $file_name, string $section_name = NULL, string $var_name = NULL) : string|array

get_file_names()

Get all loaded config file names.

public get_file_names() : array

get_key()

Retrieves config info based on the key.

public get_key(mixed $config_key) : string|array

Uses retrieves information from config file and returns it

get_section_names()

Get all section names from a loaded file.

public get_section_names(string $file_name) : array

get_var_names()

Get all global or section variable names.

public get_var_names(string $file_name, mixed $section = NULL) : array

load_file()

Load a configuration file manually.

public load_file(string $file_name, bool $prepend_path = true) : mixed

parse_contents()

parse the source of a configuration file manually.

public parse_contents(string $contents) : mixed

set_file_contents()

Store the contents of a file manually.

public set_file_contents(string $config_file, string $contents) : mixed

set_path()

Set the path where configuration files can be found.

public set_path(string $config_path) : mixed


\ » Classes » Config_File

Clone this wiki locally