[eluser]Mohammad Rashidi[/eluser]
hi everybody. i have problem using memcached on my WampServer.
apache module is loaded, php extension is active.
these are my codes:
Quote:$this->load->driver('cache');
$this->cache->memcached->save('var_name', 'var_value', 60);
echo $this->cache->memcached->get('var_name');
and this is the result:
Fatal error: Call to a member function add() on a non-object in system\libraries\Cache\drivers\Cache_memcached.php on line 67
but in another hand, i am using this new code, and all caches are going to '/cache/' folder.
i want to use memcached. is this a correct way?
Code:
$this->load->driver('cache', array('adapter' => 'memcached', 'backup' => 'file'));
$this->cache->memcached->is_supported();
if ( ! $foo = $this->cache->get('foo'))
{
echo 'Saving to the cache!<br />';
$foo = 'foobarbaz!';
// Save into the cache for 5 minutes
$this->cache->save('foo', $foo, 300);
}
echo $foo;
it works fine, but pay attention to this:
Quote:'backup' => 'file'
regards.