* :php:`TYPO3\CMS\Core\Resource\Utility\BackendUtility`
* :php:`TYPO3\CMS\Core\Utility\ClientUtility`
* :php:`TYPO3\CMS\Core\Utility\PhpOptionsUtility`
+* :php:`TYPO3\CMS\Frontend\Http\EidRequestHandler`
* :php:`TYPO3\CMS\Recordlist\Controller\ElementBrowserFramesetController`
* :php:`TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRecordList`
* :php:`TYPO3\CMS\Workspaces\Service\AutoPublishService`
* :php:`$GLOBALS['TYPO3_LOADED_EXT']`
+The following hooks have been removed:
+
+* :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preBeUser']`
+* :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc']`
+* :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission']`
+* :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest']`
+* :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB']`
+* :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo']`
+
+
The following feature is now always enabled:
* :php:`simplifiedControllerActionDispatching` - Backend controller actions do not receive a prepared response object anymore
-The following feature has been removed:
+The following features have been removed:
* Migration from v4 to v5 PackagesStates.php
+* `eID` script targets cannot define a script path anymore:
+ `$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['my_eID'] = 'EXT:benni/Scripts/download.php'` will not work anymore.
+ Instead, they must contain a target (callable, class/method, function).
Impact
* Outputs preview info.
*
* @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0. Use "hook_eofe" instead.
- * @param bool $isCoreCall if set to true, there will be no deprecation message.
*/
- public function previewInfo($isCoreCall = false)
+ public function previewInfo()
{
- if (!$isCoreCall) {
- trigger_error('$TSFE->previewInfo() will be removed in TYPO3 v10.0, as this is now called by the Frontend RequestHandler.', E_USER_DEPRECATED);
- } elseif (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo'])) {
- trigger_error('The hook "hook_previewInfo" will be removed in TYPO3 v10.0, but is still in use. Use "hook_eofe" instead.', E_USER_DEPRECATED);
- }
- if ($this->fePreview !== 0) {
- $previewInfo = '';
- $_params = ['pObj' => &$this];
- foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo'] ?? [] as $_funcRef) {
- $previewInfo .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
- }
- $this->content = str_ireplace('</body>', $previewInfo . '</body>', $this->content);
- }
+ trigger_error('$TSFE->previewInfo() will be removed in TYPO3 v10.0, as this is now called by the Frontend RequestHandler.', E_USER_DEPRECATED);
}
/**
+++ /dev/null
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Frontend\Http;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use Psr\Http\Message\ResponseInterface;
-use Psr\Http\Message\ServerRequestInterface;
-use Psr\Http\Server\RequestHandlerInterface as PsrRequestHandlerInterface;
-use TYPO3\CMS\Core\Exception;
-use TYPO3\CMS\Core\Http\Dispatcher;
-use TYPO3\CMS\Core\Http\NullResponse;
-use TYPO3\CMS\Core\Http\RequestHandlerInterface;
-use TYPO3\CMS\Core\Http\Response;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Frontend\Middleware\EidHandler as EidMiddleware;
-
-/**
- * Lightweight alternative to the regular RequestHandler used when $_GET[eID] is set.
- * In the future, logic from the EidUtility will be moved to this class.
- *
- * @deprecated since TYPO3 v9.2, will be removed in TYPO3 v10.0
- */
-class EidRequestHandler implements RequestHandlerInterface, PsrRequestHandlerInterface
-{
- /**
- * Constructor handing over the bootstrap and the original request
- */
- public function __construct()
- {
- trigger_error(self::class . ' will be removed in TYPO3 v10.0. Use ' . EidMiddleware::class . ' instead.', E_USER_DEPRECATED);
- }
-
- /**
- * Handles a frontend request based on the _GP "eID" variable.
- *
- * @param ServerRequestInterface $request
- * @return ResponseInterface
- */
- public function handleRequest(ServerRequestInterface $request): ResponseInterface
- {
- trigger_error(self::class . ' will be removed in TYPO3 v10.0. Use ' . EidMiddleware::class . ' instead.', E_USER_DEPRECATED);
- return $this->handle($request);
- }
-
- /**
- * This request handler can handle any frontend request.
- *
- * @param ServerRequestInterface $request The request to process
- * @return bool If the request is not an eID request, TRUE otherwise FALSE
- */
- public function canHandleRequest(ServerRequestInterface $request): bool
- {
- trigger_error(self::class . ' will be removed in TYPO3 v10.0. Use ' . EidMiddleware::class . ' instead.', E_USER_DEPRECATED);
- return !empty($request->getQueryParams()['eID']) || !empty($request->getParsedBody()['eID']);
- }
-
- /**
- * Returns the priority - how eager the handler is to actually handle the
- * request.
- *
- * @return int The priority of the request handler.
- */
- public function getPriority(): int
- {
- trigger_error(self::class . ' will be removed in TYPO3 v10.0. Use ' . EidMiddleware::class . ' instead.', E_USER_DEPRECATED);
- return 80;
- }
-
- /**
- * Dispatches the request to the corresponding eID class or eID script
- *
- * @param ServerRequestInterface $request
- * @return ResponseInterface
- * @throws Exception
- */
- public function handle(ServerRequestInterface $request): ResponseInterface
- {
- trigger_error(self::class . ' will be removed in TYPO3 v10.0. Use ' . EidMiddleware::class . ' instead.', E_USER_DEPRECATED);
- // Remove any output produced until now
- ob_clean();
-
- $eID = $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? '';
-
- if (empty($eID) || !isset($GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID])) {
- return (new Response())->withStatus(404, 'eID not registered');
- }
-
- $configuration = $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID];
-
- // Simple check to make sure that it's not an absolute file (to use the fallback)
- if (strpos($configuration, '::') !== false || is_callable($configuration)) {
- $dispatcher = GeneralUtility::makeInstance(Dispatcher::class);
- $request = $request->withAttribute('target', $configuration);
- return $dispatcher->dispatch($request);
- }
-
- $scriptPath = GeneralUtility::getFileAbsFileName($configuration);
- if ($scriptPath === '') {
- throw new Exception('Registered eID has invalid script path.', 1416391467);
- }
- include $scriptPath;
- return new NullResponse();
- }
-}
$response = $response->withHeader('X-TYPO3-Parsetime', $this->timeTracker->getParseTime() . 'ms');
}
- // Preview info
- // @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
- $controller->previewInfo(true);
-
// Hook for "end-of-frontend"
$_params = ['pObj' => &$controller];
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'] ?? [] as $_funcRef) {
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
- // PRE BE_USER HOOK
- if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'])) {
- trigger_error('The "preBeUser" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
- foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'] as $_funcRef) {
- $_params = [];
- GeneralUtility::callUserFunction($_funcRef, $_params, $GLOBALS['TSFE']);
- }
- }
-
// Initializing a possible logged-in Backend User
// If the backend cookie is set,
// we proceed and check if a backend user is logged in.
// Remove any output produced until now
ob_clean();
- if (empty($eID) || !isset($GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID])) {
+ $target = $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID] ?? null;
+ if (empty($target)) {
return (new Response())->withStatus(404, 'eID not registered');
}
- $configuration = $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$eID];
-
- // Simple check to make sure that it's not an absolute file (to use the fallback)
- if (strpos($configuration, '::') !== false || is_callable($configuration)) {
- $dispatcher = GeneralUtility::makeInstance(Dispatcher::class);
- $request = $request->withAttribute('target', $configuration);
- return $dispatcher->dispatch($request) ?? new NullResponse();
- }
- trigger_error(
- 'eID "' . $eID . '" is registered with a script to a file. This behaviour will be removed in TYPO3 v10.0.'
- . ' Register eID with a class::method syntax like "\MyVendor\MyExtension\Controller\MyEidController::myMethod" instead.',
- E_USER_DEPRECATED
- );
- $scriptPath = GeneralUtility::getFileAbsFileName($configuration);
- if ($scriptPath === '') {
- throw new Exception('Registered eID has invalid script path.', 1518042216);
- }
- include $scriptPath;
- return new NullResponse();
+ $dispatcher = GeneralUtility::makeInstance(Dispatcher::class);
+ $request = $request->withAttribute('target', $target);
+ return $dispatcher->dispatch($request) ?? new NullResponse();
}
}
} else {
// old-school page resolving for realurl, cooluri etc.
$this->controller->siteScript = $request->getAttribute('normalizedParams')->getSiteScript();
- if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc'])) {
- trigger_error('The "checkAlternativeIdMethods-PostProc" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
- $this->checkAlternativeIdMethods($this->controller);
- }
}
$this->controller->determineId();
unset($GLOBALS['BE_USER']);
// Register an empty backend user as aspect
$this->setBackendUserAspect(GeneralUtility::makeInstance(Context::class), null);
- if (!$hasSiteConfiguration) {
- $this->checkAlternativeIdMethods($this->controller);
- }
$this->controller->determineId();
}
return $handler->handle($request);
}
- /**
- * Provides ways to bypass the '?id=[xxx]&type=[xx]' format, using either PATH_INFO or Server Rewrites
- *
- * Two options:
- * 1) Use PATH_INFO (also Apache) to extract id and type from that var. Does not require any special modules compiled with apache. (less typical)
- * 2) Using hook which enables features like those provided from "realurl" extension (AKA "Speaking URLs")
- *
- * @param TypoScriptFrontendController $tsfe
- */
- protected function checkAlternativeIdMethods(TypoScriptFrontendController $tsfe)
- {
- // Call post processing function for custom URL methods.
- $_params = ['pObj' => &$tsfe];
- foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc'] ?? [] as $_funcRef) {
- GeneralUtility::callUserFunction($_funcRef, $_params, $tsfe);
- }
- }
-
/**
* @param string $pageId
* @return array|null
// @deprecated since TYPO3 v9.3, will be removed in TYPO3 v10.0
$this->controller->initializeRedirectUrlHandlers(true);
-
- // Hook for processing data submission to extensions
- // This is done at this point, because we need the config values
- if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'])) {
- trigger_error('The "checkDataSubmission" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
- foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'] as $className) {
- GeneralUtility::makeInstance($className)->checkDataSubmission($this->controller);
- }
- }
-
return $handler->handle($request);
}
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Calls a hook before processing a request for the TYPO3 Frontend.
if ($request->getMethod() === 'POST') {
$request = $request->withAttribute('_originalPostParameters', $_POST);
}
- // Set original parameters
- if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
- trigger_error('The "preprocessRequest" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
- foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
- $hookParameters = [];
- GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
- }
- }
return $handler->handle($request);
}
}
throw new ServiceUnavailableException($message, 1526013723);
}
}
- // Call post processing function for DB connection:
- if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'])) {
- trigger_error('The "connectToDB" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
- $_params = ['pObj' => &$GLOBALS['TSFE']];
- foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'] as $_funcRef) {
- GeneralUtility::callUserFunction($_funcRef, $_params, $GLOBALS['TSFE']);
- }
- }
-
return $handler->handle($request);
}
}
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'hook_previewInfo\']' => [
'restFiles' => [
'Deprecation-85878-EidUtilityAndVariousTSFEMethods.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'extbase\'][\'commandControllers\']' => [
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'tslib_fe-PostProc\']' => [
'restFiles' => [
'Deprecation-86279-VariousHooksAndPSR-15Middlewares.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'connectToDB\']' => [
'restFiles' => [
'Deprecation-86279-VariousHooksAndPSR-15Middlewares.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'initFEuser\']' => [
'restFiles' => [
'Deprecation-86279-VariousHooksAndPSR-15Middlewares.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/index_ts.php\'][\'preBeUser\']' => [
'restFiles' => [
'Deprecation-86279-VariousHooksAndPSR-15Middlewares.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/index_ts.php\'][\'postBeUser\']' => [
'restFiles' => [
'Deprecation-86279-VariousHooksAndPSR-15Middlewares.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'checkAlternativeIdMethods-PostProc\']' => [
'restFiles' => [
'Deprecation-86279-VariousHooksAndPSR-15Middlewares.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/index_ts.php\'][\'preprocessRequest\']' => [
'restFiles' => [
'Deprecation-86279-VariousHooksAndPSR-15Middlewares.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'$GLOBALS[\'TYPO3_CONF_VARS\'][\'SC_OPTIONS\'][\'tslib/class.tslib_fe.php\'][\'checkDataSubmission\']' => [
'restFiles' => [
'Deprecation-86279-VariousHooksAndPSR-15Middlewares.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
];
'TYPO3\CMS\Frontend\Http\EidRequestHandler' => [
'restFiles' => [
'Deprecation-83803-DeprecateEidRequestHandler.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Backend\Http\AjaxRequestHandler' => [