Ejemplo n.º 1
0
 /**
  * Returns current instance of the StaticHtmlCache.
  *
  * @return StaticHtmlCache
  */
 public static function getInstance()
 {
     if (!isset(static::$instance)) {
         $cacheProvider = static::getCacheProvider();
         $privateKey = $cacheProvider !== null ? $cacheProvider->getCachePrivateKey() : null;
         static::$instance = new static(\CHTMLPagesCache::getRequestUri(), \CHTMLPagesCache::getHttpHost(), \CHTMLPagesCache::getRealPrivateKey($privateKey));
         static::$instance->enableDebug();
         if ($cacheProvider !== null) {
             static::$instance->setCacheProvider($cacheProvider);
         }
     }
     return static::$instance;
 }
Ejemplo n.º 2
0
 public static function deleteUserCache($userId = false)
 {
     global $USER;
     if ($userId === false && $USER->IsAuthorized()) {
         $userId = $USER->GetID();
     }
     $userId = intval($userId);
     if ($userId > 0) {
         $postfix = \CHTMLPagesCache::getSpaPostfix();
         $privateKey = self::getUserPrefix($userId);
         foreach ($postfix as $item) {
             $realPrivateKey = \CHTMLPagesCache::getRealPrivateKey($privateKey, $item);
             $staticCache = new StaticHtmlCache("/", null, $realPrivateKey);
             $staticCache->delete();
         }
         header("X-Bitrix-Composite-Delete:" . md5(\CHTMLPagesCache::getHttpHost() . $privateKey));
     }
 }
Ejemplo n.º 3
0
	<td class="adm-required-field"></td>
	<td><?php 
echo GetMessage("MAIN_COMPOSITE_CLUSTER_HINT", array("#A_START#" => "<a href=\"/bitrix/admin/cluster_memcache_list.php?lang=" . LANGUAGE_ID . "&group_id=" . (defined("BX_CLUSTER_GROUP") ? BX_CLUSTER_GROUP : 1) . "\">", "#A_END#" => "</a>"));
?>
</td>
</tr>

<tr class="heading">
	<td colspan="2"><?php 
echo GetMessage("MAIN_COMPOSITE_OPT");
?>
</td>
</tr>
<?php 
if (!is_array($arHTMLCacheOptions["DOMAINS"]) || count($arHTMLCacheOptions["DOMAINS"]) < 1) {
    $arHTMLCacheOptions["DOMAINS"] = array(CHTMLPagesCache::getHttpHost());
}
?>
<tr class="adm-detail-valign-top">
	<td width="40%" class="adm-required-field"><?php 
echo GetMessage("MAIN_COMPOSITE_DOMAINS");
?>
:</td>
	<td width="60%">
		<textarea name="composite_domains" rows="5" style="width:100%"><?php 
echo htmlspecialcharsEx(implode("\n", $arHTMLCacheOptions["DOMAINS"]));
?>
</textarea><br>
		<input type="checkbox" name="composite_allow_https" id="composite_allow_https" value="Y" <?php 
if ($arHTMLCacheOptions["ALLOW_HTTPS"] === "Y") {
    echo 'checked="checked"';