From b82315dfebf9a77d8b5114afcab0cad27c3f40ac Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 14 Aug 2010 16:48:19 +0200 Subject: switch to pygments for highlighting Signed-off-by: Florian Pritz --- system/application/models/file_mod.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'system/application') diff --git a/system/application/models/file_mod.php b/system/application/models/file_mod.php index 5678bd3d1..8c197546c 100644 --- a/system/application/models/file_mod.php +++ b/system/application/models/file_mod.php @@ -190,7 +190,15 @@ class File_mod extends Model { // count(file($file)); isn't passthru('/usr/bin/perl -ne \'print "$.\n"\' '.escapeshellarg($file)); echo '
'."\n";
-            echo shell_exec(FCPATH.'scripts/syntax-highlighting.sh '.escapeshellarg($filedata['filename']).'.'.escapeshellarg($mode).' < '.escapeshellarg($file));
+            if ($mode == 'txt') {
+              $fp = fopen($file,"r");
+              while (!feof($fp)) {
+                echo fread($fp,4096);
+              }
+              fclose($fp);
+            } else {
+              passthru('/usr/bin/pygmentize -l '.$mode.' -f html '.escapeshellarg($file));
+            }
             echo '
'; } echo $this->load->view('file/html_footer', $data, true); -- cgit v1.2.3-24-g4f1b