protected static function getSnippetFromFile($file, $line)
    {
        $defaultSnippet = '<code><strong>Snippet not available</strong></code>';
        if (file_exists($file)) {
            $start = $line;
            if ($start > 21) {
                $start = $line - 20;
            }
            $end = $start + 40;
            $highlight = highlight_file($file, true);
            if (!$highlight) {
                return $defaultSnippet;
            }
            $highlight = str_replace(array('<code>', '</code>'), array('',''), $highlight);
            $pieces = explode('<br />', $highlight);
            if (!$pieces) {
                return $defaultSnippet;
            }
            $i = 0;
            $str = '<h4><strong>File Preview: </strong>' . $file . '</h4>';
            $str .= '<div class="file-preview">';
            $str .= '<table><tr><td valign="top" class="cell-left width50">';
            for ($l=0;$l<count($pieces)+1;$l++){
                $str .= '' . ($l + 1) . '<br />';
            }
            $str .= '</td><td valign="top" class="cell-right code-case">';
            foreach ($pieces as $piece) {
                $i++;
                if ($i == $line) {
                    $str .= '<div class="highlight">' . $piece . '</div>';
                } else {
                    $str .= $piece;
                }
                $str .= '<br />';
            }
            $str .= '</td></tr></table>';
            $str .= '</div>';
            return $str;
        }

        return $defaultSnippet;
    }