src/DB.php
public static function sanitizeDbParameters($dbParams) {
        switch (self::getDbType()) {
            case 'mysql':
                if (empty($dbParams['unix_socket'])) {
                    unset($dbParams['unix_socket']);
                }
                
                if (empty($dbParams['charset'])) {
                    unset($dbParams['charset']);
                }
                break;
            case 'sqlite':
                if (empty($dbParams['user'])) {
                    unset($dbParams['user']);
                }
                
                if (empty($dbParams['password'])) {
                    unset($dbParams['password']);
                }
                
                if (empty($dbParams['host'])) {
                    unset($dbParams['host']);
                }
                if (empty($dbParams['port'])) {
                    unset($dbParams['port']);
                }                
                break;
        }
        
        return $dbParams;
    }
public static function sanitizeDbParameters($dbParams) {
        switch (self::getDbType()) {
            case 'mysql':
                if (empty($dbParams['unix_socket'])) {
                    unset($dbParams['unix_socket']);
                }
                
                if (empty($dbParams['charset'])) {
                    unset($dbParams['charset']);
                }
                break;
            case 'sqlite':
                if (empty($dbParams['user'])) {
                    unset($dbParams['user']);
                }
                
                if (empty($dbParams['password'])) {
                    unset($dbParams['password']);
                }
                
                if (empty($dbParams['host'])) {
                    unset($dbParams['host']);
                }
                if (empty($dbParams['port'])) {
                    unset($dbParams['port']);
                }                
                break;
        }
        
        return $dbParams;
    }
public static function sanitizeDbParameters ( $ dbParams ) { switch ( self :: getDbType ( ) ) { case 'mysql' : if ( empty ( $ dbParams [ 'unix_socket' ] ) ) { unset ( $ dbParams [ 'unix_socket' ] ) ; } if ( empty ( $ dbParams [ 'charset' ] ) ) { unset ( $ dbParams [ 'charset' ] ) ; } break ; case 'sqlite' : if ( empty ( $ dbParams [ 'user' ] ) ) { unset ( $ dbParams [ 'user' ] ) ; } if ( empty ( $ dbParams [ 'password' ] ) ) { unset ( $ dbParams [ 'password' ] ) ; } if ( empty ( $ dbParams [ 'host' ] ) ) { unset ( $ dbParams [ 'host' ] ) ; } if ( empty ( $ dbParams [ 'port' ] ) ) { unset ( $ dbParams [ 'port' ] ) ; } break ; } return $ dbParams ; }
Sanitize the database parameters provided

@param array $dbParams  - Database parameters for the connection

@return array
Sanitize the database parameters provided