Added custom parse_ini_file/string functions to deal with '#' comment lines

This commit is contained in:
bergware
2016-10-26 07:08:46 +02:00
parent d2db2c7cb0
commit 71b3500a4a

View File

@@ -240,10 +240,10 @@ function transpose_user_path($path) {
return $path;
}
// custom parse_ini_file/string functions to deal with '#' comment lines
function my_parse_ini_file($file) {
return parse_ini_string(preg_replace('/^#/',';',file_get_contents($file)));
function my_parse_ini_file($file, $sections=false, $scanner=INI_SCANNER_NORMAL) {
return parse_ini_string(preg_replace('/^#/',';',file_get_contents($file)),$sections,$scanner);
}
function my_parse_ini_string($string) {
return parse_ini_string(preg_replace('/^#/',';',$string));
function my_parse_ini_string($text, $sections=false, $scanner=INI_SCANNER_NORMAL) {
return parse_ini_string(preg_replace('/^#/',';',$text),$sections,$scanner);
}
?>