src/Titon/Db/Driver/AbstractPdoDriver.php
public function connect() {
        if ($this->isConnected()) {
            return true;
        }

        // @codeCoverageIgnoreStart
        if (!$this->isEnabled()) {
            throw new MissingDriverException(sprintf('%s driver extension is not enabled', $this->getDriver()));
        }
        // @codeCoverageIgnoreEnd

        $this->_connections[$this->getContext()] = new PDO($this->getDsn(), $this->getUser(), $this->getPassword(), $this->getConfig('flags') + [
            PDO::ATTR_PERSISTENT => $this->isPersistent(),
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
        ]);

        return true;
    }
public function connect() {
        if ($this->isConnected()) {
            return true;
        }

        // @codeCoverageIgnoreStart
        if (!$this->isEnabled()) {
            throw new MissingDriverException(sprintf('%s driver extension is not enabled', $this->getDriver()));
        }
        // @codeCoverageIgnoreEnd

        $this->_connections[$this->getContext()] = new PDO($this->getDsn(), $this->getUser(), $this->getPassword(), $this->getConfig('flags') + [
            PDO::ATTR_PERSISTENT => $this->isPersistent(),
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
        ]);

        return true;
    }
public function connect ( ) { if ( $ this -> isConnected ( ) ) { return true ; } // @codeCoverageIgnoreStart if ( ! $ this -> isEnabled ( ) ) { throw new MissingDriverException ( sprintf ( '%s driver extension is not enabled' , $ this -> getDriver ( ) ) ) ; } // @codeCoverageIgnoreEnd $ this -> _connections [ $ this -> getContext ( ) ] = new PDO ( $ this -> getDsn ( ) , $ this -> getUser ( ) , $ this -> getPassword ( ) , $ this -> getConfig ( 'flags' ) + [ PDO :: ATTR_PERSISTENT => $ this -> isPersistent ( ) , PDO :: ATTR_ERRMODE => PDO :: ERRMODE_EXCEPTION ] ) ; return true ; }
Connect to the database using PDO.

@return bool
@throws \Titon\Db\Exception\MissingDriverException
Connect to the database using PDO .