Example #1
0
File: sacy.php Project: fjg/sacy
 private function generate_content_cache($work_units, CacheRenderHandler $rh)
 {
     $content = implode("\n", array_map(function ($u) {
         return $u['content'];
     }, $work_units));
     $key = md5($content . $this->_cfg->getDebugMode());
     if ($d = $this->fragment_cache->get($key)) {
         return $d;
     }
     $output = array();
     foreach ($work_units as $w) {
         $output[] = $rh->getOutput($w);
     }
     $output = implode("\n", $output);
     $this->fragment_cache->set($key, $output);
     return $output;
 }