lib/DatabaseConnector.php
public function getConnection()
    {
        $conn = mysqli_init();
        if ($this->encryption === true) {
            Logger::debug("Getting connection with encryption.");
            mysqli_ssl_set($conn, $this->sslKey, $this->sslCert, $this->sslCA, $this->sslCAPath, null);
            if ($this->port === null) {
                mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName);
            } else {
                mysqli_real_connect(
                    $conn,
                    $this->serverName,
                    $this->username,
                    $this->password,
                    $this->databaseName,
                    $this->port
                );
            }
        } elseif ($this->port === null) {
            mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName);
        } else {
            mysqli_real_connect(
                $conn,
                $this->serverName,
                $this->username,
                $this->password,
                $this->databaseName,
                $this->port
            );
        }
        return $conn;
    }
public function getConnection()
    {
        $conn = mysqli_init();
        if ($this->encryption === true) {
            Logger::debug("Getting connection with encryption.");
            mysqli_ssl_set($conn, $this->sslKey, $this->sslCert, $this->sslCA, $this->sslCAPath, null);
            if ($this->port === null) {
                mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName);
            } else {
                mysqli_real_connect(
                    $conn,
                    $this->serverName,
                    $this->username,
                    $this->password,
                    $this->databaseName,
                    $this->port
                );
            }
        } elseif ($this->port === null) {
            mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName);
        } else {
            mysqli_real_connect(
                $conn,
                $this->serverName,
                $this->username,
                $this->password,
                $this->databaseName,
                $this->port
            );
        }
        return $conn;
    }
public function getConnection ( ) { $ conn = mysqli_init ( ) ; if ( $ this -> encryption === true ) { Logger :: debug ( "Getting connection with encryption." ) ; mysqli_ssl_set ( $ conn , $ this -> sslKey , $ this -> sslCert , $ this -> sslCA , $ this -> sslCAPath , null ) ; if ( $ this -> port === null ) { mysqli_real_connect ( $ conn , $ this -> serverName , $ this -> username , $ this -> password , $ this -> databaseName ) ; } else { mysqli_real_connect ( $ conn , $ this -> serverName , $ this -> username , $ this -> password , $ this -> databaseName , $ this -> port ) ; } } elseif ( $ this -> port === null ) { mysqli_real_connect ( $ conn , $ this -> serverName , $ this -> username , $ this -> password , $ this -> databaseName ) ; } else { mysqli_real_connect ( $ conn , $ this -> serverName , $ this -> username , $ this -> password , $ this -> databaseName , $ this -> port ) ; } return $ conn ; }
Function returns the connection to db
@return mysqli connection
Function returns the connection to db