Cool. I just improved the parser a little bit more, removed redundancies and repeated code, and made it case-insensitive.
//on recupere la conf courante
foreach($myphpini as $line) {
$extMatch = array();
if(preg_match('/^(?extension\s*=\s*"?([a-z0-9_]+)\.dll"?/i', $line, $extMatch)) {
$ext_name = $extMatch[2];
if($extMatch[1] == ';') {
$ext[$ext_name] = '0';
} else {
$ext[$ext_name] = '1';
}
}
/*if(preg_match('|^;extension=|', $line)) {
$ext_name = str_replace(';extension=', '', $line);
$ext_name = str_replace('.dll
', '', $ext_name);
$ext[$ext_name] = '0';
} elseif(preg_match('|^extension=|', $line)) {
$ext_name = str_replace('extension=', '', $line);
$ext_name = str_replace('.dll
', '', $ext_name);
$ext[$ext_name] = '1';
}*/
}
Timeless Thoughts of Imagination
-----------------------------------------------------
I am pessimistically optimistic.