Ejemplo n.º 1
0
 /**
  * Empty the structure cache and the page cache
  * @return void
  */
 public function emptycacheAction()
 {
     $data = Zend_Json::decode($this->getRequest()->jsondata);
     $msg = 'error! Could not clean cache!';
     $status = 0;
     if (isset($data['mode'])) {
         $cc = new Sydney_Cache_Manager();
         if ($data['mode'] == 'page') {
             if ($cc->clearPageCache($this->safinstancesId)) {
                 $msg = 'Success ! Cache empty ! ';
                 $status = 1;
             }
         }
         if ($data['mode'] == 'all') {
             if ($cc->clearAllCache($this->safinstancesId)) {
                 $msg = 'Success ! Cache empty ! ';
                 $status = 1;
             }
         }
     }
     $this->view->ResultSet = array('message' => $msg, 'status' => $status, 'modal' => false);
 }