Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Config
- {
- private $usuario;
- private $senha;
- private $_connection;
- public function __construct($bd)
- {
- switch($bd)
- {
- case DBI:
- $this->$campus = 'mantenedora';
- $this->$site = 'teste';
- include 'phpdbi.inc';
- break;
- case MANTENEDORA:
- $this->usuario = 'l_teste';
- $this->senha = 'teste12345';
- $this->_connection = "teste";
- break;
- default:
- break;
- }
- }
- public function getUsuario()
- {
- return $this->usuario;
- }
- public function getSenha()
- {
- return $this->senha;
- }
- public function getConnection()
- {
- return $this->_connection;
- }
- }
- $config = new Config($bd);
- $this->usuario = $config->getUsuario();
- $this->senha = $config->getSenha();
- $this->_connection = $config->getConnection();
- $this->conectarBanco();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement