function parse() { self::$KETTLE_HOME = getenv('KETTLE_HOME'); $fh = fopen(self::$KETTLE_HOME . '/' . $this->configFile, 'r'); while ($l = fgets($fh)) { if (preg_match('/^#/', $l) == false) { preg_match('/(?P<key>.*)=(?P<val>.*)/', $l, $found); if (count($found) > 3) { $this->items[trim($found[1])] = trim($found[2]); } } } fclose($fh); }