Ejemplo n.º 1
0
 public function connect()
 {
     $dsn = 'sqlsrv:Server=' . $this->_server;
     if (!empty($this->_port)) {
         $dsn .= ', ' . $this->_port;
     }
     $dsn .= '; Database=' . $this->_database;
     parent::__construct($dsn, $this->_username, $this->_password, $this->_driver_options);
     $this->_connected = true;
 }
Ejemplo n.º 2
0
 public function connect()
 {
     $dsn = 'mysql:dbname=' . $this->_database . ';host=' . $this->_server;
     if (!empty($this->_port)) {
         $dsn .= ';port=' . $this->_port;
     }
     $this->_connected = true;
     $dbh = parent::__construct($dsn, $this->_username, $this->_password, $this->_driver_options);
     if ($this->_has_native_fk === false) {
         $this->setupForeignKeys();
     }
     return $dbh;
 }
Ejemplo n.º 3
0
 public function connect()
 {
     $dsn = 'sqlite:' . $this->_server;
     $this->_connected = true;
     return parent::__construct($dsn, $this->_username, $this->_password, $this->_driver_options);
 }