Example #1
0
 function store_dl_content(&$context, &$dl_config, &$dl_cache_data)
 {
     if ($this->_no_cache || $this->_live_mode) {
         return;
     }
     if ($this->_uncached) {
         return;
     }
     $dl_request_id = 'DL' . $this->generate_request_identifier($context, $dl_config);
     /**
     * See the FIXME in generate_content_identifier on why we use the content hash
             $dl_content_id = $this->generate_content_identifier($context);
     */
     $dl_content_id = 'DLC-' . md5($dl_cache_data);
     $dl_entry_data = array();
     if (!is_null($this->_expires)) {
         $dl_entry_data['expires'] = $this->_expires;
     } else {
         // Use default expiry for cache entry, most components don't bother calling expires() properly
         $dl_entry_data['expires'] = time() + $this->_default_lifetime;
     }
     $this->_meta_cache->open(true);
     $this->_data_cache->open(true);
     $this->_meta_cache->put($dl_request_id, $dl_content_id);
     $this->_meta_cache->put($dl_content_id, $dl_entry_data);
     unset($dl_entry_data);
     $this->_data_cache->put($dl_content_id, $dl_cache_data);
     // Cache where the object have been
     $this->store_context_guid_map($context, $dl_content_id, $dl_request_id);
     $this->_meta_cache->close();
     $this->_data_cache->close();
     unset($dl_cache_data, $dl_content_id, $dl_request_id);
 }