PygmentsElephant/PygmentizeBinary.php
public function guessLexer($filename)
    {
        $cmd = sprintf('%s -N %s', $this->binaryPath, $filename);
        $p = new Process($cmd);
        $p->run();
        $output = trim($p->getOutput());
        if ('text' === $output) {
            $output = $this->guessFromExtension($filename);
        }
        if ('text' === $output) {
            $output = $this->guessFromContent($filename);
        }

        return $output;
    }
public function guessLexer($filename)
    {
        $cmd = sprintf('%s -N %s', $this->binaryPath, $filename);
        $p = new Process($cmd);
        $p->run();
        $output = trim($p->getOutput());
        if ('text' === $output) {
            $output = $this->guessFromExtension($filename);
        }
        if ('text' === $output) {
            $output = $this->guessFromContent($filename);
        }

        return $output;
    }
public function guessLexer ( $ filename ) { $ cmd = sprintf ( '%s -N %s' , $ this -> binaryPath , $ filename ) ; $ p = new Process ( $ cmd ) ; $ p -> run ( ) ; $ output = trim ( $ p -> getOutput ( ) ) ; if ( 'text' === $ output ) { $ output = $ this -> guessFromExtension ( $ filename ) ; } if ( 'text' === $ output ) { $ output = $ this -> guessFromContent ( $ filename ) ; } return $ output ; }
guess the lexer from the filename

@param string $filename file name

@return string
guess the lexer from the filename