- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/session/handlers/redissessionhandler.php
- Класс: BitrixMainSessionHandlersRedisSessionHandler
- Вызов: RedisSessionHandler::__construct
public function __construct(array $options)
{
$this->readOnly = $options['readOnly'] ?? false; //defined('BX_SECURITY_SESSION_READONLY');
$this->prefix = $options['keyPrefix'] ?? 'BX'; //defined("BX_CACHE_SID") ? BX_CACHE_SID : "BX"
$this->exclusiveLock = $options['exclusiveLock'] ?? false; //defined('BX_SECURITY_SESSION_REDIS_EXLOCK') && BX_SECURITY_SESSION_REDIS_EXLOCK
$connectionPool = Application::getInstance()->getConnectionPool();
$connectionPool->setConnectionParameters(self::SESSION_REDIS_CONNECTION, [
'className' => RedisConnection::class,
'host' => $options['host'] ?? '127.0.0.1',
'port' => (int)($options['port'] ?? 11211),
'servers' => $options['servers'] ?? [],
'serializer' => $options['serializer'] ?? null,
'failover' => $options['failover'] ?? null,
'timeout' => $options['timeout'] ?? null,
'readTimeout' => $options['readTimeout'] ?? null,
'persistent' => $options['persistent'] ?? null,
]);
}