If you need help solving this exception, you can have a look at the TYPO3 Documentation. There you can find solutions provided by the TYPO3 community. Once you have found a solution to the problem, help others by contributing to the documentation page.
Find a solution for this exception in the TYPO3 Documentation.
case 1429: case 2002: case 2005: case 2054: return new ConnectionException($exception, $query); case 2006: return new ConnectionLost($exception, $query);
Driver\Exception $driverException, ?Query $query ): DriverException { $this->exceptionConverter ??= $this->_driver->getExceptionConverter(); $exception = $this->exceptionConverter->convert($driverException, $query); if ($exception instanceof ConnectionLost) { $this->close(); }
/** @internal */ final public function convertException(Driver\Exception $e): DriverException { return $this->handleDriverException($e, null); } /** * @param array<int, mixed>|array<string, mixed> $params
try { $this->_conn = $this->_driver->connect($this->params); } catch (Driver\Exception $e) { throw $this->convertException($e); } if ($this->autoCommit === false) { $this->beginTransaction();
*/ 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 not connected, we need to connect now to determine the platform version. if ($this->_conn === null) { try { $this->connect(); } catch (Exception $originalException) { if (! isset($this->params['dbname'])) { throw $originalException; }
* @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);
*/ public function getDatabasePlatform() { if ($this->platform === null) { $this->platform = $this->detectDatabasePlatform(); $this->platform->setEventManager($this->_eventManager); $this->platform->setDisableTypeComments($this->_config->getDisableTypeComments()); }
$conn->prepareConnection($connectionParams['initCommands'] ?? ''); // Register all custom data types in the type mapping foreach ($this->customDoctrineTypes as $type => $className) { $conn->getDatabasePlatform()->registerDoctrineTypeMapping($type, $type); } // Register all override data types in the type mapping foreach ($this->overrideDoctrineTypes as $type => $className) {
); unset($connectionParams['tableoptions']); } static::$connections[$connectionName] = $this->getDatabaseConnection($connectionParams); return static::$connections[$connectionName]; }
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.
1459423448 ); } return $this->getConnectionForTable($tableName)->createQueryBuilder(); } /** * Returns an array containing the names of all currently configured connections.
* @internal */ public function getAuthInfoArray(ServerRequestInterface $request) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->user_table); $expressionBuilder = $queryBuilder->expr(); $authInfo = []; $authInfo['loginType'] = $this->loginType; $authInfo['request'] = $request;
protected function getAuthServices(string $subType, array $loginData, ?array $authenticatedUserFromSession, ServerRequestInterface $request): \Traversable { $serviceChain = []; // The info array provide additional information for auth services $authInfo = $this->getAuthInfoArray($request); if ($authenticatedUserFromSession !== null) { $authInfo['user'] = $authenticatedUserFromSession; } while (is_object($serviceObj = GeneralUtility::makeInstanceService('auth', $subType, $serviceChain))) {
// Use 'auth' service to find the user // First found user will be used $subType = 'getUser' . $this->loginType; /** @var AuthenticationService $serviceObj */ foreach ($this->getAuthServices($subType, $loginData, $authenticatedUserFromSession, $request) as $serviceObj) { $row = $serviceObj->getUser(); if (is_array($row)) { $possibleUsers[] = $row; $this->logger->debug('User found', [
} } // Fetch users from the database (or somewhere else) $possibleUsers = $this->fetchPossibleUsers($loginData, $activeLogin, $isExistingSession, $authenticatedUserFromSession, $request); // If no new user was set we use the already found user session if (empty($possibleUsers) && $isExistingSession && !$anonymousSession) { // Check if the previous services returned a proper user
// 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... try { $this->checkAuthentication($request); } catch (MfaRequiredException $mfaRequiredException) { // Ensure the cookie is still set to keep the user session available if ($this->shallSetSessionCookie()) { $this->setSessionCookie();
// Rate Limiting $rateLimiter = $this->ensureLoginRateLimit($frontendUser, $request); // Authenticate now $frontendUser->start($request); // no matter if we have an active user we try to fetch matching groups which can // be set without an user (simulation for instance!) $frontendUser->fetchGroupData($request);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$pageIndexerRequestHandler = GeneralUtility::makeInstance(PageIndexerRequestHandler::class); $pageIndexerRequestHandler->initialize($pageIndexerRequest); } $response = $handler->handle($request); if ($pageIndexerRequestHandler instanceof PageIndexerRequestHandler && $pageIndexerRequest instanceof PageIndexerRequest) { $pageIndexResponse = $pageIndexerRequestHandler->shutdown($pageIndexerRequest); $body = new Stream('php://temp', 'rw');
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('noCache', true); } } $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);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->securityAspect->setReceivedRequestToken(false); $this->logger->debug('Could not resolve request token', ['exception' => $exception]); } $response = $handler->handle($request); return $this->enrichResponseWithCookie($request, $response); } protected function resolveNoncePool(ServerRequestInterface $request): NoncePool
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
) { 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); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('routing', $routeResult); if ($routeResult->getLanguage() instanceof SiteLanguage) { Locales::setSystemLocaleFromSiteLanguage($routeResult->getLanguage()); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ $eID = $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null; if ($eID === null) { return $handler->handle($request); } // Remove any output produced until now ob_clean();
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 { $request = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request)); return $handler->handle($request); } }
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 { $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] ?? $request; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
1396795884 ); } return $handler->handle($request); } /** * Checks if the provided host header value matches the trusted hosts pattern.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$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 (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Invoke the middleware stack */ public function handle(ServerRequestInterface $request): ResponseInterface { return $this->tip->handle($request); } /** * Seed the middleware stack with the inner request handler
public function handle(ServerRequestInterface $request): ResponseInterface { try { $response = $this->requestHandler->handle($request); } catch (ImmediateResponseException $exception) { $response = $exception->getResponse(); } return $response;
// 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); } /** * Create a PSR-7 Response that redirects to the install tool
* Set up the application and shut it down afterwards */ final public function run() { $response = $this->handle(ServerRequestFactory::fromGlobals()); $this->sendResponse($response); } }
// Set up the application for the frontend call_user_func(static function () { $classLoader = require dirname(__DIR__).'/vendor/autoload.php'; \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(); });
call_user_func(static function () { $classLoader = require dirname(__DIR__).'/vendor/autoload.php'; \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(); });
{ $p = new ReflectionProperty(mysqli_sql_exception::class, 'sqlstate'); $p->setAccessible(true); return new self($exception->getMessage(), $p->getValue($exception), (int) $exception->getCode(), $exception); } }
$params['unix_socket'] ?? null, $params['driverOptions'][Connection::OPTION_FLAGS] ?? 0, ); } catch (mysqli_sql_exception $e) { throw ConnectionFailed::upcast($e); } if (! $success) { throw ConnectionFailed::new($connection);
public function connect( #[SensitiveParameter] array $params ) { return $this->wrappedDriver->connect($params); } /** * {@inheritDoc}
} public function connect(array $params) { return new LoggingConnection(parent::connect($params), $this->logger); } }
return false; } try { $this->_conn = $this->_driver->connect($this->params); } catch (Driver\Exception $e) { throw $this->convertException($e); }
*/ 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 not connected, we need to connect now to determine the platform version. if ($this->_conn === null) { try { $this->connect(); } catch (Exception $originalException) { if (! isset($this->params['dbname'])) { throw $originalException; }
* @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);
*/ public function getDatabasePlatform() { if ($this->platform === null) { $this->platform = $this->detectDatabasePlatform(); $this->platform->setEventManager($this->_eventManager); $this->platform->setDisableTypeComments($this->_config->getDisableTypeComments()); }
$conn->prepareConnection($connectionParams['initCommands'] ?? ''); // Register all custom data types in the type mapping foreach ($this->customDoctrineTypes as $type => $className) { $conn->getDatabasePlatform()->registerDoctrineTypeMapping($type, $type); } // Register all override data types in the type mapping foreach ($this->overrideDoctrineTypes as $type => $className) {
); unset($connectionParams['tableoptions']); } static::$connections[$connectionName] = $this->getDatabaseConnection($connectionParams); return static::$connections[$connectionName]; }
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.
1459423448 ); } return $this->getConnectionForTable($tableName)->createQueryBuilder(); } /** * Returns an array containing the names of all currently configured connections.
* @internal */ public function getAuthInfoArray(ServerRequestInterface $request) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->user_table); $expressionBuilder = $queryBuilder->expr(); $authInfo = []; $authInfo['loginType'] = $this->loginType; $authInfo['request'] = $request;
protected function getAuthServices(string $subType, array $loginData, ?array $authenticatedUserFromSession, ServerRequestInterface $request): \Traversable { $serviceChain = []; // The info array provide additional information for auth services $authInfo = $this->getAuthInfoArray($request); if ($authenticatedUserFromSession !== null) { $authInfo['user'] = $authenticatedUserFromSession; } while (is_object($serviceObj = GeneralUtility::makeInstanceService('auth', $subType, $serviceChain))) {
// Use 'auth' service to find the user // First found user will be used $subType = 'getUser' . $this->loginType; /** @var AuthenticationService $serviceObj */ foreach ($this->getAuthServices($subType, $loginData, $authenticatedUserFromSession, $request) as $serviceObj) { $row = $serviceObj->getUser(); if (is_array($row)) { $possibleUsers[] = $row; $this->logger->debug('User found', [
} } // Fetch users from the database (or somewhere else) $possibleUsers = $this->fetchPossibleUsers($loginData, $activeLogin, $isExistingSession, $authenticatedUserFromSession, $request); // If no new user was set we use the already found user session if (empty($possibleUsers) && $isExistingSession && !$anonymousSession) { // Check if the previous services returned a proper user
// 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... try { $this->checkAuthentication($request); } catch (MfaRequiredException $mfaRequiredException) { // Ensure the cookie is still set to keep the user session available if ($this->shallSetSessionCookie()) { $this->setSessionCookie();
// Rate Limiting $rateLimiter = $this->ensureLoginRateLimit($frontendUser, $request); // Authenticate now $frontendUser->start($request); // no matter if we have an active user we try to fetch matching groups which can // be set without an user (simulation for instance!) $frontendUser->fetchGroupData($request);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$pageIndexerRequestHandler = GeneralUtility::makeInstance(PageIndexerRequestHandler::class); $pageIndexerRequestHandler->initialize($pageIndexerRequest); } $response = $handler->handle($request); if ($pageIndexerRequestHandler instanceof PageIndexerRequestHandler && $pageIndexerRequest instanceof PageIndexerRequest) { $pageIndexResponse = $pageIndexerRequestHandler->shutdown($pageIndexerRequest); $body = new Stream('php://temp', 'rw');
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('noCache', true); } } $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);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->securityAspect->setReceivedRequestToken(false); $this->logger->debug('Could not resolve request token', ['exception' => $exception]); } $response = $handler->handle($request); return $this->enrichResponseWithCookie($request, $response); } protected function resolveNoncePool(ServerRequestInterface $request): NoncePool
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
) { 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); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('routing', $routeResult); if ($routeResult->getLanguage() instanceof SiteLanguage) { Locales::setSystemLocaleFromSiteLanguage($routeResult->getLanguage()); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ $eID = $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null; if ($eID === null) { return $handler->handle($request); } // Remove any output produced until now ob_clean();
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 { $request = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request)); return $handler->handle($request); } }
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 { $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] ?? $request; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
1396795884 ); } return $handler->handle($request); } /** * Checks if the provided host header value matches the trusted hosts pattern.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$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 (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Invoke the middleware stack */ public function handle(ServerRequestInterface $request): ResponseInterface { return $this->tip->handle($request); } /** * Seed the middleware stack with the inner request handler
public function handle(ServerRequestInterface $request): ResponseInterface { try { $response = $this->requestHandler->handle($request); } catch (ImmediateResponseException $exception) { $response = $exception->getResponse(); } return $response;
// 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); } /** * Create a PSR-7 Response that redirects to the install tool
* Set up the application and shut it down afterwards */ final public function run() { $response = $this->handle(ServerRequestFactory::fromGlobals()); $this->sendResponse($response); } }
// Set up the application for the frontend call_user_func(static function () { $classLoader = require dirname(__DIR__).'/vendor/autoload.php'; \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(); });
call_user_func(static function () { $classLoader = require dirname(__DIR__).'/vendor/autoload.php'; \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(); });
$params['password'] ?? null, $params['dbname'] ?? null, $params['port'] ?? null, $params['unix_socket'] ?? null, $params['driverOptions'][Connection::OPTION_FLAGS] ?? 0, ); } catch (mysqli_sql_exception $e) { throw ConnectionFailed::upcast($e); }
$params['password'] ?? null, $params['dbname'] ?? null, $params['port'] ?? null, $params['unix_socket'] ?? null, $params['driverOptions'][Connection::OPTION_FLAGS] ?? 0, ); } catch (mysqli_sql_exception $e) { throw ConnectionFailed::upcast($e); }
public function connect( #[SensitiveParameter] array $params ) { return $this->wrappedDriver->connect($params); } /** * {@inheritDoc}
} public function connect(array $params) { return new LoggingConnection(parent::connect($params), $this->logger); } }
return false; } try { $this->_conn = $this->_driver->connect($this->params); } catch (Driver\Exception $e) { throw $this->convertException($e); }
*/ 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 not connected, we need to connect now to determine the platform version. if ($this->_conn === null) { try { $this->connect(); } catch (Exception $originalException) { if (! isset($this->params['dbname'])) { throw $originalException; }
* @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);
*/ public function getDatabasePlatform() { if ($this->platform === null) { $this->platform = $this->detectDatabasePlatform(); $this->platform->setEventManager($this->_eventManager); $this->platform->setDisableTypeComments($this->_config->getDisableTypeComments()); }
$conn->prepareConnection($connectionParams['initCommands'] ?? ''); // Register all custom data types in the type mapping foreach ($this->customDoctrineTypes as $type => $className) { $conn->getDatabasePlatform()->registerDoctrineTypeMapping($type, $type); } // Register all override data types in the type mapping foreach ($this->overrideDoctrineTypes as $type => $className) {
); unset($connectionParams['tableoptions']); } static::$connections[$connectionName] = $this->getDatabaseConnection($connectionParams); return static::$connections[$connectionName]; }
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.
1459423448 ); } return $this->getConnectionForTable($tableName)->createQueryBuilder(); } /** * Returns an array containing the names of all currently configured connections.
* @internal */ public function getAuthInfoArray(ServerRequestInterface $request) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->user_table); $expressionBuilder = $queryBuilder->expr(); $authInfo = []; $authInfo['loginType'] = $this->loginType; $authInfo['request'] = $request;
protected function getAuthServices(string $subType, array $loginData, ?array $authenticatedUserFromSession, ServerRequestInterface $request): \Traversable { $serviceChain = []; // The info array provide additional information for auth services $authInfo = $this->getAuthInfoArray($request); if ($authenticatedUserFromSession !== null) { $authInfo['user'] = $authenticatedUserFromSession; } while (is_object($serviceObj = GeneralUtility::makeInstanceService('auth', $subType, $serviceChain))) {
// Use 'auth' service to find the user // First found user will be used $subType = 'getUser' . $this->loginType; /** @var AuthenticationService $serviceObj */ foreach ($this->getAuthServices($subType, $loginData, $authenticatedUserFromSession, $request) as $serviceObj) { $row = $serviceObj->getUser(); if (is_array($row)) { $possibleUsers[] = $row; $this->logger->debug('User found', [
} } // Fetch users from the database (or somewhere else) $possibleUsers = $this->fetchPossibleUsers($loginData, $activeLogin, $isExistingSession, $authenticatedUserFromSession, $request); // If no new user was set we use the already found user session if (empty($possibleUsers) && $isExistingSession && !$anonymousSession) { // Check if the previous services returned a proper user
// 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... try { $this->checkAuthentication($request); } catch (MfaRequiredException $mfaRequiredException) { // Ensure the cookie is still set to keep the user session available if ($this->shallSetSessionCookie()) { $this->setSessionCookie();
// Rate Limiting $rateLimiter = $this->ensureLoginRateLimit($frontendUser, $request); // Authenticate now $frontendUser->start($request); // no matter if we have an active user we try to fetch matching groups which can // be set without an user (simulation for instance!) $frontendUser->fetchGroupData($request);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$pageIndexerRequestHandler = GeneralUtility::makeInstance(PageIndexerRequestHandler::class); $pageIndexerRequestHandler->initialize($pageIndexerRequest); } $response = $handler->handle($request); if ($pageIndexerRequestHandler instanceof PageIndexerRequestHandler && $pageIndexerRequest instanceof PageIndexerRequest) { $pageIndexResponse = $pageIndexerRequestHandler->shutdown($pageIndexerRequest); $body = new Stream('php://temp', 'rw');
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('noCache', true); } } $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);
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->securityAspect->setReceivedRequestToken(false); $this->logger->debug('Could not resolve request token', ['exception' => $exception]); } $response = $handler->handle($request); return $this->enrichResponseWithCookie($request, $response); } protected function resolveNoncePool(ServerRequestInterface $request): NoncePool
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
) { 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); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$request = $request->withAttribute('routing', $routeResult); if ($routeResult->getLanguage() instanceof SiteLanguage) { Locales::setSystemLocaleFromSiteLanguage($routeResult->getLanguage()); } return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
{ $eID = $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null; if ($eID === null) { return $handler->handle($request); } // Remove any output produced until now ob_clean();
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 { $request = $request->withAttribute('normalizedParams', NormalizedParams::createFromRequest($request)); return $handler->handle($request); } }
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 { $GLOBALS['TYPO3_REQUEST'] = $GLOBALS['TYPO3_REQUEST'] ?? $request; return $handler->handle($request); } }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
1396795884 ); } return $handler->handle($request); } /** * Checks if the provided host header value matches the trusted hosts pattern.
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$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 (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* Invoke the middleware stack */ public function handle(ServerRequestInterface $request): ResponseInterface { return $this->tip->handle($request); } /** * Seed the middleware stack with the inner request handler
public function handle(ServerRequestInterface $request): ResponseInterface { try { $response = $this->requestHandler->handle($request); } catch (ImmediateResponseException $exception) { $response = $exception->getResponse(); } return $response;
// 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); } /** * Create a PSR-7 Response that redirects to the install tool
* Set up the application and shut it down afterwards */ final public function run() { $response = $this->handle(ServerRequestFactory::fromGlobals()); $this->sendResponse($response); } }
// Set up the application for the frontend call_user_func(static function () { $classLoader = require dirname(__DIR__).'/vendor/autoload.php'; \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(); });
call_user_func(static function () { $classLoader = require dirname(__DIR__).'/vendor/autoload.php'; \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(); });