> i wrote this code ....
>
> index.php
>
> /*
> * caching stuff ...
> */
> $frontend = array (lifetime => 1, automatic_seralization => false );
> $backend = array ('cache_dir' => APPLICATION_PATH . '/cache/data/' );
> $cache = Zend_Cache::factory('Core','File',$frontend,$backend);
> Zend_Registry::set ( 'cache', $cache );
> //end cache
>
>
> in controller file
>
> $sina = array('1','2');
> serialize($sina);
> $this->cache->automatic_serialization = true;
> $this->cache->save($sina,'users');
>
>
> but it throws this exception
>
> Exception information:
>
> Message:Datas must be string or set automatic_serialization = true
>
> why?
$this->cache->setOption('automatic_serialization', true);
That should work.
--
Jurian Sluiman
Soflomo.com
没有评论:
发表评论