Welcome Guest, Not a member yet? Register   Sign In
Cache driver ignoring backup adapter
#1

[eluser]Zario[/eluser]
I'm trying to use the cache driver. However, it seems to fully ignore the backup adapter.

If I use:
Code:
$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'dummy'));
Then I assume that it will use APC if available, otherwise it'll fall back to dummy cache (do nothing). This is obviously very handy since not everyone will have APC installed.

This doesn't seem to be the case - since I get an error when testing the following code:

Code:
if(!$config = $this->cache->get('config')) {
      
     //Get config from database
     $config = $this->db->from('core')->get()->row_array();
      
     //Cache it
     $this->cache->save('config', $config, 600);
    }
Quote:(`Fatal error: Call to undefined function apc_cache_info()`)

Any suggestions?
#2

[eluser]Zario[/eluser]
bump
#3

[eluser]Zario[/eluser]
Any suggestions?
#4

[eluser]Zario[/eluser]
Thoughts?
#5

[eluser]Aken[/eluser]
Hi Zarlo,

This is a valid bug in CodeIgniter. It has been brought up a couple times as issues on Github, but the solutions so far aren't finalized (or that great, in my opinion).

I'd advise you to hardcode any changes to make it work for the time being, and keep an eye on the Github repo for a committed change.
#6

[eluser]Aken[/eluser]
Here is the fix I came up with. Feel free to implement it into your app and see how it functions for you.

https://github.com/EllisLab/CodeIgniter/pull/1403




Theme © iAndrew 2016 - Forum software by © MyBB