DbPatch_Core_Config::__construct PHP Method

__construct() public method

public __construct ( string $filename = null )
$filename string optional config file
    public function __construct($filename = null)
    {
        if (is_null($filename) || !file_exists($filename)) {
            $filename = $this->searchConfigFile();
        }
        if (is_null($filename)) {
            throw new DbPatch_Exception('No config file found');
        }
        $type = $this->detectConfigType($filename);
        switch ($type) {
            case 'php':
                $this->config = $this->loadPhpConfig($filename, 'dbpatch', false);
                break;
            case 'ini':
                $this->config = $this->loadIniConfig($filename, 'dbpatch', true);
                break;
            case 'xml':
                $this->config = $this->loadXmlConfig($filename, 'dbpatch', true);
                break;
            default:
                throw new DbPatch_Exception('Not a valid config file');
        }
    }