nextcloud/lib/private/DB/Logging/Middleware.php
Joas Schilling de5a7c3c73
fix(db)!: Reimplement the query logger with a doctrine middleware
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:47 +02:00

28 lines
635 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2024 Doctrine Project
* SPDX-License-Identifier: MIT
*/
namespace OC\DB\Logging;
use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\Middleware as MiddlewareInterface;
use OCP\Diagnostics\IQueryLogger;
final class Middleware implements MiddlewareInterface {
public function __construct(
private readonly IQueryLogger $queryLogger,
) {
}
public function wrap(DriverInterface $driver): DriverInterface {
return new Driver(
$driver,
$this->queryLogger,
);
}
}