Example #1
0
 /**
  * @param $key
  * @param $var
  * @param int $lifetime
  *
  * @return bool
  */
 public function set($key, &$var, $lifetime = 0)
 {
     // $options is not used due to security reasons
     return $this->cacheManager->set($key, $var, $lifetime);
 }
Example #2
0
 /**
  * Executed after the response is sent and execution is completed.
  *
  * @access protected
  */
 public function _postProcess()
 {
     if ($this->resourceGenerated && $this->getOption('cache_resource', null, true)) {
         if (is_object($this->resource) && $this->resource instanceof modResource && $this->resource->get('id') && $this->resource->get('cacheable')) {
             $this->resource->_contextKey = $this->context->get('key');
             $this->invokeEvent('OnBeforeSaveWebPageCache');
             $this->cacheManager->generateResource($this->resource);
         }
     }
     $this->invokeEvent('OnWebPageComplete');
 }
 public function refresh(array $providers = array(), array &$results = array())
 {
     if ($this->modx->getOption('admintools_clear_only_resource_cache', null, false) && !empty($this->modx->_clearResourceCache)) {
         $this->modx->_clearResourceCache = false;
         unset($providers['resource']);
         $this->modx->cacheManager = null;
         $this->modx->getCacheManager();
     }
     return parent::refresh($providers, $results);
 }