Example #1
0
  <head>
  <?php 
echo Luminous::headHtml();
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  </head>
<body>
  <?php 
if (count($_POST)) {
    $lang = $_POST['lang'];
    if ($lang === 'guess') {
        $s = microtime(true);
        $guesses = luminous::guessLanguageFull($_POST['src']);
        $e = microtime(true);
        $lang = luminous::guessLanguage($_POST['src']);
        $printable_guesses = array();
        foreach ($guesses as $g) {
            $printable_guesses[$g['language']] = $g['p'];
        }
        echo sprintf('Language guessed in %f seconds:', $e - $s);
        echo '<pre>';
        print_r($printable_guesses);
        echo '</pre>';
    }
    $t = microtime(true);
    $out = luminous::highlight($lang, $_POST['src'], false);
    $t1 = microtime(true);
    if ($e = luminous::cacheErrors()) {
        echo '<pre>';
        echo implode("<br/>", $e);