PygmentsElephant/PygmentizeBinary.php
private function guessFromContent($filename)
    {
        $output = 'text';
        if (!is_file($filename)) {
            return $output;
        }
        if ($fileContents = file_get_contents($filename)) {
            if (1 === preg_match('/<?xml.*?>/', $fileContents)) {
                $output = 'xml';
            }
        }

        return $output;
    }
private function guessFromContent($filename)
    {
        $output = 'text';
        if (!is_file($filename)) {
            return $output;
        }
        if ($fileContents = file_get_contents($filename)) {
            if (1 === preg_match('/<?xml.*?>/', $fileContents)) {
                $output = 'xml';
            }
        }

        return $output;
    }
private function guessFromContent ( $ filename ) { $ output = 'text' ; if ( ! is_file ( $ filename ) ) { return $ output ; } if ( $ fileContents = file_get_contents ( $ filename ) ) { if ( 1 === preg_match ( '/<?xml.*?>/' , $ fileContents ) ) { $ output = 'xml' ; } } return $ output ; }
try to guess lexer from the file content, by searching some text

@param string $filename file name

@return string
try to guess lexer from the file content by searching some text