$handlerClass =
str_starts_with($connection, 'memcached:'
) ? MemcachedSessionHandler::
class D 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('Unsupported PDO OCI DSN. Try running "composer require doctrine/dbal".'
);
} $connection[3
] = '-';
$params =
class_exists(DsnParser::
class) ?
(new DsnParser())->
parse($connection) :
['url' =>
$connection];
$config =
new Configuration();
if (class_exists(DefaultSchemaManagerFactory::
class)) { $config->
setSchemaManagerFactory(new DefaultSchemaManagerFactory());
} $connection = DriverManager::
getConnection($params,
$config);
$connection =
method_exists($connection, 'getNativeConnection'
) ?
$connection->
getNativeConnection() :
$connection->
getWrappedConnection();
// no break;
case str_starts_with($connection, 'mssql://'
):
case str_starts_with($connection, 'mysql://'
):
case str_starts_with($connection, 'mysql2://'
):