Ejemplo n.º 1
0
 /**
  * Returns the instance of the StaticHtmlStorage
  * @param string $cacheKey unique cache identifier
  *
  * @return StaticHtmlStorage|null
  */
 public static function getStaticHtmlStorage($cacheKey)
 {
     $configuration = array();
     $htmlCacheOptions = \CHTMLPagesCache::getOptions();
     $storage = isset($htmlCacheOptions["STORAGE"]) ? $htmlCacheOptions["STORAGE"] : false;
     if (in_array($storage, array("memcached", "memcached_cluster"))) {
         if (extension_loaded("memcache")) {
             return new StaticHtmlMemcachedStorage($cacheKey, $configuration, $htmlCacheOptions);
         } else {
             return null;
         }
     } else {
         return new StaticHtmlFileStorage($cacheKey, $configuration, $htmlCacheOptions);
     }
 }
Ejemplo n.º 2
0
 /**
  * OnBeforeEndBufferContent handler.
  * Prepares the stage for composite mode handler.
  *
  * @return void
  */
 public function onBeforeEndBufferContent()
 {
     $params = array();
     if (self::getUseAppCache()) {
         $manifest = AppCacheManifest::getInstance();
         $params = $manifest->OnBeforeEndBufferContent();
         $params["CACHE_MODE"] = "APPCACHE";
         $params["PAGE_URL"] = Context::getCurrent()->getServer()->getRequestUri();
     } elseif (self::getUseHTMLCache()) {
         $staticHTMLCache = StaticHtmlCache::getInstance();
         $staticHTMLCache->onBeforeEndBufferContent();
         if ($staticHTMLCache->isCacheable()) {
             $params["CACHE_MODE"] = "HTMLCACHE";
             if (Option::get("main", "~show_composite_banner", "Y") == "Y") {
                 $options = \CHTMLPagesCache::getOptions();
                 $params["banner"] = array("url" => GetMessage("COMPOSITE_BANNER_URL"), "text" => GetMessage("COMPOSITE_BANNER_TEXT"), "bgcolor" => isset($options["BANNER_BGCOLOR"]) ? $options["BANNER_BGCOLOR"] : "", "style" => isset($options["BANNER_STYLE"]) ? $options["BANNER_STYLE"] : "");
             }
         } else {
             return;
         }
     }
     $params["storageBlocks"] = array();
     $dynamicAreas = FrameStatic::getDynamicAreas();
     foreach ($dynamicAreas as $id => $dynamicArea) {
         if ($dynamicArea->getBrowserStorage()) {
             $realId = $dynamicArea->getContainerId() !== null ? $dynamicArea->getContainerId() : "bxdynamic_" . $id;
             $params["storageBlocks"][] = $realId;
         }
     }
     $this->injectedJS = $this->getInjectedJs($params);
     Asset::getInstance()->addString($this->injectedJS["start"], false, AssetLocation::BEFORE_CSS, self::getUseAppCache() ? AssetMode::ALL : AssetMode::COMPOSITE);
 }
Ejemplo n.º 3
0
            ?>
</td>
		</tr>
		</table>
	</td>
</tr>
<?php 
        }
        ?>
<tr class="heading">
	<td colspan="2"><?php 
        echo GetMessage("MAIN_OPTION_HTML_CACHE_OPT");
        ?>
</td>
	<?php 
        $arHTMLCacheOptions = CHTMLPagesCache::getOptions();
        ?>
</tr>
<tr>
	<td><?php 
        echo GetMessage("MAIN_OPTION_HTML_CACHE_INC_MASK");
        ?>
:</td>
	<td>
		<input type="text" size="45" name="html_cache_include_mask" value="<?php 
        echo htmlspecialcharsbx($arHTMLCacheOptions["INCLUDE_MASK"]);
        ?>
">
	</td>
</tr>
<tr>