SpiderSoft Sydney developers
software developers
  • Github
  • Facebook
  • Twitter
RSS
  • Home
  • About
  • Blog
  • Projects
    • CodeIgniter IMG – thumbnails
    • CodeIgniter minify
    • XCache driver CodeIgniter
  • Services
    • Google Apps Setup
    • vTiger CRM
    • Website maintenance
    • Custom Drupal Modules
    • Content Management Systems
  • Contact

XCache driver CodeIgniter

Here is a missing XCache driver for CodeIgniter Caching Class. All You need to do is to modify /system/libraries/Cache/Cache.php library and add additional Cache driver to drivers list:

protected $valid_drivers = array('cache_apc', 'cache_file', 'cache_memcached', 'cache_dummy', 'cache_xcache');

Then you need to upload Cache_xcache.php file, to this directory: /system/libraries/Cache/drivers/

Usage

Load cache drivers as usually:

$this->load->driver('cache', array('adapter' => 'xcache'));

and use as it

$this->cache->save('my_variable', array(0=>'data', 1=>'other data'));
print_r($this->cache->get('my_variable'));

Due to XCache limitations You can’t store objects in cache, but you can serialize them before saving :)

Download Cache_xcache.php

One Comment

  1. kropa
    Mar 31, 2012 @ 20:54:48

    thanks man!

    Reply

Leave a Reply Cancel

*

*

Recent Comments

  • Sarita Liwanag: Once I originally commented I clicked the -Notify me when ne…
  • Tarwin Stroh-Spijer: Thanks ! Saved me hours of headache. Other sites missed the …
  • Jamison Delosa: Hey there this is kinda of off topic but I was wanting to kn…
  • kropa: thanks man! …

Latest Tweets

Follow me
© SpiderSoft Sydney developers 2012
 My Google+ Profile