function run(&$filter_chain, &$request, &$response)
  {
    if(!$response->is_empty() || !$this->_is_caching_enabled())
    {
      $filter_chain->next();
      return;
    }

    debug :: add_timing_point('full page cache started');

    $cache = new full_page_cache_manager();

    $cache->set_uri($request->get_uri());

    if($contents =& $cache->get())
    {
      debug :: add_timing_point('full page cache read finished');

      $response->write($contents);
      return;
    }

    $filter_chain->next();

    $cache->write($content =& $response->get_response_string());

    debug :: add_timing_point('full page cache write finished');
  }
  function perform(&$request, &$response)
  {
    parent :: perform($request, $response);

    $full_page_cache_manager = new full_page_cache_manager();
    $partial_page_cache_manager = new partial_page_cache_manager();
    $image_cache_manager = new image_cache_manager();

    $full_page_cache_size = $this->_format_size($full_page_cache_manager->get_cache_size());
    $this->view->set('full_page_cache_size', $full_page_cache_size);

    $partial_page_cache_size = $this->_format_size($partial_page_cache_manager->get_cache_size());
    $this->view->set('partial_page_cache_size', $partial_page_cache_size);

    $image_cache_size = $this->_format_size($image_cache_manager->get_cache_size());
    $this->view->set('image_cache_size', $image_cache_size);

    $template_cache_size = $this->_format_size($this->_get_template_cache_size());
    $this->view->set('template_cache_size', $template_cache_size);

    $general_cache_size = $this->_format_size($this->_get_general_cache_size());
    $this->view->set('general_cache_size', $general_cache_size);

    $ini_cache_size = $this->_format_size($this->_get_ini_cache_size());
    $this->view->set('ini_cache_size', $ini_cache_size);
  }
 function perform(&$request, &$response)
 {
     $manager = new full_page_cache_manager();
     $manager->flush();
     $request->set_status(REQUEST_STATUS_SUCCESS);
     if ($request->has_attribute('popup')) {
         $response->write(close_popup_response($request));
     }
 }
 function perform(&$response)
 {
     $response->write("Flushing full page cache...");
     $full_cache_mgr = new full_page_cache_manager();
     $full_cache_mgr->flush();
     $response->write("done\n");
     $response->write("Flushing partial page cache...");
     $partial_cache_mgr = new partial_page_cache_manager();
     $partial_cache_mgr->flush();
     $response->write("done\n");
     $response->write("Flushing images cache...");
     $image_cache_mgr = new image_cache_manager();
     $image_cache_mgr->flush();
     $response->write("done\n");
 }
 function perform(&$request, &$response)
 {
     parent::perform($request, $response);
     $full_page_cache_manager = new full_page_cache_manager();
     $partial_page_cache_manager = new partial_page_cache_manager();
     $image_cache_manager = new image_cache_manager();
     $full_page_cache_size = number_format($full_page_cache_manager->get_cache_size() / 1024) . " KB";
     $this->view->set('full_page_cache_size', $full_page_cache_size);
     $partial_page_cache_size = number_format($partial_page_cache_manager->get_cache_size() / 1024) . " KB";
     $this->view->set('partial_page_cache_size', $partial_page_cache_size);
     $image_cache_size = number_format($image_cache_manager->get_cache_size() / 1024) . " KB";
     $this->view->set('image_cache_size', $image_cache_size);
     $template_cache_size = number_format($this->_get_template_cache_size() / 1024) . " KB";
     $this->view->set('template_cache_size', $template_cache_size);
     $ini_cache_size = number_format($this->_get_ini_cache_size() / 1024) . " KB";
     $this->view->set('ini_cache_size', $ini_cache_size);
 }
 function test_write_false_no_uri()
 {
   $cache_manager = new full_page_cache_manager();
   $this->assertFalse($cache_manager->write($content = 'test'));
 }