Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include_once '../config/define.php';
- include_once '../config/config.php';
- /*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;
- }
- }
- */
- class Banco {
- public $table = '';
- public $conexao = null;
- private $usuario;
- private $senha;
- private $_chave = null;
- private $_length = 250;
- private $_connection;
- private static $_instance;
- public function __construct($bd = null)
- {
- //arquivo que contém os dados de acesso do $bd especificado
- $config = new Config($bd);
- $this->usuario = $config->getUsuario();
- $this->senha = $config->getSenha();
- $this->_connection = $config->getConnection();
- $this->conectarBanco();
- }
- public function conectarBanco()
- {
- $this->conexao = oci_connect($this->usuario, $this->senha, $this->_connection, 'UTF8');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement