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); } return $this->platform;
$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.
public function get($entryIdentifier) { $this->throwExceptionIfFrontendDoesNotExist(); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable($this->cacheTable); $cacheRow = $queryBuilder->select('content') ->from($this->cacheTable) ->where( $queryBuilder->expr()->eq(
'"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1233058294 ); } $rawResult = $this->backend->get($entryIdentifier); if ($rawResult === false) { return false; } return $this->backend instanceof TransientBackendInterface ? $rawResult : unserialize($rawResult);
* Fetches all redirects available to the system, grouped by domain and regexp/nonregexp */ public function getRedirects(string $sourceHost): array { $redirects = $this->cache->get($this->buildCacheIdentifier($sourceHost)); // empty array is considered as valid cache, so we need to check for array type here. if (!is_array($redirects)) { $redirects = $this->rebuildForHost($sourceHost); }
* grouped by the domain does NOT take starttime/endtime into account, as it is cached. */ protected function fetchRedirects(string $sourceHost): array { return $this->redirectCacheService->getRedirects($sourceHost); } /** * Check if the current request is actually a redirect, and then process the redirect.
)->getMatchedRedirect(); if ($matchedRedirect !== null && $matchedRedirect !== []) { return $matchedRedirect; } $redirects = $this->fetchRedirects($domainName); if (empty($redirects)) { continue; }
$port = $request->getUri()->getPort(); $matchedRedirect = $this->redirectService->matchRedirect( $request->getUri()->getHost() . ($port ? ':' . $port : ''), $request->getUri()->getPath(), $request->getUri()->getQuery() ); // If the matched redirect is found, resolve it, and check further if (is_array($matchedRedirect)) {
*/ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $this->request = $request; return parent::process($request, $handler); } /** * @inheritDoc
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
if ($this->context->getAspect('frontend.user')->isLoggedIn() && $rateLimiter) { $rateLimiter->reset(); } $response = $handler->handle($request); // Store session data for fe_users if it still exists if ($frontendUser instanceof FrontendUserAuthentication) { $frontendUser->storeSessionData();
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); } }; } }
} $cache->set(md5('jobslect'), $result); return new JsonResponse($result); } 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 { $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); } }; } }
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);
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); } return $this->platform;
$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.
public function get($entryIdentifier) { $this->throwExceptionIfFrontendDoesNotExist(); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable($this->cacheTable); $cacheRow = $queryBuilder->select('content') ->from($this->cacheTable) ->where( $queryBuilder->expr()->eq(
'"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1233058294 ); } $rawResult = $this->backend->get($entryIdentifier); if ($rawResult === false) { return false; } return $this->backend instanceof TransientBackendInterface ? $rawResult : unserialize($rawResult);
* Fetches all redirects available to the system, grouped by domain and regexp/nonregexp */ public function getRedirects(string $sourceHost): array { $redirects = $this->cache->get($this->buildCacheIdentifier($sourceHost)); // empty array is considered as valid cache, so we need to check for array type here. if (!is_array($redirects)) { $redirects = $this->rebuildForHost($sourceHost); }
* grouped by the domain does NOT take starttime/endtime into account, as it is cached. */ protected function fetchRedirects(string $sourceHost): array { return $this->redirectCacheService->getRedirects($sourceHost); } /** * Check if the current request is actually a redirect, and then process the redirect.
)->getMatchedRedirect(); if ($matchedRedirect !== null && $matchedRedirect !== []) { return $matchedRedirect; } $redirects = $this->fetchRedirects($domainName); if (empty($redirects)) { continue; }
$port = $request->getUri()->getPort(); $matchedRedirect = $this->redirectService->matchRedirect( $request->getUri()->getHost() . ($port ? ':' . $port : ''), $request->getUri()->getPath(), $request->getUri()->getQuery() ); // If the matched redirect is found, resolve it, and check further if (is_array($matchedRedirect)) {
*/ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $this->request = $request; return parent::process($request, $handler); } /** * @inheritDoc
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
if ($this->context->getAspect('frontend.user')->isLoggedIn() && $rateLimiter) { $rateLimiter->reset(); } $response = $handler->handle($request); // Store session data for fe_users if it still exists if ($frontendUser instanceof FrontendUserAuthentication) { $frontendUser->storeSessionData();
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); } }; } }
} $cache->set(md5('jobslect'), $result); return new JsonResponse($result); } 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 { $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); } }; } }
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); }
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); } return $this->platform;
$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.
public function get($entryIdentifier) { $this->throwExceptionIfFrontendDoesNotExist(); $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable($this->cacheTable); $cacheRow = $queryBuilder->select('content') ->from($this->cacheTable) ->where( $queryBuilder->expr()->eq(
'"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1233058294 ); } $rawResult = $this->backend->get($entryIdentifier); if ($rawResult === false) { return false; } return $this->backend instanceof TransientBackendInterface ? $rawResult : unserialize($rawResult);
* Fetches all redirects available to the system, grouped by domain and regexp/nonregexp */ public function getRedirects(string $sourceHost): array { $redirects = $this->cache->get($this->buildCacheIdentifier($sourceHost)); // empty array is considered as valid cache, so we need to check for array type here. if (!is_array($redirects)) { $redirects = $this->rebuildForHost($sourceHost); }
* grouped by the domain does NOT take starttime/endtime into account, as it is cached. */ protected function fetchRedirects(string $sourceHost): array { return $this->redirectCacheService->getRedirects($sourceHost); } /** * Check if the current request is actually a redirect, and then process the redirect.
)->getMatchedRedirect(); if ($matchedRedirect !== null && $matchedRedirect !== []) { return $matchedRedirect; } $redirects = $this->fetchRedirects($domainName); if (empty($redirects)) { continue; }
$port = $request->getUri()->getPort(); $matchedRedirect = $this->redirectService->matchRedirect( $request->getUri()->getHost() . ($port ? ':' . $port : ''), $request->getUri()->getPath(), $request->getUri()->getQuery() ); // If the matched redirect is found, resolve it, and check further if (is_array($matchedRedirect)) {
*/ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $this->request = $request; return parent::process($request, $handler); } /** * @inheritDoc
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
if ($this->context->getAspect('frontend.user')->isLoggedIn() && $rateLimiter) { $rateLimiter->reset(); } $response = $handler->handle($request); // Store session data for fe_users if it still exists if ($frontendUser instanceof FrontendUserAuthentication) { $frontendUser->storeSessionData();
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); } }; } }
} $cache->set(md5('jobslect'), $result); return new JsonResponse($result); } 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 { $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); } }; } }
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(); });