[!!!][TASK] Remove PHP library inclusion in FE 84/40484/3
authorBenjamin Mack <benni@typo3.org>
Sat, 20 Jun 2015 10:58:24 +0000 (12:58 +0200)
committerBenjamin Mack <benni@typo3.org>
Sat, 20 Jun 2015 12:11:11 +0000 (14:11 +0200)
The functionality to add PHP include files
during the Frontend request is quite old and
obsolete as there are plenty of hooks available.

The functionality is in this case obsolete as it does
not apply to the design patterns we apply nowadays.

This patch removes the the library inclusion and
the associated TypoScript options and PHP function.

Resolves: #67646
Releases: master
Change-Id: I376d0ed5eed324a1a0202021529ed526a48edab4
Reviewed-on: http://review.typo3.org/40484
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Daniel Maier <dani-maier@gmx.de>
Tested-by: Daniel Maier <dani-maier@gmx.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Documentation/Changelog/master/Breaking-67646-LibraryInclusionInFrontend.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/Page/PageGenerator.php
typo3/sysext/frontend/Classes/RequestHandler.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-67646-LibraryInclusionInFrontend.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-67646-LibraryInclusionInFrontend.rst
new file mode 100644 (file)
index 0000000..6950b1e
--- /dev/null
@@ -0,0 +1,31 @@
+============================================================
+Breaking: #67646 - PHP library inclusion in frontend removed
+============================================================
+
+Description
+===========
+
+The PHP library inclusion into the TYPO3 Frontend has been removed without substitution.
+Previously it was used to include plain PHP scripts during the Frontend request.
+
+The method ``PageGenerator::getIncFiles()`` has been removed.
+
+
+Impact
+======
+
+The TypoScript options ``config.includeLibrary`` and ``config.includeLibs`` have no effect anymore.
+Any calls to ``PageGenerator::getIncFiles()`` will result in a fatal error.
+
+
+Affected Installations
+======================
+
+Any installation using the TypoScript options named above.
+Any third party code using the method named above.
+
+
+Migration
+=========
+
+Use hooks during the Frontend set up to execute custom PHP code.
index 2d08abe..bf65b17 100644 (file)
@@ -167,42 +167,6 @@ class PageGenerator {
        }
 
        /**
-        * Returns an array with files to include. These files are the ones set up in TypoScript config.
-        *
-        * @return array Files to include. Paths are relative to PATH_site.
-        */
-       static public function getIncFiles() {
-               /** @var TypoScriptFrontendController $tsfe */
-               $tsfe = $GLOBALS['TSFE'];
-               $incFilesArray = array();
-               // Get files from config.includeLibrary
-               $includeLibrary = trim('' . $tsfe->config['config']['includeLibrary']);
-               if ($includeLibrary) {
-                       $incFile = $tsfe->tmpl->getFileName($includeLibrary);
-                       if ($incFile) {
-                               $incFilesArray[] = $incFile;
-                       }
-               }
-               if (is_array($tsfe->pSetup['includeLibs.'])) {
-                       $incLibs = $tsfe->pSetup['includeLibs.'];
-               } else {
-                       $incLibs = array();
-               }
-               if (is_array($tsfe->tmpl->setup['includeLibs.'])) {
-                       // toplevel 'includeLibs' is added to the PAGE.includeLibs. In that way, PAGE-libs get first priority, because if the key already exist, it's not altered. (Due to investigation by me)
-                       $incLibs += $tsfe->tmpl->setup['includeLibs.'];
-               }
-               if (count($incLibs)) {
-                       foreach ($incLibs as $theLib) {
-                               if (!is_array($theLib) && ($incFile = $tsfe->tmpl->getFileName($theLib))) {
-                                       $incFilesArray[] = $incFile;
-                               }
-                       }
-               }
-               return $incFilesArray;
-       }
-
-       /**
         * Processing JavaScript handlers
         *
         * @return array Array with a) a JavaScript section with event handlers and variables set and b) an array with attributes for the body tag.
index e1be073..d43dae6 100644 (file)
@@ -200,11 +200,6 @@ class RequestHandler implements RequestHandlerInterface {
                                PageGenerator::pagegenInit();
                                // Global content object
                                $this->controller->newCObj();
-                               // LIBRARY INCLUSION, TypoScript
-                               $temp_incFiles = PageGenerator::getIncFiles();
-                               foreach ($temp_incFiles as $temp_file) {
-                                       include_once './' . $temp_file;
-                               }
                                // Content generation
                                if (!$this->controller->isINTincScript()) {
                                        PageGenerator::renderContent();
@@ -216,11 +211,6 @@ class RequestHandler implements RequestHandlerInterface {
                        PageGenerator::pagegenInit();
                        // Global content object
                        $this->controller->newCObj();
-                       // LIBRARY INCLUSION, TypoScript
-                       $temp_incFiles = PageGenerator::getIncFiles();
-                       foreach ($temp_incFiles as $temp_file) {
-                               include_once './' . $temp_file;
-                       }
                }
                $this->controller->releaseLocks();
                $this->timeTracker->pull();