'pdo_sqlite', 'mysql' => 'pdo_mysql']))->parse($url); $configuration = null; if (null !== $counter) { // Counting queries is a measuring instrument, not a feature: it is wired up outside // the production environment, where the browser checks read the number. $configuration = new Configuration(); $configuration->setMiddlewares([$counter]); } $connection = DriverManager::getConnection($params, $configuration); if ('pdo_sqlite' === $params['driver']) { // SQLite's built-in LOWER only handles ASCII: searching for "über" must also find // "Über uns", just as on MySQL. No database rewrite or search-specific schema needed. $connection->getNativeConnection()->sqliteCreateFunction('lower', static fn (?string $value): ?string => null === $value ? null : mb_strtolower($value, 'UTF-8'), 1, \PDO::SQLITE_DETERMINISTIC); $connection->executeStatement('PRAGMA foreign_keys = ON'); $connection->executeStatement('PRAGMA busy_timeout = 5000'); } return $connection; } }