• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/session/sessionconfigurationresolver.php
  • Класс: BitrixMainSessionSessionConfigurationResolver
  • Вызов: SessionConfigurationResolver::buildSessionHandlerByOptions
private function buildSessionHandlerByOptions(string $type, array $options = []): ?AbstractSessionHandler
{
	switch ($type)
	{
		case self::TYPE_FILE:
			return new StrictSessionHandler(new HandlersNativeFileSessionHandler($options));
		case self::TYPE_DATABASE:
			return new HandlersDatabaseSessionHandler($options);
		case self::TYPE_REDIS:
			return new HandlersRedisSessionHandler($options);
		case self::TYPE_MEMCACHE:
			return new HandlersMemcacheSessionHandler($options);
		case self::TYPE_ARRAY:
		case self::TYPE_NULL:
			return new HandlersNullSessionHandler();
		case self::TYPE_CUSTOM_INI:
			return null;
	}

	throw new NotSupportedException("Unknown session handler {{$type}}");
}