public function getConn()
    {
        if (!$this->config('connection.className')) {
            $this->error(__d('installer', 'Database engine cannot be empty.'));

            return false;
        }

        try {
            ConnectionManager::drop('installation');
            ConnectionManager::config('installation', $this->config('connection'));
            $conn = ConnectionManager::get('installation');
            $conn->connect();

            return $conn;
        } catch (\Exception $ex) {
            $this->error(__d('installer', 'Unable to connect to database, please check your information. Details: {0}', '<p>' . $ex->getMessage() . '</p>'));

            return false;
        }
    }
public function getConn()
    {
        if (!$this->config('connection.className')) {
            $this->error(__d('installer', 'Database engine cannot be empty.'));

            return false;
        }

        try {
            ConnectionManager::drop('installation');
            ConnectionManager::config('installation', $this->config('connection'));
            $conn = ConnectionManager::get('installation');
            $conn->connect();

            return $conn;
        } catch (\Exception $ex) {
            $this->error(__d('installer', 'Unable to connect to database, please check your information. Details: {0}', '<p>' . $ex->getMessage() . '</p>'));

            return false;
        }
    }
public function getConn ( ) { if ( ! $ this -> config ( 'connection.className' ) ) { $ this -> error ( __d ( 'installer' , 'Database engine cannot be empty.' ) ) ; return false ; } try { ConnectionManager :: drop ( 'installation' ) ; ConnectionManager :: config ( 'installation' , $ this -> config ( 'connection' ) ) ; $ conn = ConnectionManager :: get ( 'installation' ) ; $ conn -> connect ( ) ; return $ conn ; } catch ( \ Exception $ ex ) { $ this -> error ( __d ( 'installer' , 'Unable to connect to database, please check your information. Details: {0}' , '<p>' . $ ex -> getMessage ( ) . '</p>' ) ) ; return false ; } }
Generates a new connection to DB.

@return \Cake\Database\Connection|bool A connection object, or false on
failure. On failure error messages are automatically set
Generates a new connection to DB .