mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-25 16:18:08 +00:00
Fix setSQLLogger() depreciation
This commit is contained in:
parent
e5a8b152eb
commit
8b9d3795da
1 changed files with 7 additions and 1 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
namespace Wallabag\ImportBundle\Command;
|
namespace Wallabag\ImportBundle\Command;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Driver\Middleware;
|
||||||
|
use Doctrine\DBAL\Logging\Middleware as LoggingMiddleware;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Config\Definition\Exception\Exception;
|
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
@ -99,7 +101,11 @@ class ImportCommand extends Command
|
||||||
}
|
}
|
||||||
|
|
||||||
// Turning off doctrine default logs queries for saving memory
|
// Turning off doctrine default logs queries for saving memory
|
||||||
$this->entityManager->getConnection()->getConfiguration()->setSQLLogger(null);
|
$middlewares = $this->entityManager->getConnection()->getConfiguration()->getMiddlewares();
|
||||||
|
$middlewaresWithoutLogging = array_filter($middlewares, function (Middleware $middleware) {
|
||||||
|
return !$middleware instanceof LoggingMiddleware;
|
||||||
|
});
|
||||||
|
$this->entityManager->getConnection()->getConfiguration()->setMiddlewares($middlewaresWithoutLogging);
|
||||||
|
|
||||||
if ($input->getOption('useUserId')) {
|
if ($input->getOption('useUserId')) {
|
||||||
$entityUser = $this->userRepository->findOneById($input->getArgument('username'));
|
$entityUser = $this->userRepository->findOneById($input->getArgument('username'));
|
||||||
|
|
Loading…
Reference in a new issue