Back to DatabaseLogger class

Method connect

protected void
connect
()
Method to connect to the database server based on object properties.
Returns
  • void
Since
  • 1.7.0
-
  • \RuntimeException

Method connect - Source code

/**
 * Method to connect to the database server based on object properties.
 *
 * @return  void
 *
 * @since   1.7.0
 * @throws  \RuntimeException
 */
protected function connect()
{
    // Build the configuration object to use for DatabaseDriver.
    $options = array('driver' => $this->driver, 'host' => $this->host, 'user' => $this->user, 'password' => $this->password, 'database' => $this->database, 'prefix' => $this->prefix);
    $this->db = DatabaseDriver::getInstance($options);
}