Example #1
0
 function handle()
 {
     $cache = new FileCache();
     $info = $cache->get(self::CACHE_KEY);
     if (!is_array($info)) {
         $shokos = new VolatileTwitShokos();
         $info = $shokos->bestTalkInfo();
         $cache->set(self::CACHE_KEY, $info, new DateTime("+30 min"));
     }
     $this->assign('rate', $info['rate']);
     $this->assign('text', $info['text']);
     $this->assign('status', 'ok');
 }