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/sproduction.datasync/lib/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/sproduction.datasync/lib/restcache.php
<?php
/**
 *    Rest Cache
 *
 * @mail support@s-production.online
 * @link s-production.online
 */

namespace SProduction\Datasync;

class RestCache
{
	const METHODS = ['batch', 'profile', 'app.info', 'catalog.catalog.list', 'crm.product.fields', 'catalog.product.getFieldsByFilter', 'catalog.product.offer.getFieldsByFilter', 'catalog.productPropertyEnum.list'];

	private static $CACHE = [];

	protected static function checkMethod($method) {
		$result = false;
		if (in_array($method, self::METHODS)) {
			$result = true;
		}
		return $result;
	}

	protected static function getId($method, $params, $only_res) {
		return $method . md5(serialize($params)) . $only_res;
	}

	public static function add($method, $params, $only_res, $value, $force_cache=false) {
		if (self::checkMethod($method) || $force_cache) {
			self::$CACHE[self::getId($method, $params, $only_res)] = $value;
		}
	}

	public static function hasValue($method, $params, $only_res) {
		$result = false;
		if (isset(self::$CACHE[self::getId($method, $params, $only_res)])) {
			$result = true;
		}
		return $result;
	}

	public static function get($method, $params, $only_res) {
		$result = false;
		if (isset(self::$CACHE[self::getId($method, $params, $only_res)]) && !is_null(self::$CACHE[self::getId($method, $params, $only_res)])) {
			$result = self::$CACHE[self::getId($method, $params, $only_res)];
		}
		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit