403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/classes/general/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/classes/general/cache_manager.php
<?php

/**
 * Bitrix Framework
 * @package bitrix
 * @subpackage main
 * @copyright 2001-2023 Bitrix
 */


// The main purpose of the class is:
// one read - many uses - optional one write
// of the set of variables
class CCacheManager
{
	/** @var Bitrix\Main\Data\ManagedCache */
	private $managedCache;

	/** @var Bitrix\Main\Data\TaggedCache */
	private $taggedCache;

	public function __construct()
	{
		$app = \Bitrix\Main\Application::getInstance();
		$this->managedCache = $app->getManagedCache();
		$this->taggedCache = $app->getTaggedCache();
	}

	// Tries to read cached variable value from the file
	// Returns true on success
	// otherwise returns false
	public function Read($ttl, $uniqid, $table_id=false)
	{
		return $this->managedCache->read($ttl, $uniqid, $table_id);
	}

	public function GetImmediate($ttl, $uniqid, $table_id=false)
	{
		return $this->managedCache->getImmediate($ttl, $uniqid, $table_id);
	}

	// This method is used to read the variable value
	// from the cache after successful Read
	public function Get($uniqid)
	{
		return $this->managedCache->get($uniqid);
	}

	// Sets new value to the variable
	public function Set($uniqid, $val)
	{
		$this->managedCache->set($uniqid, $val);
	}

	public function SetImmediate($uniqid, $val)
	{
		$this->managedCache->setImmediate($uniqid, $val);
	}

	// Marks cache entry as invalid
	public function Clean($uniqid, $table_id=false)
	{
		$this->managedCache->clean($uniqid, $table_id);
	}

	// Marks cache entries associated with the table as invalid
	public function CleanDir($table_id)
	{
		$this->managedCache->cleanDir($table_id);
	}

	// Clears all managed_cache
	public function CleanAll()
	{
		$this->managedCache->cleanAll();
	}

	// Use it to flush cache to the files.
	// Caution: only at the end of all operations!
	public function _Finalize()
	{
		\Bitrix\Main\Data\ManagedCache::finalize();
	}

	function GetCompCachePath($relativePath)
	{
		return $this->managedCache->getCompCachePath($relativePath);
	}

	/*Components managed(tagged) cache*/

	function StartTagCache($relativePath)
	{
		if(defined("BX_COMP_MANAGED_CACHE"))
		{
			$this->taggedCache->startTagCache($relativePath);
		}
	}

	function EndTagCache()
	{
		if(defined("BX_COMP_MANAGED_CACHE"))
		{
			$this->taggedCache->endTagCache();
		}
	}

	function AbortTagCache()
	{
		if(defined("BX_COMP_MANAGED_CACHE"))
		{
			$this->taggedCache->abortTagCache();
		}
	}

	function RegisterTag($tag)
	{
		if(defined("BX_COMP_MANAGED_CACHE"))
		{
			$this->taggedCache->registerTag($tag);
		}
	}

	function ClearByTag($tag)
	{
		if(defined("BX_COMP_MANAGED_CACHE"))
		{
			$this->taggedCache->clearByTag($tag);
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit