Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. include_once '../config/define.php';
  2. include_once '../config/config.php';
  3.  
  4. /*class Config
  5. {
  6. private $usuario;
  7. private $senha;
  8. private $_connection;
  9.  
  10. public function __construct($bd)
  11. {
  12. switch($bd)
  13. {
  14. case DBI:
  15. $this->$campus = 'mantenedora';
  16. $this->$site = 'teste';
  17. include 'phpdbi.inc';
  18. break;
  19.  
  20. case MANTENEDORA:
  21. $this->usuario = 'l_teste';
  22. $this->senha = 'teste12345';
  23. $this->_connection = "teste";
  24. break;
  25.  
  26. default:
  27. break;
  28. }
  29. }
  30.  
  31. public function getUsuario()
  32. {
  33. return $this->usuario;
  34. }
  35. public function getSenha()
  36. {
  37. return $this->senha;
  38. }
  39. public function getConnection()
  40. {
  41. return $this->_connection;
  42. }
  43. }
  44. */
  45.  
  46. class Banco {
  47.  
  48. public $table = '';
  49. public $conexao = null;
  50.  
  51. private $usuario;
  52. private $senha;
  53.  
  54. private $_chave = null;
  55. private $_length = 250;
  56.  
  57. private $_connection;
  58. private static $_instance;
  59.  
  60. public function __construct($bd = null)
  61. {
  62. //arquivo que contém os dados de acesso do $bd especificado
  63. $config = new Config($bd);
  64.  
  65. $this->usuario = $config->getUsuario();
  66. $this->senha = $config->getSenha();
  67. $this->_connection = $config->getConnection();
  68.  
  69. $this->conectarBanco();
  70.  
  71. }
  72.  
  73. public function conectarBanco()
  74. {
  75. $this->conexao = oci_connect($this->usuario, $this->senha, $this->_connection, 'UTF8');
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement