<?php

/**
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package fusionLib
 * @copyright Copyright (c) 2012 - 2013 fusionLib. All rights reserved.
 * @link http://fusionlib.com
 */

/**
 * flConfigFile Class
 *
 * Class to provide access to configuration data held in .php files.
 *
 * @package fusionLib
 */
class flConfigFile extends flConfig {

	/**
	 * Construct a new configuration object.
	 *
	 * @param string $filename The name of the configuration data file to load.
	 * @throws flConfigException
	 */
	function __construct($filename) {
		if(is_readable($filename))
			@include $filename;

		if(!isset($config) || !is_array($config))
			throw new flConfigException("Unable to load configuration file '$filename'.");

		parent::__construct($filename, $config);
	}
}
