Welcome Guest, Not a member yet? Register   Sign In
How to use integrated Cache class in router.php?
#2

The router is loaded before the get_instance() function is defined, so you wouldn't be able to load the memcached driver for the cache library, even if you could load the library itself. You could build your own class to abstract the cache methods needed for your routing, though.

As for autoloading the Cache library with the correct drivers, create a file: /application/config/cache.php with the following:
PHP Code:
$config['adapter'] = 'memcached';
$config['backup'] = 'dummy'// or whatever backup driver you want
$config['key_prefix'] = ''// or whatever key_prefix you want 

Then make sure the settings in /application/config/memcached.php are correct.
Reply


Messages In This Thread
RE: How to use integrated Cache class in router.php? - by mwhitney - 08-31-2015, 10:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB