original_string: function db_init() {
          if ($this->is_configured() === false) {
              throw new moodle_exception('auth_dbcantconnect', 'auth_db');
          }
  
          // Connect to the external database (forcing new connection).
          $authdb = ADONewConnection($this->config->type);
          if (!empty($this->config->debugauthdb)) {
              $authdb->debug = true;
              ob_start(); //Start output buffer to allow later use of the page headers.
          }
          $authdb->Connect($this->config->host, $this->config->user, $this->config->pass, $this->config->name, true);
          $authdb->SetFetchMode(ADODB_FETCH_ASSOC);
          if (!empty($this->config->setupsql)) {
              $authdb->Execute($this->config->setupsql);
          }
  
          return $authdb;
      }
code: function db_init() {
          if ($this->is_configured() === false) {
              throw new moodle_exception('auth_dbcantconnect', 'auth_db');
          }
  
          // Connect to the external database (forcing new connection).
          $authdb = ADONewConnection($this->config->type);
          if (!empty($this->config->debugauthdb)) {
              $authdb->debug = true;
              ob_start(); //Start output buffer to allow later use of the page headers.
          }
          $authdb->Connect($this->config->host, $this->config->user, $this->config->pass, $this->config->name, true);
          $authdb->SetFetchMode(ADODB_FETCH_ASSOC);
          if (!empty($this->config->setupsql)) {
              $authdb->Execute($this->config->setupsql);
          }
  
          return $authdb;
      }
code_tokens: function db_init ( ) { if ( $ this -> is_configured ( ) === false ) { throw new moodle_exception ( 'auth_dbcantconnect' , 'auth_db' ) ; } // Connect to the external database (forcing new connection). $ authdb = ADONewConnection ( $ this -> config -> type ) ; if ( ! empty ( $ this -> config -> debugauthdb ) ) { $ authdb -> debug = true ; ob_start ( ) ; //Start output buffer to allow later use of the page headers. } $ authdb -> Connect ( $ this -> config -> host , $ this -> config -> user , $ this -> config -> pass , $ this -> config -> name , true ) ; $ authdb -> SetFetchMode ( ADODB_FETCH_ASSOC ) ; if ( ! empty ( $ this -> config -> setupsql ) ) { $ authdb -> Execute ( $ this -> config -> setupsql ) ; } return $ authdb ; }
docstring: Connect to external database.
  
  @return ADOConnection
  @throws moodle_exception
docstring_tokens: Connect to external database .