<?php

class Configuracoes_bd_DAO_arq
{
	private $_host;
	private $_dbname = "";
	private $_user = "";
	private $_senha = "";
	private $_sgbd = "";
	function __construct()
	{	
		$_config = new Config();
		// Guarda as macros de inicio jornada.
		$lines = file ($_config->diretorio_raiz().'/config/db_config.txt');
		foreach ($lines as $line) {
			//array_push($this->inicioJornada,str_replace("\r","",str_replace("\n","",$line)));
			$coluna = explode("->",$line);
			switch($coluna[0])
			{
				case "host":
					$this->_host = str_replace("\r","",str_replace("\n","",$coluna[1]));
				break;
				case "dbname":
					$this->_dbname = str_replace("\r","",str_replace("\n","",$coluna[1]));
				break;
				case "user":
					$this->_user = str_replace("\r","",str_replace("\n","",$coluna[1]));
				break;
				case "senha":
					$this->_senha = str_replace("\r","",str_replace("\n","",$coluna[1])); 
				break;
				case "sgbd":
					$this->_sgbd = str_replace("\r","",str_replace("\n","",$coluna[1])); 
				break;
			}
		}
		
		
	}
	public function getHost()
	{
		return  $this->_host;
	}	
	public function getDbname()
	{
		return $this->_dbname;
	}
	public function getUser()
	{
		return $this->_user;
	}
	public function getSenha()
	{
		return $this->_senha;
	}
	public function getSgbd()
	{
		return $this->_sgbd;
	}
		
}	
