This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 
<?php
defined('C5_EXECUTE') or die("Access Denied.");

class Concrete5_Controller_Dashboard_System_Optimization_Cache extends DashboardBaseController {
    
    public $helpers = array('form'); 
    
    public function view(){
    }

    public function update_cache() {
        if ($this->token->validate("update_cache")) {
            if ($this->isPost()) {
                $u = new User();
                $eca = $this->post('ENABLE_BLOCK_CACHE') == 1 ? 1 : 0; 
                $eoc = $this->post('ENABLE_OVERRIDE_CACHE') == 1 ? 1 : 0; 
                Cache::flush();
                Config::save('ENABLE_BLOCK_CACHE', $eca);
                Config::save('ENABLE_OVERRIDE_CACHE', $eoc);
                Config::save('FULL_PAGE_CACHE_GLOBAL', $this->post('FULL_PAGE_CACHE_GLOBAL'));
                Config::save('FULL_PAGE_CACHE_LIFETIME', $this->post('FULL_PAGE_CACHE_LIFETIME'));
                Config::save('FULL_PAGE_CACHE_LIFETIME_CUSTOM', $this->post('FULL_PAGE_CACHE_LIFETIME_CUSTOM'));                
                $this->redirect('/dashboard/system/optimization/cache', 'cache_updated');
            }
        } else {
            $this->set('error', array($this->token->getErrorMessage()));
        }
    }
    
    public function cache_updated() {
        $this->set('message', t('Cache settings saved.'));  
        $this->view();
    }
    
    
    
    
    
}