_path = $path; $this->_section = $section; } /** * Read an ini file and return the results as an array. * * @param string $file Name of the file to read. * @return array */ public function read($file) { $filename = $this->_path . $file; $contents = parse_ini_file($filename, true); if (!empty($this->_section) && isset($contents[$this->_section])) { $values = $contents[$this->_section]; } else { $values = $contents; } return $values; } }