summaryrefslogtreecommitdiffstats
path: root/system/application/models/file_mod.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-08-14 16:48:19 +0200
committerFlorian Pritz <bluewind@xssn.at>2010-08-14 17:20:34 +0200
commitb82315dfebf9a77d8b5114afcab0cad27c3f40ac (patch)
tree83d704aaba7bbde5b85f749df96a38c10fa0076d /system/application/models/file_mod.php
parent2f8e0832796ad9e7f64e9b4e6dbe40f995b3a76d (diff)
switch to pygments for highlighting
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'system/application/models/file_mod.php')
-rw-r--r--system/application/models/file_mod.php10
1 files changed, 9 insertions, 1 deletions
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 "<a href=\"#n$.\" class=\"no\" id=\"n$.\" name=\"n$.\">$.</a>\n"\' '.escapeshellarg($file));
echo '</pre></td><td class="code"><pre>'."\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 '</pre>';
}
echo $this->load->view('file/html_footer', $data, true);