Esempio n. 1
0
 function EndDataCache()
 {
     if (!$this->bStarted) {
         return;
     }
     $this->bStarted = false;
     $arAllVars = ob_get_contents();
     $this->_cache->write($arAllVars, $this->basedir, $this->initdir, $this->filename, $this->TTL);
     if (\Freetrix\Main\Data\Cache::getShowCacheStat()) {
         $written = 0;
         $path = '';
         if ($this->_cache instanceof \Freetrix\Main\Data\ICacheEngineStat) {
             $written = $this->_cache->getWrittenBytes();
             $path = $this->_cache->getCachePath();
         } elseif ($this->_cache instanceof \ICacheBackend) {
             /** @noinspection PhpUndefinedFieldInspection */
             $written = $this->_cache->written;
             /** @noinspection PhpUndefinedFieldInspection */
             $path = $this->_cache->path;
         }
         \Freetrix\Main\Diag\CacheTracker::addCacheStatBytes($written);
         \Freetrix\Main\Diag\CacheTracker::add($written, $path, $this->basedir, $this->initdir, $this->filename, "W");
     }
     if (strlen($arAllVars) > 0) {
         ob_end_flush();
     } else {
         ob_end_clean();
     }
 }
Esempio n. 2
0
?>
<script type="text/javascript">
var jsDebugTimeWindow = new BX.CDebugDialog();
</script>
<div id="FX_DEBUG_TIME" class="bx-debug-window" style="z-index:99; width:660px !important;">
<?
	$obJSPopup->StartDescription('bx-core-debug-info');
?>
	<p><?echo GetMessage("debug_info_page")?> <?php 
echo $APPLICATION->GetCurPage();
?>
</p>
	<p><?echo GetMessage("debug_info_comps_cache")?> <?if(COption::GetOptionString("main", "component_cache_on", "Y")=="Y") echo GetMessage("debug_info_comps_cache_on"); else echo "<a href=\"/freetrix/admin/cache.php\"><font class=\"errortext\">".GetMessage("debug_info_comps_cache_off")."</font></a>";?>.</p>
	<p><?
	if(\Freetrix\Main\Data\Cache::getShowCacheStat())
		echo GetMessage("debug_info_cache_size")." ",CFile::FormatSize(\Freetrix\Main\Diag\CacheTracker::getCacheStatBytes(), 0);
	else
		echo "&nbsp;";
	?></p>
<?
	$obJSPopup->StartContent(array('buffer' => true));
?>
	<div id="FX_DEBUG_TIME_1">
		<div class="bx-debug-content bx-debug-content-table">

<table cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr class="heading">
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td class="number" nowrap>
			<span><?echo GetMessage("debug_info_page_exec")?></span>
Esempio n. 3
0
 function endDataCache($vars = false)
 {
     if (!$this->isStarted) {
         return;
     }
     $this->isStarted = false;
     $arAllVars = array("CONTENT" => ob_get_contents(), "VARS" => $vars !== false ? $vars : $this->vars);
     $this->cacheEngine->write($arAllVars, $this->baseDir, $this->initDir, $this->filename, $this->TTL);
     if (static::$showCacheStat) {
         $written = 0;
         $path = '';
         if ($this->cacheEngine instanceof ICacheEngineStat) {
             $written = $this->cacheEngine->getWrittenBytes();
             $path = $this->cacheEngine->getCachePath();
         } elseif ($this->cacheEngine instanceof \ICacheBackend) {
             /** @noinspection PhpUndefinedFieldInspection */
             $written = $this->cacheEngine->written;
             /** @noinspection PhpUndefinedFieldInspection */
             $path = $this->cacheEngine->path;
         }
         Diag\CacheTracker::addCacheStatBytes($written);
         Diag\CacheTracker::add($written, $path, $this->baseDir, $this->initDir, $this->filename, "W");
     }
     if (strlen(ob_get_contents()) > 0) {
         ob_end_flush();
     } else {
         ob_end_clean();
     }
 }
Esempio n. 4
0
 function Stop($rel_path = "", $path = "", $cache_type = "")
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION;
     /** @global CDatabase $DB */
     global $DB;
     /** @global int $CACHE_STAT_BYTES */
     global $CACHE_STAT_BYTES;
     if ($this->is_comp) {
         self::$level--;
     }
     $this->arResult = array("PATH" => $path, "REL_PATH" => $rel_path, "QUERY_COUNT" => 0, "QUERY_TIME" => 0, "QUERIES" => array(), "TIME" => getmicrotime() - $this->start_time, "FX_STATE" => $GLOBALS["FX_STATE"], "CACHE_TYPE" => $cache_type, "CACHE_SIZE" => \Freetrix\Main\Data\Cache::getShowCacheStat() ? \Freetrix\Main\Diag\CacheTracker::getCacheStatBytes() : 0, "LEVEL" => self::$level);
     if ($DB->ShowSqlStat) {
         if ($DB->cntQuery) {
             $this->arResult["QUERY_COUNT"] = $DB->cntQuery;
             $this->arResult["QUERY_TIME"] = $DB->timeQuery;
             $this->arResult["QUERIES"] = $DB->arQueryDebug;
         }
         $DB->arQueryDebug = $this->arQueryDebugSave;
         $DB->cntQuery = $this->cnt_query;
         $DB->timeQuery = $this->query_time;
     }
     if (\Freetrix\Main\Data\Cache::getShowCacheStat()) {
         $this->arResult["CACHE"] = \Freetrix\Main\Diag\CacheTracker::getCacheTracking();
         \Freetrix\Main\Diag\CacheTracker::setCacheTracking($this->arCacheDebugSave);
         \Freetrix\Main\Diag\CacheTracker::setCacheStatBytes($CACHE_STAT_BYTES = $this->cache_size);
     }
 }