From 7f0065ddbd80fe32e49cede2d65d231c6ec6f183 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 15 Aug 2013 17:10:58 +0200 Subject: 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 --- application/controllers/file.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'application/controllers') 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) { -- cgit v1.2.3-24-g4f1b