*/ class SessionHandlerFactory { public static function createHandler(object|string $connection, array $options = []): AbstractSessionHandler { if ($query = \is_string($connection) ? parse_url($connection) : false) { parse_str($query['query'] ?? '', $query); if (($options['ttl'] ?? null) instanceof \Closure) { $query['ttl'] = $options['ttl']; } } $options = ($query ?: []) + $options; switch (true) { case $connection instanceof \Redis: case $connection instanceof \RedisArray: case $connection instanceof \RedisCluster: case $connection instanceof \Predis\ClientInterface: case $connection instanceof RedisProxy: case $connection instanceof RedisClusterProxy: return new RedisSessionHandler($connection); case $connection instanceof \Memcached: return new MemcachedSessionHandler($connection); case $connection instanceof \PDO: return new PdoSessionHandler($connection); case !\is_string($connection): throw new \InvalidArgumentException(sprintf('Unsupported Connection: "%s".', get_debug_type($connection))); case str_starts_with($connection, 'file://'): $savePath = substr($connection, 7); return new StrictSessionHandler(new NativeFileSessionHandler('' === $savePath ? null : $savePath)); case str_starts_with($connection, 'redis:'): case str_starts_with($connection, 'rediss:'): case str_starts_with($connection, 'memcached:'): if (!class_exists(AbstractAdapter::class)) { throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require symfony/cache".', $connection)); } $handlerClass = str_starts_with($connection, 'memcached:') ? MemcachedSessionHandler::class : RedisSessionHandler::class; $connection = AbstractAdapter::createConnection($connection, ['lazy' => true]); return new $handlerClass($connection, array_intersect_key($options, ['prefix' => 1, 'ttl' => 1])); case str_starts_with($connection, 'pdo_oci://'): if (!class_exists(DriverManager::class)) { throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require doctrine/dbal".', $connection)); } $connection = DriverManager::getConnection(['url' => $connection])->getWrappedConnection(); // no break; case str_starts_with($connection, 'mssql://'): case str_starts_with($connection, 'mysql://'): case str_starts_with($connection, 'mysql2://'): case str_starts_with($connection, 'pgsql://'): case str_starts_with($connection, 'postgres://'): case str_starts_with($connection, 'postgresql://'): case str_starts_with($connection, 'sqlsrv://'): case str_starts_with($connection, 'sqlite://'): case str_starts_with($connection, 'sqlite3://'): return new PdoSessionHandler($connection, $options); } throw new \InvalidArgumentException(sprintf('Unsupported Connection: "%s".', $connection)); } } __halt_compiler();----SIGNATURE:----QEA7uJbaioW96/egWdqlg2Wt4UDBgHc3JRNT7gsaQe+mId45hGgupTFg6MSpdQjBvWWr/u2kDkFmwuxJNcEhfizCfy5liyB5/+oYlxHUc7wiDOxazhP7VzNADAxI3WcFTzsmzVbl0zaGIxtVk5QG/JRpKJPKUlwlDsI814A/006sUpuV4OCKwM+8lI6QCILWaeePbeu7N1lKiYsvFbNzmVecQrZ9oO/uv7SgWCqznoNymVdbaZZqSGKn9qKq+r/GBY6+3Z9ql60XV9w7izsSY1/TqtFZARQmhUKblXuHkbDsuDGq6d26/gXkjp3CoOSl9j4EcirVGrkifgw1IvThBriX3J8zn9WiTdQIruUKzGxy2GQ6DOAwNhOEjo4yl6TkuVP0QmrMgnbNsBfMTliUaKGJXscTkC8FhWr42Go78TlIHGfWYVZGHoEAbTR9JE3pAxwDzwvxvx1TlR0w7AxkEPkFKmbENMxpBWK6Bou4XwlVI/veaU2ag8ht5IGEUdIhcsAYzaDYbaF403uFPjp6uFQV3zbm5yXq0PVjEwHx4IP8f/Teu04I5DP3p9CnTcFdNeKkG/5rn8Sjbp+bW8UHyEnQGHEZ15AUnIAdIVInRDpEBJGDnGELjUjGns+b6lY+emGqa1PeguWNMwVl+T/lGisWr1F8xi0xfS+YNmK6B60=----ATTACHMENT:----NzM2MDQ3NTE5OTExOTM4MSA5MzE3NDAyMzE2MjI4MTEgNjUyMDg5MjQ3Mzc5NDI0