[!!!][TASK] Remove deprecated frontend-related hooks and include scripts
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / Middleware / TypoScriptFrontendInitialization.php
index 0838cec..b83d686 100644 (file)
@@ -35,7 +35,7 @@ use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
  * For now, GeneralUtility::_GP() is used in favor of $request->getQueryParams() due to
  * hooks who could have $_GET/$_POST modified before.
  *
- * @internal
+ * @internal this middleware might get removed in TYPO3 v10.0.
  */
 class TypoScriptFrontendInitialization implements MiddlewareInterface, LoggerAwareInterface
 {
@@ -56,11 +56,14 @@ class TypoScriptFrontendInitialization implements MiddlewareInterface, LoggerAwa
             null,
             GeneralUtility::_GP('id'),
             GeneralUtility::_GP('type'),
-            GeneralUtility::_GP('no_cache'),
+            null,
             GeneralUtility::_GP('cHash'),
             null,
             GeneralUtility::_GP('MP')
         );
+        if (GeneralUtility::_GP('no_cache')) {
+            $GLOBALS['TSFE']->set_no_cache('&no_cache=1 has been supplied, so caching is disabled! URL: "' . (string)$request->getUri() . '"');
+        }
 
         // Set up the database connection and see if the connection can be established
         try {
@@ -76,12 +79,6 @@ class TypoScriptFrontendInitialization implements MiddlewareInterface, LoggerAwa
                 throw new ServiceUnavailableException($message, 1526013723);
             }
         }
-        // Call post processing function for DB connection:
-        $_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);
     }
 }