Ejemplo n.º 1
0
        if (!mkdir($cache_folder, CHMOD_VALUE)) {
            die(gettext("Static HTML Cache folder could not be created. Please try to create it manually via FTP with chmod 0777."));
        }
    }
}
if (OFFSET_PATH) {
    if (isset($_GET['action']) && $_GET['action'] == 'clear_html_cache' && zp_loggedin(ADMIN_RIGHTS)) {
        XSRFdefender('ClearHTMLCache');
        $_zp_HTML_cache = new staticCache();
        $_zp_HTML_cache->clearHTMLCache();
        header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/admin.php?action=external&msg=' . gettext('HTML cache cleared.'));
        exit;
    }
} else {
    //	if the page is cached then handle it early
    $_zp_HTML_cache = new staticCache();
    $_zp_HTML_cache->startHTMLCache();
}
/**
 * Plugin option handling class
 *
 */
class staticCache_options
{
    function staticCache_options()
    {
        setOptionDefault('static_cache_expire', 86400);
        setOptionDefault('static_cache_excludedpages', 'search.php/,contact.php/,register.php/');
    }
    function getOptionsSupported()
    {
Ejemplo n.º 2
0
        showWorkTime("matches executed");
    } catch (Exception $e) {
        // Disabled exception
        //traceException($e);
        showWorkTime("exception catched");
    }
    unset($matches);
}
$cmsController = cmsController::getInstance();
showWorkTime("cmsController init");
$cmsController->analyzePath();
showWorkTime("path analyzed");
// static cache
if ($config->get('cache', 'static.enabled') && $cmsController->getCurrentElementId()) {
    require_once CURRENT_WORKING_DIR . '/libs/cacheControl.php';
    $staticCache = new staticCache();
    $staticCache->load();
} else {
    $staticCache = null;
}
showWorkTime("cacheControl started");
$currentModule = $cmsController->getCurrentModule();
showWorkTime("cmsController getCurMod");
$currentMethod = $cmsController->getCurrentMethod();
$currentTemplater = $cmsController->getCurrentTemplater();
showWorkTime("templater init");
if (getRequest("xmlMode") == 'force') {
    // flush XML
    $dom = new DOMDocument('1.0', 'utf-8');
    $rootNode = $dom->createElement("result");
    $dom->appendChild($rootNode);
Ejemplo n.º 3
0
 protected function forceCacheCleanup()
 {
     if (sizeof($this->updatedElements)) {
         $va10311459433adf322f2590a4987c423 = (bool) mainConfiguration::getInstance()->get('cache', 'static.enabled');
         if ($va10311459433adf322f2590a4987c423) {
             require_once CURRENT_WORKING_DIR . '/libs/cacheControl.php';
             $v805e6b8e623f5dd06f99f55e55230cca = new staticCache();
             $v805e6b8e623f5dd06f99f55e55230cca->cleanup();
         }
         if (function_exists("deleteElementsRelatedPages")) {
             deleteElementsRelatedPages();
         }
     }
 }