summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-06-13 21:27:14 +0200
committerFlorian Pritz <bluewind@xinu.at>2012-08-16 16:31:28 +0200
commit71273d9477b88cca86e6724491c1ea337ee96f05 (patch)
treeb5b0d73085775d9aacae2871a0d57faa99ea72ca /application/controllers/file.php
parent789ffb00e6d25af4409d26dce04d211e365f2d58 (diff)
switch to pygments
- faster than geshi - easier to modify the css because there is only one - geshi upstream seems pretty dead Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r--application/controllers/file.php4
1 files changed, 1 insertions, 3 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index ee983a639..3b9a8f9b4 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -167,9 +167,7 @@ class File extends CI_Controller {
// generate line numbers (links)
passthru('perl -ne \'print "<a href=\"#n$.\" class=\"no\" id=\"n$.\">$.</a>\n"\' '.escapeshellarg($file));
echo '</pre></td><td class="code">'."\n";
- $this->load->library('geshi');
- $this->geshi->initialize(array('set_language' => $mode, 'set_source' => file_get_contents($file), 'enable_classes' => 'true'));
- echo $this->geshi->parse_code();
+ passthru('pygmentize -F codetagify -O encoding=utf-8 -l '.escapeshellarg($mode).' -f html '.escapeshellarg($file));
}
$cached = ob_get_contents();
ob_end_clean();