public static function sql($query, $sqlName = 'SQL Query', $nl2br = false)
    {
        // Joomla hack
        if (defined('_JEXEC')) {
            $config = new JConfig();
            $prefix = $config->dbprefix;
            $query  = str_replace('#__', $prefix, $query);
        }

        if (class_exists('JBDump_SqlFormatter')) {
            $sqlHtml = JBDump_SqlFormatter::format($query);
            return self::i()->dump($sqlHtml, $sqlName . '::html');
        }

        return self::i()->dump($query, $sqlName . '::html');
    }