Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. class Config
  2. {
  3. private $usuario;
  4. private $senha;
  5. private $_connection;
  6.  
  7. public function __construct($bd)
  8. {
  9. switch($bd)
  10. {
  11. case DBI:
  12. $this->$campus = 'mantenedora';
  13. $this->$site = 'teste';
  14. include 'phpdbi.inc';
  15. break;
  16.  
  17. case MANTENEDORA:
  18. $this->usuario = 'l_teste';
  19. $this->senha = 'teste12345';
  20. $this->_connection = "teste";
  21. break;
  22.  
  23. default:
  24. break;
  25. }
  26. }
  27.  
  28. public function getUsuario()
  29. {
  30. return $this->usuario;
  31. }
  32. public function getSenha()
  33. {
  34. return $this->senha;
  35. }
  36. public function getConnection()
  37. {
  38. return $this->_connection;
  39. }
  40. }
  41.  
  42. $config = new Config($bd);
  43.  
  44. $this->usuario = $config->getUsuario();
  45. $this->senha = $config->getSenha();
  46. $this->_connection = $config->getConnection();
  47.  
  48. $this->conectarBanco();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement