diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-08-15 17:10:58 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-08-15 17:12:21 +0200 |
commit | 7f0065ddbd80fe32e49cede2d65d231c6ec6f183 (patch) | |
tree | 3291f894b163cd75729c15d08be82e9d6d7c4258 /application/controllers/file.php | |
parent | 92c84158677f30edb8872754d92832a35420952d (diff) |
Switch to CI's caching class
This supports more caching backends and doesn't force users to install
the memcache extension.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r-- | application/controllers/file.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php index 2d6a8ecc4..55ed10fea 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -155,8 +155,8 @@ class File extends CI_Controller { $this->data['filedata'] = $filedata; // highlight the file and chache the result - $this->load->library("MemcacheLibrary"); - if (! $cached = $this->memcachelibrary->get($filedata['hash'].'_'.$lexer)) { + $this->load->driver('cache', array('adapter' => $this->config->item("cache_backend"))); + if (! $cached = $this->cache->get($filedata['hash'].'_'.$lexer)) { $cached = array(); if ($lexer == "rmd") { ob_start(); @@ -175,7 +175,7 @@ class File extends CI_Controller { $ret = $this->_colorify($file, "text"); $cached["output"] = $ret["output"]; } - $this->memcachelibrary->set($filedata['hash'].'_'.$lexer, $cached, 100); + $this->cache->save($filedata['hash'].'_'.$lexer, $cached, 100); } if ($cached["return_value"] != 0) { |