static function parseConfig($file)
{
$a = array();
@($file_content = file($file));
if (empty($file_content)) {
// Pommo::kill('Could not read config file ('.$file.')');
return false;
}
foreach ($file_content as $rawLine) {
$line = trim($rawLine);
if (substr($line, 0, 1) == '[') {
// line should be traded as a key:value pair
$matches = array();
preg_match('/^\\[(\\w+)\\]\\s*=\\s*\\"?([^\\"]*)\\"?.*$/i', $line, $matches);
// check if a key:value was extracted
if (!empty($matches[2])) {
// merge key:value onto return array
$a = array_merge($a, array($matches[1] => $matches[2]));
}
}
}
return $a;
}