original_string: 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;
          }
      }
code: 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;
          }
      }
code_tokens: 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 ; } }
docstring: 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
docstring_tokens: Generates a new connection to DB .