lib/Doctrine/DBAL/Connection.php
public function connect()
    {
        if ($this->isConnected) {
            return false;
        }

        $driverOptions = $this->params['driverOptions'] ?? [];
        $user          = $this->params['user'] ?? null;
        $password      = $this->params['password'] ?? null;

        $this->_conn       = $this->_driver->connect($this->params, $user, $password, $driverOptions);
        $this->isConnected = true;

        if ($this->autoCommit === false) {
            $this->beginTransaction();
        }

        if ($this->_eventManager->hasListeners(Events::postConnect)) {
            $eventArgs = new Event\ConnectionEventArgs($this);
            $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs);
        }

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

        $driverOptions = $this->params['driverOptions'] ?? [];
        $user          = $this->params['user'] ?? null;
        $password      = $this->params['password'] ?? null;

        $this->_conn       = $this->_driver->connect($this->params, $user, $password, $driverOptions);
        $this->isConnected = true;

        if ($this->autoCommit === false) {
            $this->beginTransaction();
        }

        if ($this->_eventManager->hasListeners(Events::postConnect)) {
            $eventArgs = new Event\ConnectionEventArgs($this);
            $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs);
        }

        return true;
    }
public function connect ( ) { if ( $ this -> isConnected ) { return false ; } $ driverOptions = $ this -> params [ 'driverOptions' ] ?? [ ] ; $ user = $ this -> params [ 'user' ] ?? null ; $ password = $ this -> params [ 'password' ] ?? null ; $ this -> _conn = $ this -> _driver -> connect ( $ this -> params , $ user , $ password , $ driverOptions ) ; $ this -> isConnected = true ; if ( $ this -> autoCommit === false ) { $ this -> beginTransaction ( ) ; } if ( $ this -> _eventManager -> hasListeners ( Events :: postConnect ) ) { $ eventArgs = new Event \ ConnectionEventArgs ( $ this ) ; $ this -> _eventManager -> dispatchEvent ( Events :: postConnect , $ eventArgs ) ; } return true ; }
Establishes the connection with the database.

@return bool TRUE if the connection was successfully established, FALSE if
the connection is already open.
Establishes the connection with the database .