summaryrefslogtreecommitdiffstats
path: root/application/models/mfile.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/models/mfile.php')
-rw-r--r--application/models/mfile.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/application/models/mfile.php b/application/models/mfile.php
index e70b5c812..d7e301b1e 100644
--- a/application/models/mfile.php
+++ b/application/models/mfile.php
@@ -339,8 +339,7 @@ class Mfile extends CI_Model {
}
public function get_lexers() {
- $this->load->driver('cache', array('adapter' => $this->config->item("cache_backend")));
- if (! $lexers = $this->cache->get('lexers')) {
+ return cache_function('lexers', 1800, function() {
$lexers = array();
$last_desc = "";
exec("python ".escapeshellarg(FCPATH."scripts/get_lexer_list.py"), $output);
@@ -354,10 +353,8 @@ class Mfile extends CI_Model {
$lexers[$name] = $desc;
}
$lexers["text"] = "Plain text";
- $this->cache->save('lexers', $lexers, 1800);
- }
-
- return $lexers;
+ return $lexers;
+ });
}
public function should_highlight($type)