case '1566': return new Exception\NotNullConstraintViolationException($message, $exception); } return new Exception\DriverException($message, $exception); } /** * {@inheritdoc}
return $driverEx; } if ($driver instanceof ExceptionConverterDriver && $driverEx instanceof DriverExceptionInterface) { return $driver->convertException($msg, $driverEx); } return new self($msg, 0, $driverEx); }
} $msg .= ":\n\n" . $driverEx->getMessage(); return static::wrapException($driver, $driverEx, $msg); } /** * @return self
throw DBALException::driverExceptionDuringQuery( $this->_driver, $ex, $sql, $this->resolveParams($params, $types) ); } if ($logger) {
return $this->executeUpdate( 'DELETE FROM ' . $table . ' WHERE ' . implode(' AND ', $conditions), $values, is_string(key($types)) ? $this->extractTypeValues($columns, $types) : $types ); } /**
{ return parent::delete( $this->quoteIdentifier($tableName), $this->quoteColumnValuePairs($identifier), $this->quoteColumnTypes($types) ); } /**
$numberOfRowsRemoved = GeneralUtility::makeInstance(ConnectionPool::class) ->getConnectionForTable($this->cacheTable) ->delete( $this->cacheTable, ['identifier' => $entryIdentifier] ); GeneralUtility::makeInstance(ConnectionPool::class) ->getConnectionForTable($this->tagsTable) ->delete(
if ($lifetime === 0 || $lifetime > $this->maximumLifetime) { $lifetime = $this->maximumLifetime; } $expires = $GLOBALS['EXEC_TIME'] + $lifetime; $this->remove($entryIdentifier); if ($this->compression) { $data = gzcompress($data, $this->compressionLevel); } GeneralUtility::makeInstance(ConnectionPool::class)
} if (!$this->backend instanceof TransientBackendInterface) { $variable = serialize($variable); } $this->backend->set($entryIdentifier, $variable, $tags, $lifetime); } /** * Finds and returns a variable value from the cache.
$cache = $this->getCache(); $cachedData = $cache->get($this->hash); if (!is_array($cachedData)) { $this->generate(); $cache->set($this->hash, $this->result, ['ident_MENUDATA'], (int)$cacheTimeout); } else { $this->result = $cachedData; } // End showAccessRestrictedPages
$GLOBALS['TSFE']->register['count_HMENU_MENUOBJ'] = 0; $GLOBALS['TSFE']->register['count_MENUOBJ'] = 0; $menu->parent_cObj = $this->cObj; $menu->start($GLOBALS['TSFE']->tmpl, $GLOBALS['TSFE']->sys_page, '', $conf, 1); $menu->makeMenu(); $theValue .= $menu->writeMenu(); } catch (NoSuchMenuTypeException $e) { } $wrap = isset($conf['wrap.']) ? $this->cObj->stdWrap($conf['wrap'], $conf['wrap.']) : $conf['wrap'];
$this->validateAndBuildConfiguration(); // Process Configuration $menuContentObject = $cObj->getContentObject('HMENU'); $renderedMenu = $menuContentObject->render($this->menuConfig); if ($renderedMenu) { // Process menu $menu = json_decode($renderedMenu, true); $processedMenu = [];
if ((int)$this->getTypoScriptFrontendController()->page['no_index'] === 1) { return; } $languages = $this->languageMenuProcessor->process($this->cObj, [], [], []); /** @var SiteLanguage $siteLanguage */ $siteLanguage = $event->getRequest()->getAttribute('language'); $pageId = (int)$this->getTypoScriptFrontendController()->id;
if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { return $event; } foreach ($this->listenerProvider->getListenersForEvent($event) as $listener) { $listener($event); if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { break; } }
protected function generateHrefLangTags(TypoScriptFrontendController $controller, ServerRequestInterface $request): void { $hrefLangs = $this->eventDispatcher->dispatch( new ModifyHrefLangTagsEvent($request) )->getHrefLangs(); if (count($hrefLangs) > 1) { $data = []; foreach ($hrefLangs as $hrefLang => $href) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Frontend\Page\PageGenerator']['generateMetaTags'] ?? [] as $_funcRef) { GeneralUtility::callUserFunction($_funcRef, $_params, $_ref); } $this->generateHrefLangTags($controller, $request); $this->generateMetaTagHtml( $controller->pSetup['meta.'] ?? [], $controller->cObj );
if ($controller->config['config']['disableAllHeaderCode'] ?? false) { return $pageContent; } // Now, populate pageRenderer with all additional data $this->processHtmlBasedRenderingSettings($controller, $controller->getLanguage(), $request); $pageRenderer = $this->getPageRenderer(); // Add previously generated page content within the <body> tag afterwards $pageRenderer->addBodyContent(LF . $pageContent); if ($controller->isINTincScript()) {
// Content generation $this->timeTracker->incStackPointer(); $this->timeTracker->push($controller->sPre, 'PAGE'); $controller->content = $this->generatePageContent($controller, $request); $this->timeTracker->pull($this->timeTracker->LR ? $controller->content : ''); $this->timeTracker->decStackPointer();
// Throw away all output that may have happened during bootstrapping by weird extensions ob_clean(); // Initialize output compression if configured $this->initializeOutputCompression(); return $handler->handle($request); } /** * Initialize output compression if configured
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* @return ResponseInterface */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if ( !($response instanceof NullResponse) && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController && $GLOBALS['TSFE']->isOutputting(true)) {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
return new RedirectResponse($externalUrl, 303); } } return $handler->handle($request); } protected function getRedirectUri(ServerRequestInterface $request): ?string {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->convertCharsetRecursivelyToUtf8($parsedBody, $this->controller->metaCharset); $request = $request->withParsedBody($parsedBody); } } return $handler->handle($request); } /** * Small helper function to convert charsets for arrays to UTF-8
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
} // Make TSFE globally available $GLOBALS['TSFE'] = $controller; return $handler->handle($request); } /** * Register the backend user as aspect
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$previewAspect = GeneralUtility::makeInstance(PreviewAspect::class, $isPreview); $this->context->setAspect('frontend.preview', $previewAspect); } return $handler->handle($request); } /** * Simulate dates for preview functionality
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$pageArguments = $request->getAttribute('routing', null); if ($pageArguments instanceof PageArguments && $GLOBALS['BE_USER'] instanceof PreviewUserAuthentication) { $GLOBALS['BE_USER']->setWebmounts([$pageArguments->getPageId()]); } 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('noCache', $this->disableCache); return $handler->handle($request); } /** * Filters out the arguments that are necessary for calculating cHash
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// merge the PageArguments with the request query parameters $queryParams = array_replace_recursive($request->getQueryParams(), $pageArguments->getArguments()); $request = $request->withQueryParams($queryParams); 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); } }; } }
$addInformationAboutDisabledCache = true; $setCookieOnCurrentRequest = false; } $response = $handler->handle($request); if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController && $addInformationAboutDisabledCache) { $GLOBALS['TSFE']->set_no_cache('GET Parameter ADMCMD_prev=LIVE was given', true); }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
return new HtmlResponse($content, 200, ['Content-Type' => $contentType]); } } return $handler->handle($request); } /** * Find the proper configuration for the static route in the static route configuration. Mainly:
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$uri = $requestedUri->withPath(rtrim($requestedUri->getPath(), '/')); return new RedirectResponse($uri, 307); } } return $handler->handle($request); } /** * Checks if the language is allowed in Frontend, if not, check if there is valid BE user
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// 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();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
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);
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); } }; } }
$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); } }; } }
* @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { return $this->tip->handle($request); } /** * Seed the middleware stack with the inner request handler
* @return ResponseInterface */ protected function handle(ServerRequestInterface $request): ResponseInterface { return $this->requestHandler->handle($request); } /** * Set up the application and shut it down afterwards
// 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
final public function run(callable $execute = null) { try { $response = $this->handle( ServerRequestFactory::fromGlobals() ); if ($execute !== null) { call_user_func($execute); }
// Set up the application for the frontend call_user_func(function () { $classLoader = require __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(function () { $classLoader = require __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(); });
} } if (! $this->_stmt->execute()) { throw new MysqliException($this->_stmt->error, $this->_stmt->sqlstate, $this->_stmt->errno); } if ($this->_columnNames === null) { $meta = $this->_stmt->result_metadata();
$stmt = $connection->prepare($sql); if ($types) { $this->_bindTypedValues($stmt, $params, $types); $stmt->execute(); } else { $stmt->execute($params); }
return $this->executeUpdate( 'DELETE FROM ' . $table . ' WHERE ' . implode(' AND ', $conditions), $values, is_string(key($types)) ? $this->extractTypeValues($columns, $types) : $types ); } /**
{ return parent::delete( $this->quoteIdentifier($tableName), $this->quoteColumnValuePairs($identifier), $this->quoteColumnTypes($types) ); } /**
$numberOfRowsRemoved = GeneralUtility::makeInstance(ConnectionPool::class) ->getConnectionForTable($this->cacheTable) ->delete( $this->cacheTable, ['identifier' => $entryIdentifier] ); GeneralUtility::makeInstance(ConnectionPool::class) ->getConnectionForTable($this->tagsTable) ->delete(
if ($lifetime === 0 || $lifetime > $this->maximumLifetime) { $lifetime = $this->maximumLifetime; } $expires = $GLOBALS['EXEC_TIME'] + $lifetime; $this->remove($entryIdentifier); if ($this->compression) { $data = gzcompress($data, $this->compressionLevel); } GeneralUtility::makeInstance(ConnectionPool::class)
} if (!$this->backend instanceof TransientBackendInterface) { $variable = serialize($variable); } $this->backend->set($entryIdentifier, $variable, $tags, $lifetime); } /** * Finds and returns a variable value from the cache.
$cache = $this->getCache(); $cachedData = $cache->get($this->hash); if (!is_array($cachedData)) { $this->generate(); $cache->set($this->hash, $this->result, ['ident_MENUDATA'], (int)$cacheTimeout); } else { $this->result = $cachedData; } // End showAccessRestrictedPages
$GLOBALS['TSFE']->register['count_HMENU_MENUOBJ'] = 0; $GLOBALS['TSFE']->register['count_MENUOBJ'] = 0; $menu->parent_cObj = $this->cObj; $menu->start($GLOBALS['TSFE']->tmpl, $GLOBALS['TSFE']->sys_page, '', $conf, 1); $menu->makeMenu(); $theValue .= $menu->writeMenu(); } catch (NoSuchMenuTypeException $e) { } $wrap = isset($conf['wrap.']) ? $this->cObj->stdWrap($conf['wrap'], $conf['wrap.']) : $conf['wrap'];
$this->validateAndBuildConfiguration(); // Process Configuration $menuContentObject = $cObj->getContentObject('HMENU'); $renderedMenu = $menuContentObject->render($this->menuConfig); if ($renderedMenu) { // Process menu $menu = json_decode($renderedMenu, true); $processedMenu = [];
if ((int)$this->getTypoScriptFrontendController()->page['no_index'] === 1) { return; } $languages = $this->languageMenuProcessor->process($this->cObj, [], [], []); /** @var SiteLanguage $siteLanguage */ $siteLanguage = $event->getRequest()->getAttribute('language'); $pageId = (int)$this->getTypoScriptFrontendController()->id;
if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { return $event; } foreach ($this->listenerProvider->getListenersForEvent($event) as $listener) { $listener($event); if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { break; } }
protected function generateHrefLangTags(TypoScriptFrontendController $controller, ServerRequestInterface $request): void { $hrefLangs = $this->eventDispatcher->dispatch( new ModifyHrefLangTagsEvent($request) )->getHrefLangs(); if (count($hrefLangs) > 1) { $data = []; foreach ($hrefLangs as $hrefLang => $href) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Frontend\Page\PageGenerator']['generateMetaTags'] ?? [] as $_funcRef) { GeneralUtility::callUserFunction($_funcRef, $_params, $_ref); } $this->generateHrefLangTags($controller, $request); $this->generateMetaTagHtml( $controller->pSetup['meta.'] ?? [], $controller->cObj );
if ($controller->config['config']['disableAllHeaderCode'] ?? false) { return $pageContent; } // Now, populate pageRenderer with all additional data $this->processHtmlBasedRenderingSettings($controller, $controller->getLanguage(), $request); $pageRenderer = $this->getPageRenderer(); // Add previously generated page content within the <body> tag afterwards $pageRenderer->addBodyContent(LF . $pageContent); if ($controller->isINTincScript()) {
// Content generation $this->timeTracker->incStackPointer(); $this->timeTracker->push($controller->sPre, 'PAGE'); $controller->content = $this->generatePageContent($controller, $request); $this->timeTracker->pull($this->timeTracker->LR ? $controller->content : ''); $this->timeTracker->decStackPointer();
// Throw away all output that may have happened during bootstrapping by weird extensions ob_clean(); // Initialize output compression if configured $this->initializeOutputCompression(); return $handler->handle($request); } /** * Initialize output compression if configured
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
* @return ResponseInterface */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); if ( !($response instanceof NullResponse) && $GLOBALS['TSFE'] instanceof TypoScriptFrontendController && $GLOBALS['TSFE']->isOutputting(true)) {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
return new RedirectResponse($externalUrl, 303); } } return $handler->handle($request); } protected function getRedirectUri(ServerRequestInterface $request): ?string {
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$this->convertCharsetRecursivelyToUtf8($parsedBody, $this->controller->metaCharset); $request = $request->withParsedBody($parsedBody); } } return $handler->handle($request); } /** * Small helper function to convert charsets for arrays to UTF-8
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
} // Make TSFE globally available $GLOBALS['TSFE'] = $controller; return $handler->handle($request); } /** * Register the backend user as aspect
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$previewAspect = GeneralUtility::makeInstance(PreviewAspect::class, $isPreview); $this->context->setAspect('frontend.preview', $previewAspect); } return $handler->handle($request); } /** * Simulate dates for preview functionality
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$pageArguments = $request->getAttribute('routing', null); if ($pageArguments instanceof PageArguments && $GLOBALS['BE_USER'] instanceof PreviewUserAuthentication) { $GLOBALS['BE_USER']->setWebmounts([$pageArguments->getPageId()]); } 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('noCache', $this->disableCache); return $handler->handle($request); } /** * Filters out the arguments that are necessary for calculating cHash
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// merge the PageArguments with the request query parameters $queryParams = array_replace_recursive($request->getQueryParams(), $pageArguments->getArguments()); $request = $request->withQueryParams($queryParams); 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); } }; } }
$addInformationAboutDisabledCache = true; $setCookieOnCurrentRequest = false; } $response = $handler->handle($request); if ($GLOBALS['TSFE'] instanceof TypoScriptFrontendController && $addInformationAboutDisabledCache) { $GLOBALS['TSFE']->set_no_cache('GET Parameter ADMCMD_prev=LIVE was given', true); }
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
return new HtmlResponse($content, 200, ['Content-Type' => $contentType]); } } return $handler->handle($request); } /** * Find the proper configuration for the static route in the static route configuration. Mainly:
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
$uri = $requestedUri->withPath(rtrim($requestedUri->getPath(), '/')); return new RedirectResponse($uri, 307); } } return $handler->handle($request); } /** * Checks if the language is allowed in Frontend, if not, check if there is valid BE user
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
// 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();
if (!$middleware instanceof MiddlewareInterface) { throw new \InvalidArgumentException(get_class($middleware) . ' does not implement ' . MiddlewareInterface::class, 1516821342); } return $middleware->process($request, $this->next); } }; } }
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);
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); } }; } }
$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); } }; } }
* @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { return $this->tip->handle($request); } /** * Seed the middleware stack with the inner request handler
* @return ResponseInterface */ protected function handle(ServerRequestInterface $request): ResponseInterface { return $this->requestHandler->handle($request); } /** * Set up the application and shut it down afterwards
// 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
final public function run(callable $execute = null) { try { $response = $this->handle( ServerRequestFactory::fromGlobals() ); if ($execute !== null) { call_user_func($execute); }
// Set up the application for the frontend call_user_func(function () { $classLoader = require __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(function () { $classLoader = require __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(); });