Doctrine \ DBAL \ Exception \ DriverException
An exception occurred in driver: Too many connections
Previous exceptions
  • Too many connections (0)
Doctrine\DBAL\Exception\DriverException thrown with message "An exception occurred in driver: Too many connections" Stacktrace: #38 Doctrine\DBAL\Exception\DriverException in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:128 #37 Doctrine\DBAL\Driver\AbstractMySQLDriver:convertException in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:182 #36 Doctrine\DBAL\DBALException:wrapException in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:169 #35 Doctrine\DBAL\DBALException:driverException in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php:19 #34 Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionFailed in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Exception/ConnectionFailed.php:26 #33 Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionFailed:new in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php:89 #32 Doctrine\DBAL\Driver\Mysqli\MysqliConnection:__construct in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php:17 #31 Doctrine\DBAL\Driver\Mysqli\Driver:connect in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:412 #30 Doctrine\DBAL\Connection:connect in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Database/Connection.php:101 #29 TYPO3\CMS\Core\Database\Connection:connect in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:475 #28 Doctrine\DBAL\Connection:getDatabasePlatformVersion in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:437 #27 Doctrine\DBAL\Connection:detectDatabasePlatform in /html/ffrey.de/releases/20240221160415/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:379 #26 Doctrine\DBAL\Connection:getDatabasePlatform in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Database/ConnectionPool.php:199 #25 TYPO3\CMS\Core\Database\ConnectionPool:getDatabaseConnection in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Database/ConnectionPool.php:149 #24 TYPO3\CMS\Core\Database\ConnectionPool:getConnectionByName in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Database/ConnectionPool.php:103 #23 TYPO3\CMS\Core\Database\ConnectionPool:getConnectionForTable in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Database/ConnectionPool.php:241 #22 TYPO3\CMS\Core\Database\ConnectionPool:getQueryBuilderForTable in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php:1383 #21 TYPO3\CMS\Core\Authentication\AbstractUserAuthentication:getAuthInfoArray in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php:573 #20 TYPO3\CMS\Core\Authentication\AbstractUserAuthentication:checkAuthentication in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php:373 #19 TYPO3\CMS\Core\Authentication\AbstractUserAuthentication:start in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/frontend/Classes/Middleware/FrontendUserAuthenticator.php:70 #18 TYPO3\CMS\Frontend\Middleware\FrontendUserAuthenticator:process in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:172 #17 class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php:66 #16 TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator:process in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:172 #15 class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/frontend/Classes/Middleware/MaintenanceMode.php:55 #14 TYPO3\CMS\Frontend\Middleware\MaintenanceMode:process in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:172 #13 class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/frontend/Classes/Middleware/SiteResolver.php:65 #12 TYPO3\CMS\Frontend\Middleware\SiteResolver:process in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:172 #11 class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/frontend/Classes/Middleware/EidHandler.php:64 #10 TYPO3\CMS\Frontend\Middleware\EidHandler:process in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:172 #9 class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Middleware/NormalizedParamsAttribute.php:45 #8 TYPO3\CMS\Core\Middleware\NormalizedParamsAttribute:process in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:172 #7 class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/frontend/Classes/Middleware/TimeTrackerInitialization.php:58 #6 TYPO3\CMS\Frontend\Middleware\TimeTrackerInitialization:process in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:172 #5 class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:78 #4 TYPO3\CMS\Core\Http\MiddlewareDispatcher:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/AbstractApplication.php:85 #3 TYPO3\CMS\Core\Http\AbstractApplication:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/frontend/Classes/Http/Application.php:69 #2 TYPO3\CMS\Frontend\Http\Application:handle in /html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/AbstractApplication.php:97 #1 TYPO3\CMS\Core\Http\AbstractApplication:run in /html/ffrey.de/releases/20240221160415/public/index.php:26 #0 {closure} in /html/ffrey.de/releases/20240221160415/public/index.php:27
Stack frames (39)
38
Doctrine\DBAL\Exception\DriverException
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php128
37
Doctrine\DBAL\Driver\AbstractMySQLDriver convertException
/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php182
36
Doctrine\DBAL\DBALException wrapException
/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php169
35
Doctrine\DBAL\DBALException driverException
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php19
34
Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionFailed
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Exception/ConnectionFailed.php26
33
Doctrine\DBAL\Driver\Mysqli\Exception\ConnectionFailed new
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php89
32
Doctrine\DBAL\Driver\Mysqli\MysqliConnection __construct
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Driver.php17
31
Doctrine\DBAL\Driver\Mysqli\Driver connect
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php412
30
Doctrine\DBAL\Connection connect
/private/typo3/sysext/core/Classes/Database/Connection.php101
29
TYPO3\CMS\Core\Database\Connection connect
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php475
28
Doctrine\DBAL\Connection getDatabasePlatformVersion
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php437
27
Doctrine\DBAL\Connection detectDatabasePlatform
/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php379
26
Doctrine\DBAL\Connection getDatabasePlatform
/private/typo3/sysext/core/Classes/Database/ConnectionPool.php199
25
TYPO3\CMS\Core\Database\ConnectionPool getDatabaseConnection
/private/typo3/sysext/core/Classes/Database/ConnectionPool.php149
24
TYPO3\CMS\Core\Database\ConnectionPool getConnectionByName
/private/typo3/sysext/core/Classes/Database/ConnectionPool.php103
23
TYPO3\CMS\Core\Database\ConnectionPool getConnectionForTable
/private/typo3/sysext/core/Classes/Database/ConnectionPool.php241
22
TYPO3\CMS\Core\Database\ConnectionPool getQueryBuilderForTable
/private/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php1383
21
TYPO3\CMS\Core\Authentication\AbstractUserAuthentication getAuthInfoArray
/private/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php573
20
TYPO3\CMS\Core\Authentication\AbstractUserAuthentication checkAuthentication
/private/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php373
19
TYPO3\CMS\Core\Authentication\AbstractUserAuthentication start
/private/typo3/sysext/frontend/Classes/Middleware/FrontendUserAuthenticator.php70
18
TYPO3\CMS\Frontend\Middleware\FrontendUserAuthenticator process
/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php172
17
class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5 handle
/private/typo3/sysext/frontend/Classes/Middleware/BackendUserAuthenticator.php66
16
TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator process
/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php172
15
class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5 handle
/private/typo3/sysext/frontend/Classes/Middleware/MaintenanceMode.php55
14
TYPO3\CMS\Frontend\Middleware\MaintenanceMode process
/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php172
13
class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5 handle
/private/typo3/sysext/frontend/Classes/Middleware/SiteResolver.php65
12
TYPO3\CMS\Frontend\Middleware\SiteResolver process
/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php172
11
class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5 handle
/private/typo3/sysext/frontend/Classes/Middleware/EidHandler.php64
10
TYPO3\CMS\Frontend\Middleware\EidHandler process
/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php172
9
class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5 handle
/private/typo3/sysext/core/Classes/Middleware/NormalizedParamsAttribute.php45
8
TYPO3\CMS\Core\Middleware\NormalizedParamsAttribute process
/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php172
7
class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5 handle
/private/typo3/sysext/frontend/Classes/Middleware/TimeTrackerInitialization.php58
6
TYPO3\CMS\Frontend\Middleware\TimeTrackerInitialization process
/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php172
5
class@anonymous/html/ffrey.de/releases/20240221160415/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138$3d5 handle
/private/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php78
4
TYPO3\CMS\Core\Http\MiddlewareDispatcher handle
/private/typo3/sysext/core/Classes/Http/AbstractApplication.php85
3
TYPO3\CMS\Core\Http\AbstractApplication handle
/private/typo3/sysext/frontend/Classes/Http/Application.php69
2
TYPO3\CMS\Frontend\Http\Application handle
/private/typo3/sysext/core/Classes/Http/AbstractApplication.php97
1
TYPO3\CMS\Core\Http\AbstractApplication run
/public/index.php26
0
{closure}
/public/index.php27
            case '1429':
            case '2002':
            case '2005':
                return new ConnectionException($message, $exception);
 
            case '2006':
                return new ConnectionLost($message, $exception);
 
            case '1048':
            case '1121':
            case '1138':
            case '1171':
            case '1252':
            case '1263':
            case '1364':
            case '1566':
                return new NotNullConstraintViolationException($message, $exception);
        }
 
        return new DriverException($message, $exception);
    }
 
    /**
     * {@inheritdoc}
     *
     * @throws Exception
     */
    public function createDatabasePlatformForVersion($version)
    {
        $mariadb = stripos($version, 'mariadb') !== false;
        if ($mariadb && version_compare($this->getMariaDbMysqlVersionNumber($version), '10.2.7', '>=')) {
            return new MariaDb1027Platform();
        }
 
        if (! $mariadb) {
            $oracleMysqlVersion = $this->getOracleMysqlVersionNumber($version);
            if (version_compare($oracleMysqlVersion, '8', '>=')) {
                return new MySQL80Platform();
            }
 
     * @deprecated
     *
     * @return Exception
     */
    public static function driverException(Driver $driver, Throwable $driverEx)
    {
        return self::wrapException($driver, $driverEx, 'An exception occurred in driver: ' . $driverEx->getMessage());
    }
 
    /**
     * @return Exception
     */
    private static function wrapException(Driver $driver, Throwable $driverEx, string $msg)
    {
        if ($driverEx instanceof DriverException) {
            return $driverEx;
        }
 
        if ($driver instanceof ExceptionConverterDriver && $driverEx instanceof DeprecatedDriverException) {
            return $driver->convertException($msg, $driverEx);
        }
 
        return new Exception($msg, 0, $driverEx);
    }
 
    /**
     * Returns a human-readable representation of an array of parameters.
     * This properly handles binary data by returning a hex representation.
     *
     * @param mixed[] $params
     *
     * @return string
     */
    private static function formatParameters(array $params)
    {
        return '[' . implode(', ', array_map(static function ($param) {
            if (is_resource($param)) {
                return (string) $param;
            }
 
    public static function driverExceptionDuringQuery(Driver $driver, Throwable $driverEx, $sql, array $params = [])
    {
        $msg = "An exception occurred while executing '" . $sql . "'";
        if ($params) {
            $msg .= ' with params ' . self::formatParameters($params);
        }
 
        $msg .= ":\n\n" . $driverEx->getMessage();
 
        return self::wrapException($driver, $driverEx, $msg);
    }
 
    /**
     * @deprecated
     *
     * @return Exception
     */
    public static function driverException(Driver $driver, Throwable $driverEx)
    {
        return self::wrapException($driver, $driverEx, 'An exception occurred in driver: ' . $driverEx->getMessage());
    }
 
    /**
     * @return Exception
     */
    private static function wrapException(Driver $driver, Throwable $driverEx, string $msg)
    {
        if ($driverEx instanceof DriverException) {
            return $driverEx;
        }
 
        if ($driver instanceof ExceptionConverterDriver && $driverEx instanceof DeprecatedDriverException) {
            return $driver->convertException($msg, $driverEx);
        }
 
        return new Exception($msg, 0, $driverEx);
    }
 
    /**
     * Returns a human-readable representation of an array of parameters.
<?php
 
namespace Doctrine\DBAL\Driver\Mysqli;
 
use Doctrine\DBAL\Driver\AbstractMySQLDriver;
use Doctrine\DBAL\Exception;
use Doctrine\Deprecations\Deprecation;
 
class Driver extends AbstractMySQLDriver
{
    /**
     * {@inheritdoc}
     */
    public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
    {
        try {
            return new Connection($params, (string) $username, (string) $password, $driverOptions);
        } catch (MysqliException $e) {
            throw Exception::driverException($this, $e);
        }
    }
 
    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        Deprecation::trigger(
            'doctrine/dbal',
            'https://github.com/doctrine/dbal/issues/3580',
            'Driver::getName() is deprecated'
        );
 
        return 'mysqli';
    }
}
 
use Doctrine\DBAL\Driver\Mysqli\MysqliException;
use mysqli;
use mysqli_sql_exception;
use ReflectionProperty;
 
use function assert;
 
/**
 * @internal
 *
 * @psalm-immutable
 */
final class ConnectionFailed extends MysqliException
{
    public static function new(mysqli $connection): self
    {
        $error = $connection->connect_error;
        assert($error !== null);
 
        return new self($error, 'HY000', $connection->connect_errno);
    }
 
    public static function upcast(mysqli_sql_exception $exception): self
    {
        $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate');
        $p->setAccessible(true);
 
        return new self($exception->getMessage(), $p->getValue($exception), $exception->getCode(), $exception);
    }
}
 
Exception message: Too many connections
 
        $flags = $driverOptions[static::OPTION_FLAGS] ?? 0;
 
        $conn = mysqli_init();
        assert($conn !== false);
 
        $this->conn = $conn;
 
        $this->setSecureConnection($params);
        $this->setDriverOptions($driverOptions);
 
        try {
            $success = @$this->conn
                ->real_connect($params['host'], $username, $password, $dbname, $port, $socket, $flags);
        } catch (mysqli_sql_exception $e) {
            throw ConnectionFailed::upcast($e);
        }
 
        if (! $success) {
            throw ConnectionFailed::new($this->conn);
        }
 
        if (! isset($params['charset'])) {
            return;
        }
 
        $this->conn->set_charset($params['charset']);
    }
 
    /**
     * Retrieves mysqli native resource handle.
     *
     * Could be used if part of your application is not using DBAL.
     *
     * @return mysqli
     */
    public function getWrappedResourceHandle()
    {
        return $this->conn;
    }
<?php
 
namespace Doctrine\DBAL\Driver\Mysqli;
 
use Doctrine\DBAL\Driver\AbstractMySQLDriver;
use Doctrine\DBAL\Exception;
use Doctrine\Deprecations\Deprecation;
 
class Driver extends AbstractMySQLDriver
{
    /**
     * {@inheritdoc}
     */
    public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
    {
        try {
            return new Connection($params, (string) $username, (string) $password, $driverOptions);
        } catch (MysqliException $e) {
            throw Exception::driverException($this, $e);
        }
    }
 
    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        Deprecation::trigger(
            'doctrine/dbal',
            'https://github.com/doctrine/dbal/issues/3580',
            'Driver::getName() is deprecated'
        );
 
        return 'mysqli';
    }
}
 
        return $this->_expr;
    }
 
    /**
     * Establishes the connection with the database.
     *
     * @return bool TRUE if the connection was successfully established, FALSE if
     *              the connection is already open.
     */
    public function connect()
    {
        if ($this->_conn !== null) {
            return false;
        }
 
        $driverOptions = $this->params['driverOptions'] ?? [];
        $user          = $this->params['user'] ?? null;
        $password      = $this->params['password'] ?? null;
 
        $this->_conn = $this->_driver->connect($this->params, $user, $password, $driverOptions);
 
        $this->transactionNestingLevel = 0;
 
        if ($this->autoCommit === false) {
            $this->beginTransaction();
        }
 
        if ($this->_eventManager->hasListeners(Events::postConnect)) {
            $eventArgs = new Event\ConnectionEventArgs($this);
            $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs);
        }
 
        return true;
    }
 
    /**
     * Detects and sets the database platform.
     *
     * Evaluates custom platform class and version in order to set the correct platform.
     *
     * @param Configuration|null $config The configuration, optional.
     * @param EventManager|null $em The event manager, optional.
     *
     * @throws \Doctrine\DBAL\DBALException
     */
    public function __construct(array $params, Driver $driver, Configuration $config = null, EventManager $em = null)
    {
        parent::__construct($params, $driver, $config, $em);
        $this->_expr = GeneralUtility::makeInstance(ExpressionBuilder::class, $this);
    }
 
    /**
     * Gets the DatabasePlatform for the connection and initializes custom types and event listeners.
     *
     * @return bool
     */
    public function connect(): bool
    {
        // Early return if the connection is already open and custom setup has been done.
        if (!parent::connect()) {
            return false;
        }
 
        foreach ($this->prepareConnectionCommands as $command) {
            if ($this->executeUpdate($command) === false) {
                $this->logger->critical('Could not initialize DB connection with query "' . $command . '": ' . $this->errorInfo());
            }
        }
 
        return true;
    }
 
    /**
     * Creates a new instance of a SQL query builder.
     *
     * @return \TYPO3\CMS\Core\Database\Query\QueryBuilder
     */
    public function createQueryBuilder(): QueryBuilder
    {
        return GeneralUtility::makeInstance(QueryBuilder::class, $this);
     * @return string|null
     *
     * @throws Throwable
     */
    private function getDatabasePlatformVersion()
    {
        // Driver does not support version specific platforms.
        if (! $this->_driver instanceof VersionAwarePlatformDriver) {
            return null;
        }
 
        // Explicit platform version requested (supersedes auto-detection).
        if (isset($this->params['serverVersion'])) {
            return $this->params['serverVersion'];
        }
 
        // If not connected, we need to connect now to determine the platform version.
        if ($this->_conn === null) {
            try {
                $this->connect();
            } catch (Throwable $originalException) {
                if (empty($this->params['dbname'])) {
                    throw $originalException;
                }
 
                // The database to connect to might not yet exist.
                // Retry detection without database name connection parameter.
                $params = $this->params;
 
                unset($this->params['dbname']);
 
                try {
                    $this->connect();
                } catch (Throwable $fallbackException) {
                    // Either the platform does not support database-less connections
                    // or something else went wrong.
                    throw $originalException;
                } finally {
                    $this->params = $params;
                }
        }
 
        if ($this->_eventManager->hasListeners(Events::postConnect)) {
            $eventArgs = new Event\ConnectionEventArgs($this);
            $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs);
        }
 
        return true;
    }
 
    /**
     * Detects and sets the database platform.
     *
     * Evaluates custom platform class and version in order to set the correct platform.
     *
     * @throws Exception If an invalid platform was specified for this connection.
     */
    private function detectDatabasePlatform(): AbstractPlatform
    {
        $version = $this->getDatabasePlatformVersion();
 
        if ($version !== null) {
            assert($this->_driver instanceof VersionAwarePlatformDriver);
 
            return $this->_driver->createDatabasePlatformForVersion($version);
        }
 
        return $this->_driver->getDatabasePlatform();
    }
 
    /**
     * Returns the version of the related platform if applicable.
     *
     * Returns null if either the driver is not capable to create version
     * specific platform instances, no explicit server version was specified
     * or the underlying driver connection cannot determine the platform
     * version without having to query it (performance reasons).
     *
     * @return string|null
     *
     * Gets the EventManager used by the Connection.
     *
     * @return EventManager
     */
    public function getEventManager()
    {
        return $this->_eventManager;
    }
 
    /**
     * Gets the DatabasePlatform for the connection.
     *
     * @return AbstractPlatform
     *
     * @throws Exception
     */
    public function getDatabasePlatform()
    {
        if ($this->platform === null) {
            $this->platform = $this->detectDatabasePlatform();
            $this->platform->setEventManager($this->_eventManager);
        }
 
        return $this->platform;
    }
 
    /**
     * Gets the ExpressionBuilder for the connection.
     *
     * @return ExpressionBuilder
     */
    public function getExpressionBuilder()
    {
        return $this->_expr;
    }
 
    /**
     * Establishes the connection with the database.
     *
     * @return bool TRUE if the connection was successfully established, FALSE if
            $connectionParams['charset'] = 'utf8';
        }
 
        $connectionParams = $this->mapCustomDriver($connectionParams);
 
        /** @var Connection $conn */
        $conn = DriverManager::getConnection($connectionParams);
        $conn->setFetchMode(\PDO::FETCH_ASSOC);
        $conn->prepareConnection($connectionParams['initCommands'] ?? '');
 
        // Register custom data types
        foreach ($this->customDoctrineTypes as $type => $className) {
            if (!Type::hasType($type)) {
                Type::addType($type, $className);
            }
        }
 
        // Register all custom data types in the type mapping
        foreach ($this->customDoctrineTypes as $type => $className) {
            $conn->getDatabasePlatform()->registerDoctrineTypeMapping($type, $type);
        }
 
        // Handler for building custom data type column definitions
        // in the SchemaManager
        $conn->getDatabasePlatform()->getEventManager()->addEventListener(
            Events::onSchemaColumnDefinition,
            GeneralUtility::makeInstance(SchemaColumnDefinitionListener::class)
        );
 
        // Handler for enhanced index definitions in the SchemaManager
        $conn->getDatabasePlatform()->getEventManager()->addEventListener(
            Events::onSchemaIndexDefinition,
            GeneralUtility::makeInstance(SchemaIndexDefinitionListener::class)
        );
 
        // Handler for adding custom database platform options to ALTER TABLE
        // requests in the SchemaManager
        $conn->getDatabasePlatform()->getEventManager()->addEventListener(
            Events::onSchemaAlterTable,
            GeneralUtility::makeInstance(SchemaAlterTableListener::class)
        if (empty($connectionParams)) {
            throw new \RuntimeException(
                'The requested database connection named "' . $connectionName . '" has not been configured.',
                1459422492
            );
        }
 
        if (empty($connectionParams['wrapperClass'])) {
            $connectionParams['wrapperClass'] = Connection::class;
        }
 
        if (!is_a($connectionParams['wrapperClass'], Connection::class, true)) {
            throw new \UnexpectedValueException(
                'The "wrapperClass" for the connection name "' . $connectionName .
                '" needs to be a subclass of "' . Connection::class . '".',
                1459422968
            );
        }
 
        static::$connections[$connectionName] = $this->getDatabaseConnection($connectionParams);
 
        return static::$connections[$connectionName];
    }
 
    /**
     * Map custom driver class for certain driver
     *
     * @param array $connectionParams
     * @return array
     */
    protected function mapCustomDriver(array $connectionParams): array
    {
        // if no custom driver is provided, map TYPO3 specific drivers
        if (!isset($connectionParams['driverClass']) && isset(static::$driverMap[$connectionParams['driver']])) {
            $connectionParams['driverClass'] = static::$driverMap[$connectionParams['driver']];
        }
 
        return $connectionParams;
    }
 
     * that the mapping of table names to database connections is honored.
     *
     * @param string $tableName
     * @return Connection
     */
    public function getConnectionForTable(string $tableName): Connection
    {
        if (empty($tableName)) {
            throw new \UnexpectedValueException(
                'ConnectionPool->getConnectionForTable() requires a table name to be provided.',
                1459421719
            );
        }
 
        $connectionName = self::DEFAULT_CONNECTION_NAME;
        if (!empty($GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping'][$tableName])) {
            $connectionName = (string)$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping'][$tableName];
        }
 
        return $this->getConnectionByName($connectionName);
    }
 
    /**
     * Creates a connection object based on the specified identifier.
     *
     * This method should only be used in edge cases. Use getConnectionForTable() so
     * that the tablename<>databaseConnection mapping will be taken into account.
     *
     * @param string $connectionName
     * @return Connection
     * @throws \Doctrine\DBAL\DBALException
     */
    public function getConnectionByName(string $connectionName): Connection
    {
        if (empty($connectionName)) {
            throw new \UnexpectedValueException(
                'ConnectionPool->getConnectionByName() requires a connection name to be provided.',
                1459422125
            );
        }
        return $conn;
    }
 
    /**
     * Returns the connection specific query builder object that can be used to build
     * complex SQL queries using and object oriented approach.
     *
     * @param string $tableName
     * @return QueryBuilder
     */
    public function getQueryBuilderForTable(string $tableName): QueryBuilder
    {
        if (empty($tableName)) {
            throw new \UnexpectedValueException(
                'ConnectionPool->getQueryBuilderForTable() requires a connection name to be provided.',
                1459423448
            );
        }
 
        return $this->getConnectionForTable($tableName)->createQueryBuilder();
    }
 
    /**
     * Returns an array containing the names of all currently configured connections.
     *
     * This method should only be used in edge cases. Use getConnectionForTable() so
     * that the tablename<>databaseConnection mapping will be taken into account.
     *
     * @internal
     * @return array
     */
    public function getConnectionNames(): array
    {
        return array_keys($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']);
    }
 
    /**
     * Returns the list of custom Doctrine data types implemented by TYPO3.
     * This method is needed by the Schema parser to register the types as it
     * does not require a database connection and thus the types don't get
            $data['uident'] = '********';
        }
        if (isset($data['uident_text'])) {
            $data['uident_text'] = '********';
        }
        if (isset($data['password'])) {
            $data['password'] = '********';
        }
        return $data;
    }
 
    /**
     * Returns an info array which provides additional information for auth services
     *
     * @return array
     * @internal
     */
    public function getAuthInfoArray()
    {
        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->user_table);
        $expressionBuilder = $queryBuilder->expr();
        $authInfo = [];
        $authInfo['loginType'] = $this->loginType;
        $authInfo['refInfo'] = parse_url(GeneralUtility::getIndpEnv('HTTP_REFERER'));
        $authInfo['HTTP_HOST'] = GeneralUtility::getIndpEnv('HTTP_HOST');
        $authInfo['REMOTE_ADDR'] = GeneralUtility::getIndpEnv('REMOTE_ADDR');
        $authInfo['REMOTE_HOST'] = GeneralUtility::getIndpEnv('REMOTE_HOST');
        $authInfo['showHiddenRecords'] = $this->showHiddenRecords;
        // Can be overridden in localconf by SVCONF:
        $authInfo['db_user']['table'] = $this->user_table;
        $authInfo['db_user']['userid_column'] = $this->userid_column;
        $authInfo['db_user']['username_column'] = $this->username_column;
        $authInfo['db_user']['userident_column'] = $this->userident_column;
        $authInfo['db_user']['usergroup_column'] = $this->usergroup_column;
        $authInfo['db_user']['enable_clause'] = $this->userConstraints()->buildExpression(
            [$this->user_table => $this->user_table],
            $expressionBuilder
        );
        if ($this->checkPid && $this->checkPid_value !== null) {
            $authInfo['db_user']['checkPidList'] = $this->checkPid_value;
    /**
     * Checks if a submission of username and password is present or use other authentication by auth services
     *
     * @throws \RuntimeException
     * @internal
     */
    public function checkAuthentication()
    {
        // No user for now - will be searched by service below
        $tempuserArr = [];
        $tempuser = false;
        // User is not authenticated by default
        $authenticated = false;
        // User want to login with passed login data (name/password)
        $activeLogin = false;
        // Indicates if an active authentication failed (not auto login)
        $this->loginFailure = false;
        $this->logger->debug('Login type: ' . $this->loginType);
        // The info array provide additional information for auth services
        $authInfo = $this->getAuthInfoArray();
        // Get Login/Logout data submitted by a form or params
        $loginData = $this->getLoginFormData();
        $this->logger->debug('Login data', $this->removeSensitiveLoginDataForLoggingInfo($loginData));
        // Active logout (eg. with "logout" button)
        if ($loginData['status'] === LoginType::LOGOUT) {
            if ($this->writeStdLog) {
                // $type,$action,$error,$details_nr,$details,$data,$tablename,$recuid,$recpid
                $this->writelog(SystemLogType::LOGIN, SystemLogLoginAction::LOGOUT, SystemLogErrorClassification::MESSAGE, 2, 'User %s logged out', [$this->user['username']], '', 0, 0);
            }
            $this->logger->info('User logged out. Id: ' . sha1($this->id));
            $this->logoff();
        }
        // Determine whether we need to skip session update.
        // This is used mainly for checking session timeout in advance without refreshing the current session's timeout.
        $skipSessionUpdate = (bool)GeneralUtility::_GP('skipSessionUpdate');
        $haveSession = false;
        $anonymousSession = false;
        if (!$this->newSessionID) {
            // Read user session
            $authInfo['userSession'] = $this->fetchUserSession($skipSessionUpdate);
    public function start()
    {
        $this->logger->debug('## Beginning of auth logging.');
        $this->newSessionID = false;
        // Make certain that NO user is set initially
        $this->user = null;
        // sessionID is set to ses_id if cookie is present. Otherwise a new session will start
        $this->id = $this->getCookie($this->name);
 
        // If new session or client tries to fix session...
        if (!$this->isExistingSessionRecord($this->id)) {
            $this->id = $this->createSessionId();
            $this->newSessionID = true;
        }
 
        // Set all possible headers that could ensure that the script is not cached on the client-side
        $this->sendHttpHeaders();
        // Load user session, check to see if anyone has submitted login-information and if so authenticate
        // the user with the session. $this->user[uid] may be used to write log...
        $this->checkAuthentication();
        // Set cookie if generally enabled or if the current session is a non-session cookie (FE permalogin)
        if (!$this->dontSetCookie || $this->isRefreshTimeBasedCookie()) {
            $this->setSessionCookie();
        }
        // Hook for alternative ways of filling the $this->user array (is used by the "timtaw" extension)
        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['postUserLookUp'] ?? [] as $funcName) {
            $_params = [
                'pObj' => $this,
            ];
            GeneralUtility::callUserFunction($funcName, $_params, $this);
        }
        // If we're lucky we'll get to clean up old sessions
        if (random_int(0, mt_getrandmax()) % 100 <= $this->gc_probability) {
            $this->gc();
        }
    }
 
    /**
     * Set all possible headers that could ensure that the script
     * is not cached on the client-side.
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $frontendUser = GeneralUtility::makeInstance(FrontendUserAuthentication::class);
 
        // List of page IDs where to look for frontend user records
        $pid = $request->getParsedBody()['pid'] ?? $request->getQueryParams()['pid'] ?? 0;
        if ($pid) {
            $frontendUser->checkPid_value = implode(',', GeneralUtility::intExplode(',', $pid));
        }
 
        // Check if a session is transferred, and update the cookie parameters
        $frontendSessionKey = $request->getParsedBody()['FE_SESSION_KEY'] ?? $request->getQueryParams()['FE_SESSION_KEY'] ?? '';
        if ($frontendSessionKey) {
            $request = $this->transferFrontendUserSession($frontendUser, $request, $frontendSessionKey);
        }
 
        // Authenticate now
        $frontendUser->start();
        $frontendUser->unpack_uc();
 
        // Register the frontend user as aspect and within the session
        $this->setFrontendUserAspect($frontendUser);
        $request = $request->withAttribute('frontend.user', $frontendUser);
 
        $response = $handler->handle($request);
 
        // Store session data for fe_users if it still exists
        if ($frontendUser instanceof FrontendUserAuthentication) {
            $frontendUser->storeSessionData();
        }
 
        return $response;
    }
 
    /**
     * It's possible to transfer a frontend user session via a GET/POST parameter 'FE_SESSION_KEY'.
     * In the future, this logic should be moved into the FrontendUserAuthentication object directly,
     * but only if FrontendUserAuthentication does not request superglobals (like $_COOKIE) anymore.
 
            public function __construct(string $middleware, RequestHandlerInterface $next, ContainerInterface $container = null)
            {
                $this->middleware = $middleware;
                $this->next = $next;
                $this->container = $container;
            }
 
            public function handle(ServerRequestInterface $request): ResponseInterface
            {
                if ($this->container !== null && $this->container->has($this->middleware)) {
                    $middleware = $this->container->get($this->middleware);
                } else {
                    $middleware = GeneralUtility::makeInstance($this->middleware);
                }
 
                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
 
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        // Initializing a possible logged-in Backend User
        // If the backend cookie is set,
        // we proceed and check if a backend user is logged in.
        $backendUserObject = null;
        if (isset($request->getCookieParams()[BackendUserAuthentication::getCookieName()])) {
            $backendUserObject = $this->initializeBackendUser($request);
        }
        $GLOBALS['BE_USER'] = $backendUserObject;
        // Load specific dependencies which are necessary for a valid Backend User
        // like $GLOBALS['LANG'] for labels in the language of the BE User, the router, and ext_tables.php for all modules
        // So things like Frontend Editing and Admin Panel can use this for generating links to the TYPO3 Backend.
        if ($GLOBALS['BE_USER'] instanceof FrontendBackendUserAuthentication) {
            $GLOBALS['LANG'] = LanguageService::createFromUserPreferences($GLOBALS['BE_USER']);
            Bootstrap::loadExtTables();
            $this->setBackendUserAspect($GLOBALS['BE_USER']);
        }
 
        $response = $handler->handle($request);
 
        // If, when building the response, the user is still available, then ensure that the headers are sent properly
        if ($this->context->getAspect('backend.user')->isLoggedIn()) {
            return $this->applyHeadersToResponse($response);
        }
        return $response;
    }
 
    /**
     * Creates the backend user object and returns it.
     *
     * @param ServerRequestInterface $request
     * @return FrontendBackendUserAuthentication|null the backend user object or null if there was no valid user found
     * @throws \TYPO3\CMS\Core\Exception
     */
    protected function initializeBackendUser(ServerRequestInterface $request)
    {
        // New backend user object
        $backendUserObject = GeneralUtility::makeInstance(FrontendBackendUserAuthentication::class);
        $backendUserObject->start();
 
            public function __construct(string $middleware, RequestHandlerInterface $next, ContainerInterface $container = null)
            {
                $this->middleware = $middleware;
                $this->next = $next;
                $this->container = $container;
            }
 
            public function handle(ServerRequestInterface $request): ResponseInterface
            {
                if ($this->container !== null && $this->container->has($this->middleware)) {
                    $middleware = $this->container->get($this->middleware);
                } else {
                    $middleware = GeneralUtility::makeInstance($this->middleware);
                }
 
                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
 
    /**
     * Calls the "unavailableAction" of the error controller if the system is in maintenance mode.
     * This only applies if the REMOTE_ADDR does not match the devIpMask
     *
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        if ($GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_force']
            && !GeneralUtility::cmpIP(
                $request->getAttribute('normalizedParams')->getRemoteAddress(),
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']
            )
        ) {
            return GeneralUtility::makeInstance(ErrorController::class)->unavailableAction($request, 'This page is temporarily unavailable.');
        }
        // Continue the regular stack if no maintenance mode is active
        return $handler->handle($request);
    }
}
 
 
            public function __construct(string $middleware, RequestHandlerInterface $next, ContainerInterface $container = null)
            {
                $this->middleware = $middleware;
                $this->next = $next;
                $this->container = $container;
            }
 
            public function handle(ServerRequestInterface $request): ResponseInterface
            {
                if ($this->container !== null && $this->container->has($this->middleware)) {
                    $middleware = $this->container->get($this->middleware);
                } else {
                    $middleware = GeneralUtility::makeInstance($this->middleware);
                }
 
                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
 
    }
 
    /**
     * Resolve the site/language information by checking the page ID or the URL.
     *
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        /** @var SiteRouteResult $routeResult */
        $routeResult = $this->matcher->matchRequest($request);
        $request = $request->withAttribute('site', $routeResult->getSite());
        $request = $request->withAttribute('language', $routeResult->getLanguage());
        $request = $request->withAttribute('routing', $routeResult);
        if ($routeResult->getLanguage() instanceof SiteLanguage) {
            Locales::setSystemLocaleFromSiteLanguage($routeResult->getLanguage());
        }
        return $handler->handle($request);
    }
}
 
 
            public function __construct(string $middleware, RequestHandlerInterface $next, ContainerInterface $container = null)
            {
                $this->middleware = $middleware;
                $this->next = $next;
                $this->container = $container;
            }
 
            public function handle(ServerRequestInterface $request): ResponseInterface
            {
                if ($this->container !== null && $this->container->has($this->middleware)) {
                    $middleware = $this->container->get($this->middleware);
                } else {
                    $middleware = GeneralUtility::makeInstance($this->middleware);
                }
 
                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
 
     */
    public function __construct(DispatcherInterface $dispatcher)
    {
        $this->dispatcher = $dispatcher;
    }
 
    /**
     * Dispatches the request to the corresponding eID class or eID script
     *
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     * @throws Exception
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $eID = $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null;
 
        if ($eID === null) {
            return $handler->handle($request);
        }
 
        // Remove any output produced until now
        ob_clean();
 
        if (!is_string($eID)) {
            return (new Response())->withStatus(400, 'Invalid eID');
        }
 
        $target = $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID] ?? null;
        if (empty($target)) {
            return (new Response())->withStatus(404, 'eID not registered');
        }
 
        $request = $request->withAttribute('target', $target);
        return $this->dispatcher->dispatch($request) ?? new NullResponse();
    }
}
 
 
            public function __construct(string $middleware, RequestHandlerInterface $next, ContainerInterface $container = null)
            {
                $this->middleware = $middleware;
                $this->next = $next;
                $this->container = $container;
            }
 
            public function handle(ServerRequestInterface $request): ResponseInterface
            {
                if ($this->container !== null && $this->container->has($this->middleware)) {
                    $middleware = $this->container->get($this->middleware);
                } else {
                    $middleware = GeneralUtility::makeInstance($this->middleware);
                }
 
                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
 
/**
 * Add NormalizedParams as 'normalizedParams' attribute.
 * Used in FE, BE and install tool context.
 *
 * @internal
 */
class NormalizedParamsAttribute implements MiddlewareInterface
{
    /**
     * Adds an instance of TYPO3\CMS\Core\Http\NormalizedParams as
     * attribute to $request object
     *
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $request = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request));
        return $handler->handle($request);
    }
}
 
 
            public function __construct(string $middleware, RequestHandlerInterface $next, ContainerInterface $container = null)
            {
                $this->middleware = $middleware;
                $this->next = $next;
                $this->container = $container;
            }
 
            public function handle(ServerRequestInterface $request): ResponseInterface
            {
                if ($this->container !== null && $this->container->has($this->middleware)) {
                    $middleware = $this->container->get($this->middleware);
                } else {
                    $middleware = GeneralUtility::makeInstance($this->middleware);
                }
 
                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
 
    public function __construct(TimeTracker $timeTracker)
    {
        $this->timeTracker = $timeTracker;
    }
 
    /**
     * Starting time tracking (by setting up a singleton object)
     *
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $timeTrackingEnabled = $this->isBackendUserCookieSet($request);
        $this->timeTracker->setEnabled($timeTrackingEnabled);
        $this->timeTracker->start(microtime(true));
        $this->timeTracker->push('');
 
        $response = $handler->handle($request);
 
        // Finish time tracking
        $this->timeTracker->pull();
        $this->timeTracker->finish();
 
        if ($this->isDebugModeEnabled()) {
            return $response->withHeader('X-TYPO3-Parsetime', $this->timeTracker->getParseTime() . 'ms');
        }
        return $response;
    }
 
    protected function isBackendUserCookieSet(ServerRequestInterface $request): bool
    {
        $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']) ?: 'be_typo_user';
        return !empty($request->getCookieParams()[$configuredCookieName]);
    }
 
    protected function isDebugModeEnabled(): bool
    {
        $controller = $GLOBALS['TSFE'];
 
            public function __construct(string $middleware, RequestHandlerInterface $next, ContainerInterface $container = null)
            {
                $this->middleware = $middleware;
                $this->next = $next;
                $this->container = $container;
            }
 
            public function handle(ServerRequestInterface $request): ResponseInterface
            {
                if ($this->container !== null && $this->container->has($this->middleware)) {
                    $middleware = $this->container->get($this->middleware);
                } else {
                    $middleware = GeneralUtility::makeInstance($this->middleware);
                }
 
                if (!$middleware instanceof MiddlewareInterface) {
                    throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342);
                }
                return $middleware->process($request, $this->next);
            }
        };
    }
}
 
        $this->seedMiddlewareStack($kernel);
 
        foreach ($middlewares as $middleware) {
            if (is_string($middleware)) {
                $this->lazy($middleware);
            } else {
                $this->add($middleware);
            }
        }
    }
 
    /**
     * Invoke the middleware stack
     *
     * @param ServerRequestInterface $request
     * @return ResponseInterface
     */
    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->tip->handle($request);
    }
 
    /**
     * Seed the middleware stack with the inner request handler
     *
     * @param RequestHandlerInterface $kernel
     */
    protected function seedMiddlewareStack(RequestHandlerInterface $kernel)
    {
        $this->tip = $kernel;
    }
 
    /**
     * Add a new middleware to the stack
     *
     * Middlewares are organized as a stack. That means middlewares
     * that have been added before will be executed after the newly
     * added one (last in, first out).
     *
     * @param MiddlewareInterface $middleware
                    header($name . ': ' . implode(', ', $values));
                }
            }
        }
        $body = $response->getBody();
        if ($body instanceof SelfEmittableStreamInterface) {
            // Optimization for streams that use php functions like readfile() as fastpath for serving files.
            $body->emit();
        } else {
            echo $body->__toString();
        }
    }
 
    /**
     * @param ServerRequestInterface $request
     * @return ResponseInterface
     */
    protected function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->requestHandler->handle($request);
    }
 
    /**
     * Set up the application and shut it down afterwards
     *
     * @param callable $execute
     */
    final public function run(callable $execute = null)
    {
        try {
            $response = $this->handle(
                ServerRequestFactory::fromGlobals()
            );
            if ($execute !== null) {
                call_user_func($execute);
            }
        } catch (ImmediateResponseException $exception) {
            $response = $exception->getResponse();
        }
 
        RequestHandlerInterface $requestHandler,
        ConfigurationManager $configurationManager,
        Context $context
    ) {
        $this->requestHandler = $requestHandler;
        $this->configurationManager = $configurationManager;
        $this->context = $context;
    }
 
    protected function handle(ServerRequestInterface $request): ResponseInterface
    {
        if (!$this->checkIfEssentialConfigurationExists()) {
            return $this->installToolRedirect();
        }
 
        // Create new request object having applicationType "I am a frontend request" attribute.
        $request = $request->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_FE);
 
        $this->initializeContext();
        return parent::handle($request);
    }
 
    /**
     * Check if LocalConfiguration.php and PackageStates.php exist
     *
     * @return bool TRUE when the essential configuration is available, otherwise FALSE
     */
    protected function checkIfEssentialConfigurationExists(): bool
    {
        return file_exists($this->configurationManager->getLocalConfigurationFileLocation())
            && file_exists(Environment::getLegacyConfigPath() . '/PackageStates.php');
    }
 
    /**
     * Create a PSR-7 Response that redirects to the install tool
     *
     * @return ResponseInterface
     */
    protected function installToolRedirect(): ResponseInterface
    {
 
    /**
     * @param ServerRequestInterface $request
     * @return ResponseInterface
     */
    protected function handle(ServerRequestInterface $request): ResponseInterface
    {
        return $this->requestHandler->handle($request);
    }
 
    /**
     * Set up the application and shut it down afterwards
     *
     * @param callable $execute
     */
    final public function run(callable $execute = null)
    {
        try {
            $response = $this->handle(
                ServerRequestFactory::fromGlobals()
            );
            if ($execute !== null) {
                call_user_func($execute);
            }
        } catch (ImmediateResponseException $exception) {
            $response = $exception->getResponse();
        }
 
        $this->sendResponse($response);
    }
}
 
 * the terms of the GNU General Public License, either version 2
 * of the License, or any later version.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 * The TYPO3 project - inspiring people to share!
 */
 
// Exit early if php requirement is not satisfied.
if (PHP_VERSION_ID < 70200 || PHP_VERSION_ID >= 80000) {
    die('This version of TYPO3 CMS requires PHP >= 7.2 and < 8.0');
}
 
// Set up the application for the frontend
call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    chdir(getenv('TYPO3_PATH_ROOT'));
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run();
});
 
 * of the License, or any later version.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 * The TYPO3 project - inspiring people to share!
 */
 
// Exit early if php requirement is not satisfied.
if (PHP_VERSION_ID < 70200 || PHP_VERSION_ID >= 80000) {
    die('This version of TYPO3 CMS requires PHP >= 7.2 and < 8.0');
}
 
// Set up the application for the frontend
call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    chdir(getenv('TYPO3_PATH_ROOT'));
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(0, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Frontend\Http\Application::class)->run();
});
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
GCONV_PATH /usr/local/php/lib64/gconv
LO_PATH /usr/local/php/lib64/locale
MAGICK_C0DER_MODULE_PATH /usr/local/php/lib64/ImageMagick-6.9.10/modules-Q16/coders
OPENSSL_CONF /etc/ssl/openssl.cnf
PATH /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/command:/usr/local/salt/bin
USER p105310
HOME /home/www/p105310
SCRIPT_NAME /index.php
REQUEST_URI /nc/luftentfeuchtung/luftentfeuchter-adsorption/adsorptionstrockner-400-v/adsorptionstrockner-400-v/produkt/hygrostat-1/40-entfeuchter-99.html
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/2.0
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /nc/luftentfeuchtung/luftentfeuchter-adsorption/adsorptionstrockner-400-v/adsorptionstrockner-400-v/produkt/hygrostat-1/40-entfeuchter-99.html
REMOTE_PORT 54430
SCRIPT_FILENAME /home/www/p105310/html/ffrey.de/current/public/index.php
SERVER_ADMIN [no address given]
CONTEXT_DOCUMENT_ROOT /home/www/p105310/html/ffrey.de/current/public/
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /home/www/p105310/html/ffrey.de/current/public/
REMOTE_ADDR 44.195.47.227
SERVER_PORT 443
SERVER_ADDR 172.16.111.75
SERVER_NAME www.ffrey.de
SERVER_SOFTWARE Apache
SERVER_SIGNATURE
HTTP_HOST www.ffrey.de
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
H2_STREAM_TAG 4104315-96-3
H2_STREAM_ID 3
H2_PUSHED_ON
H2_PUSHED
H2_PUSH off
H2PUSH off
HTTP2 on
SSL_TLS_SNI www.ffrey.de
TYPO3_CONTEXT Production
CWD /
HTTPS on
REDIRECT_STATUS 200
REDIRECT_H2_STREAM_TAG 4104315-96-3
REDIRECT_H2_STREAM_ID 3
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSH off
REDIRECT_H2PUSH off
REDIRECT_HTTP2 on
REDIRECT_SSL_TLS_SNI www.ffrey.de
REDIRECT_TYPO3_CONTEXT Production
REDIRECT_CWD /
REDIRECT_HTTPS on
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711618335.1001
REQUEST_TIME 1711618335
Key Value
TYPO3_PATH_COMPOSER_ROOT /html/ffrey.de/releases/20240221160415
TYPO3_PATH_APP /html/ffrey.de/releases/20240221160415
TYPO3_PATH_ROOT /html/ffrey.de/releases/20240221160415/private
TYPO3_PATH_WEB /html/ffrey.de/releases/20240221160415/public
0. Whoops\Handler\PrettyPageHandler