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/lib/data/ |
Upload File : |
<?php namespace Bitrix\Main\Data; /** * Class RedisConnection * @package Bitrix\Main\Data * @property \Redis|\RedisCluster $resource * @method getResource(): \Redis|\RedisCluster */ class RedisConnection extends NosqlConnection { /** @var Configurator\RedisConnectionConfigurator */ protected $configurator; public function __construct(array $configuration) { parent::__construct($configuration); $this->configurator = new Configurator\RedisConnectionConfigurator($this->getConfiguration()); } protected function connectInternal() { $this->resource = $this->configurator->createConnection(); $this->isConnected = (bool)$this->resource; } protected function disconnectInternal() { if ($this->isConnected()) { $this->resource->close(); $this->resource = null; $this->isConnected = false; } } public function get($key) { if (!$this->isConnected()) { $this->connect(); } return $this->resource->get($key); } public function set($key, $value) { if (!$this->isConnected()) { $this->connect(); } return $this->resource->set($key, $value); } }