[TASK] Remove tslib directory 60/32660/7
authorBenjamin Mack <benni@typo3.org>
Mon, 8 Sep 2014 20:56:55 +0000 (22:56 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Sun, 14 Sep 2014 22:21:00 +0000 (00:21 +0200)
The frontend parts are split into EXT:cms and EXT:frontend,
and the legacy directory "tslib" and the constant PATH_tslib
are hardly used anymore.

The patch moves the respective eIDs in the correct folders,
moves index_ts.php into a class and moves the frontend
page template into EXT:frontend. Thus, the tslib directory
can be removed completely.

Additionally an old reference to tslib in indexed_search
can be safely removed as well.

Releases: 6.3
Resolves: #61459
Change-Id: I9c19dcbeb7c18ef24b2fee3f997a12b7b8d0f957
Reviewed-on: http://review.typo3.org/32660
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
16 files changed:
index.php
typo3/sysext/cms/ext_localconf.php
typo3/sysext/cms/tslib/extdirecteid.php [deleted file]
typo3/sysext/cms/tslib/index_ts.php [deleted file]
typo3/sysext/cms/tslib/showpic.php [deleted file]
typo3/sysext/cms/tslib/templates/tslib_page_frontend.html [deleted file]
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-61459-RemovalTslib.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/FrontendRequestHandler.php [new file with mode: 0644]
typo3/sysext/frontend/Resources/PHP/Eid/ExtDirect.php [new file with mode: 0644]
typo3/sysext/frontend/Resources/PHP/Eid/ShowPic.php [new file with mode: 0644]
typo3/sysext/frontend/Resources/Private/Templates/MainPage.html [new file with mode: 0644]
typo3/sysext/frontend/ext_localconf.php
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php

index 1d52a83..1a4da31 100644 (file)
--- a/index.php
+++ b/index.php
  * This is the MAIN DOCUMENT of the TypoScript driven standard frontend.
  * Basically this is the "index.php" script which all requests for TYPO3
  * delivered pages goes to in the frontend (the website)
- *
- * @author René Fritz <r.fritz@colorcube.de>
  */
 
+define('TYPO3_MODE', 'FE');
+
 require __DIR__ . '/typo3/sysext/core/Classes/Core/Bootstrap.php';
 \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
        ->baseSetup('')
-       ->redirectToInstallerIfEssentialConfigurationDoesNotExist();
+       ->redirectToInstallerIfEssentialConfigurationDoesNotExist()
+       ->startOutputBuffering()
+       ->loadConfigurationAndInitialize();
 
-require(PATH_tslib . 'index_ts.php');
+$frontendRequestHandler = new \TYPO3\CMS\Frontend\FrontendRequestHandler();
+$frontendRequestHandler->handleRequest();
index 29c08f2..0da0a69 100644 (file)
@@ -178,7 +178,6 @@ mod.wizards.newContentElement {
 
 ');
 
-$TYPO3_CONF_VARS['FE']['eID_include']['tx_cms_showpic'] = 'EXT:cms/tslib/showpic.php';
 
 if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
        $TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['compat_version']['cms'] = array(
@@ -193,12 +192,6 @@ $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapC
 $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = 'TYPO3\\CMS\\Frontend\\Hooks\\TreelistCacheUpdateHooks';
 $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['moveRecordClass'][] = 'TYPO3\\CMS\\Frontend\\Hooks\\TreelistCacheUpdateHooks';
 
-if (TYPO3_MODE === 'FE') {
-       // Register the core media wizard provider
-       \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::registerMediaWizardProvider('TYPO3\\CMS\\Frontend\\MediaWizard\\MediaWizardProvider');
-       // Register eID provider for ExtDirect for the frontend
-       $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['ExtDirect'] = PATH_tslib . 'extdirecteid.php';
-}
 // Register search keys
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch']['page'] = 'pages';
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['livesearch']['content'] = 'tt_content';
diff --git a/typo3/sysext/cms/tslib/extdirecteid.php b/typo3/sysext/cms/tslib/extdirecteid.php
deleted file mode 100644 (file)
index 2b442c1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * 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!
- */
-if (!defined('PATH_typo3conf')) {
-       die('Could not access this script directly!');
-}
-$extDirectEidInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\ExtDirectEidController');
-if ($extDirectEidInstance->actionIsAllowed()) {
-       $extDirectEidInstance->routeAction();
-       $extDirectEidInstance->render();
-}
diff --git a/typo3/sysext/cms/tslib/index_ts.php b/typo3/sysext/cms/tslib/index_ts.php
deleted file mode 100644 (file)
index cdf9fdf..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-<?php
-/**
- * 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!
- */
-
-/**
- * This is the MAIN DOCUMENT of the TypoScript driven standard front-end (from
- * the "cms" extension)
- *
- * Basically put this is the "index.php" script which all requests for TYPO3
- * delivered pages goes to in the frontend (the website) The script configures
- * constants, includes libraries and does a little logic here and there in order
- * to instantiate the right classes to create the webpage.
- *
- * All the real data processing goes on in the "tslib/" classes which this script
- * will include and use as needed.
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-
-define('TYPO3_MODE', 'FE');
-
-\TYPO3\CMS\Core\Core\Bootstrap::getInstance()
-       ->startOutputBuffering()
-       ->loadConfigurationAndInitialize()
-       ->loadTypo3LoadedExtAndExtLocalconf(TRUE)
-       ->applyAdditionalConfigurationSettings();
-
-// Timetracking started
-$configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']);
-if (empty($configuredCookieName)) {
-       $configuredCookieName = 'be_typo_user';
-}
-if ($_COOKIE[$configuredCookieName]) {
-       $TT = new \TYPO3\CMS\Core\TimeTracker\TimeTracker();
-} else {
-       $TT = new \TYPO3\CMS\Core\TimeTracker\NullTimeTracker();
-}
-
-$TT->start();
-
-\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeTypo3DbGlobal();
-// Hook to preprocess the current request:
-if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
-       foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
-               $hookParameters = array();
-               \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
-       }
-       unset($hookFunction);
-       unset($hookParameters);
-}
-// Look for extension ID which will launch alternative output engine
-if ($temp_extId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('eID')) {
-       if ($classPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($TYPO3_CONF_VARS['FE']['eID_include'][$temp_extId])) {
-               // Remove any output produced until now
-               ob_clean();
-               require $classPath;
-       }
-       die;
-}
-
-/** @var $TSFE \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
-$TSFE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
-       'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController',
-       $TYPO3_CONF_VARS,
-       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'),
-       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('type'),
-       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('no_cache'),
-       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cHash'),
-       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('jumpurl'),
-       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('MP'),
-       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('RDCT')
-);
-
-if ($TYPO3_CONF_VARS['FE']['pageUnavailable_force']
-       && !\TYPO3\CMS\Core\Utility\GeneralUtility::cmpIP(
-               \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR'),
-               $TYPO3_CONF_VARS['SYS']['devIPmask'])
-) {
-       $TSFE->pageUnavailableAndExit('This page is temporarily unavailable.');
-}
-
-$TSFE->connectToDB();
-$TSFE->sendRedirect();
-
-// Output compression
-// Remove any output produced until now
-ob_clean();
-if ($TYPO3_CONF_VARS['FE']['compressionLevel'] && extension_loaded('zlib')) {
-       if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($TYPO3_CONF_VARS['FE']['compressionLevel'])) {
-               // Prevent errors if ini_set() is unavailable (safe mode)
-               @ini_set('zlib.output_compression_level', $TYPO3_CONF_VARS['FE']['compressionLevel']);
-       }
-       ob_start(array(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Utility\\CompressionUtility'), 'compressionOutputHandler'));
-}
-
-// FE_USER
-$TT->push('Front End user initialized', '');
-/** @var $TSFE \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
-$TSFE->initFEuser();
-$TT->pull();
-
-// BE_USER
-/** @var $BE_USER \TYPO3\CMS\Backend\FrontendBackendUserAuthentication */
-$BE_USER = $TSFE->initializeBackendUser();
-
-// Process the ID, type and other parameters.
-// After this point we have an array, $page in TSFE, which is the page-record
-// of the current page, $id.
-$TT->push('Process ID', '');
-// Initialize admin panel since simulation settings are required here:
-if ($TSFE->isBackendUserLoggedIn()) {
-       $BE_USER->initializeAdminPanel();
-       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(TRUE);
-} else {
-       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
-}
-$TSFE->checkAlternativeIdMethods();
-$TSFE->clear_preview();
-$TSFE->determineId();
-
-// Now, if there is a backend user logged in and he has NO access to this page,
-// then re-evaluate the id shown! _GP('ADMCMD_noBeUser') is placed here because
-// \TYPO3\CMS\Version\Hook\PreviewHook might need to know if a backend user is logged in.
-if (
-       $TSFE->isBackendUserLoggedIn()
-       && (!$BE_USER->extPageReadAccess($TSFE->page) || \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('ADMCMD_noBeUser'))
-) {
-       // Remove user
-       unset($BE_USER);
-       $TSFE->beUserLogin = FALSE;
-       // Re-evaluate the page-id.
-       $TSFE->checkAlternativeIdMethods();
-       $TSFE->clear_preview();
-       $TSFE->determineId();
-}
-
-$TSFE->makeCacheHash();
-$TT->pull();
-
-// Admin Panel & Frontend editing
-if ($TSFE->isBackendUserLoggedIn()) {
-       $BE_USER->initializeFrontendEdit();
-       if ($BE_USER->adminPanel instanceof \TYPO3\CMS\Frontend\View\AdminPanelView) {
-               \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
-                       ->initializeLanguageObject()
-                       ->initializeSpriteManager();
-       }
-       if ($BE_USER->frontendEdit instanceof \TYPO3\CMS\Core\FrontendEditing\FrontendEditingController) {
-               $BE_USER->frontendEdit->initConfigOptions();
-       }
-}
-
-// Starts the template
-$TT->push('Start Template', '');
-$TSFE->initTemplate();
-$TT->pull();
-// Get from cache
-$TT->push('Get Page from cache', '');
-$TSFE->getFromCache();
-$TT->pull();
-// Get config if not already gotten
-// After this, we should have a valid config-array ready
-$TSFE->getConfigArray();
-// Setting language and locale
-$TT->push('Setting language and locale', '');
-$TSFE->settingLanguage();
-$TSFE->settingLocale();
-$TT->pull();
-
-// Convert POST data to internal "renderCharset" if different from the metaCharset
-$TSFE->convPOSTCharset();
-
-// Check JumpUrl
-$TSFE->setExternalJumpUrl();
-$TSFE->checkJumpUrlReferer();
-
-$TSFE->handleDataSubmission();
-
-// Check for shortcut page and redirect
-$TSFE->checkPageForShortcutRedirect();
-
-// Generate page
-$TSFE->setUrlIdToken();
-$TT->push('Page generation', '');
-if ($TSFE->isGeneratePage()) {
-       $TSFE->generatePage_preProcessing();
-       $temp_theScript = $TSFE->generatePage_whichScript();
-       if ($temp_theScript) {
-               include $temp_theScript;
-       } else {
-               \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
-               // Global content object
-               $TSFE->newCObj();
-               // LIBRARY INCLUSION, TypoScript
-               $temp_incFiles = \TYPO3\CMS\Frontend\Page\PageGenerator::getIncFiles();
-               foreach ($temp_incFiles as $temp_file) {
-                       include_once './' . $temp_file;
-               }
-               // Content generation
-               if (!$TSFE->isINTincScript()) {
-                       \TYPO3\CMS\Frontend\Page\PageGenerator::renderContent();
-                       $TSFE->setAbsRefPrefix();
-               }
-       }
-       $TSFE->generatePage_postProcessing();
-} elseif ($TSFE->isINTincScript()) {
-       \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
-       // Global content object
-       $TSFE->newCObj();
-       // LIBRARY INCLUSION, TypoScript
-       $temp_incFiles = \TYPO3\CMS\Frontend\Page\PageGenerator::getIncFiles();
-       foreach ($temp_incFiles as $temp_file) {
-               include_once './' . $temp_file;
-       }
-}
-$TT->pull();
-
-// $TSFE->config['INTincScript']
-if ($TSFE->isINTincScript()) {
-       $TT->push('Non-cached objects', '');
-       $TSFE->INTincScript();
-       $TT->pull();
-}
-// Output content
-$sendTSFEContent = FALSE;
-if ($TSFE->isOutputting()) {
-       $TT->push('Print Content', '');
-       $TSFE->processOutput();
-       $sendTSFEContent = TRUE;
-       $TT->pull();
-}
-// Store session data for fe_users
-$TSFE->storeSessionData();
-// Statistics
-$TYPO3_MISC['microtime_end'] = microtime(TRUE);
-$TSFE->setParseTime();
-if (isset($TSFE->config['config']['debug'])) {
-       $debugParseTime = (bool)$TSFE->config['config']['debug'];
-} else {
-       $debugParseTime = !empty($TSFE->TYPO3_CONF_VARS['FE']['debug']);
-}
-if ($TSFE->isOutputting() && $debugParseTime) {
-       $TSFE->content .= LF . '<!-- Parsetime: ' . $TSFE->scriptParseTime . 'ms -->';
-}
-// Check JumpUrl
-$TSFE->jumpurl();
-// Preview info
-$TSFE->previewInfo();
-// Hook for end-of-frontend
-$TSFE->hook_eofe();
-// Finish timetracking
-$TT->pull();
-// Check memory usage
-\TYPO3\CMS\Core\Utility\MonitorUtility::peakMemoryUsage();
-// beLoginLinkIPList
-echo $TSFE->beLoginLinkIPList();
-
-// Admin panel
-if (
-       $TSFE->isBackendUserLoggedIn()
-       && $BE_USER instanceof \TYPO3\CMS\Backend\FrontendBackendUserAuthentication
-       && $BE_USER->isAdminPanelVisible()
-) {
-       $TSFE->content = str_ireplace('</head>', $BE_USER->adminPanel->getAdminPanelHeaderData() . '</head>', $TSFE->content);
-       $TSFE->content = str_ireplace('</body>', $BE_USER->displayAdminPanel() . '</body>', $TSFE->content);
-}
-
-if ($sendTSFEContent) {
-       echo $TSFE->content;
-}
-// Debugging Output
-if (isset($error) && is_object($error) && @is_callable(array($error, 'debugOutput'))) {
-       $error->debugOutput();
-}
-if (TYPO3_DLOG) {
-       \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('END of FRONTEND session', 'cms', 0, array('_FLUSH' => TRUE));
-}
-\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->shutdown();
diff --git a/typo3/sysext/cms/tslib/showpic.php b/typo3/sysext/cms/tslib/showpic.php
deleted file mode 100644 (file)
index 06bf643..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * 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!
- */
-
-/**
- * eID-Script for tx_cms_showpic
- *
- * Shows a picture from FAL in enlarged format in a separate window.
- * Picture file and settings is supplied by GET-parameters:
- *  - file = fileUid or Combined Identifier
- *  - encoded in an parameter Array (with weird format - see ContentObjectRenderer about ll. 1500)
- *     - width, height = usual width an height, m/c supported
- *     - sample = 0/1
- *     - effects
- *     - frame
- *     - bodyTag
- *     - title
- *     - wrap
- *  - md5 = actually contains an hmac
- */
-
-if (!defined('PATH_typo3conf')) {
-       die('The configuration path was not properly defined!');
-}
-
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\ShowImageController');
-$SOBE->execute();
diff --git a/typo3/sysext/cms/tslib/templates/tslib_page_frontend.html b/typo3/sysext/cms/tslib/templates/tslib_page_frontend.html
deleted file mode 100644 (file)
index f7be057..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-###XMLPROLOG_DOCTYPE###
-###HTMLTAG###
-###HEADTAG###
-
-###METACHARSET###
-###INLINECOMMENT###
-
-###BASEURL###
-###SHORTCUT###
-###TITLE###
-###META###
-
-###CSS_LIBS###
-###CSS_INCLUDE###
-###CSS_INLINE###
-
-###JS_LIBS###
-###JS_INCLUDE###
-###JS_INLINE###
-
-###HEADERDATA###
-</head>
-###BODY###
-###JS_LIBS_FOOTER###
-###JS_INCLUDE_FOOTER###
-###JS_INLINE_FOOTER###
-###FOOTERDATA###
-</body>
-</html>
index 7f3da0c..8da1c32 100644 (file)
@@ -167,9 +167,6 @@ class SystemEnvironmentBuilder {
                // Absolute path to the typo3conf directory with trailing slash
                // Example "/var/www/instance-name/htdocs/typo3conf/"
                define('PATH_typo3conf', PATH_site . 'typo3conf/');
-               // Absolute path to the tslib directory with trailing slash
-               // Example "/var/www/instance-name/htdocs/typo3/sysext/cms/tslib/"
-               define('PATH_tslib', PATH_typo3 . 'sysext/cms/tslib/');
        }
 
        /**
@@ -181,8 +178,8 @@ class SystemEnvironmentBuilder {
                if (!is_file(PATH_thisScript)) {
                        die('Unable to determine path to entry script.');
                }
-               if (!is_dir(PATH_tslib)) {
-                       die('Calculated absolute path to tslib directory does not exist.');
+               if (!is_dir(PATH_typo3 . 'sysext')) {
+                       die('Calculated absolute path to typo3/sysext directory does not exist.');
                }
        }
 
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-61459-RemovalTslib.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-61459-RemovalTslib.rst
new file mode 100644 (file)
index 0000000..91e9271
--- /dev/null
@@ -0,0 +1,31 @@
+===========================================================
+Breaking: #61459 - Removal of tslib directory and constant
+===========================================================
+
+Description
+===========
+
+The tslib/ directory and the constant PATH_tslib are removed.
+
+Impact
+======
+
+Extensions that still use PATH_tslib constant, and reference typo/sysext/cms/tslib/index_ts.php directly won't work.
+
+
+Affected installations
+======================
+
+A TYPO3 instance is affected if a 3rd party extension uses index_ts.php directly, or if the main index.php is not
+replaced with the TYPO3 Update (used on certain intallations). The index.php file must be replaced then with the
+current version from the TYPO3 CMS Core.
+
+Besides scripts are affected that access the time tracking ($TT) or typoscript frontend controller ($TSFE) objects without the
+$GLOBALS keyword.
+
+
+Migration
+=========
+
+Remove the constant PATH_tslib from the 3rd party extension, use a current version of index.php and use $GLOBALS['TT'] instead of
+$TT and/or $GLOBALS['TSFE'] instead of $TSFE to access the object.
\ No newline at end of file
index dce83df..23b19cd 100644 (file)
@@ -1048,7 +1048,7 @@ class TypoScriptFrontendController {
        public function getPageRenderer() {
                if (!isset($this->pageRenderer)) {
                        $this->pageRenderer = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Page\\PageRenderer');
-                       $this->pageRenderer->setTemplateFile(PATH_tslib . 'templates/tslib_page_frontend.html');
+                       $this->pageRenderer->setTemplateFile('EXT:frontend/Resources/Private/Templates/MainPage.html');
                        $this->pageRenderer->setBackPath(TYPO3_mainDir);
                }
                return $this->pageRenderer;
diff --git a/typo3/sysext/frontend/Classes/FrontendRequestHandler.php b/typo3/sysext/frontend/Classes/FrontendRequestHandler.php
new file mode 100644 (file)
index 0000000..78f53cb
--- /dev/null
@@ -0,0 +1,288 @@
+<?php
+namespace TYPO3\CMS\Frontend;
+/**
+ * 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!
+ */
+
+/**
+ * This is the MAIN DOCUMENT of the TypoScript driven standard front-end
+ *
+ * Basically put this is the script which all requests for TYPO3
+ * delivered pages goes to in the frontend (the website). The script configures
+ * constants, includes libraries and does a little logic here and there in order
+ * to instantiate the right classes to create the webpage.
+ */
+class FrontendRequestHandler {
+
+       /**
+        * Handles a frontend request
+        *
+        * @return void
+        */
+       public function handleRequest() {
+               \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
+                       ->loadTypo3LoadedExtAndExtLocalconf(TRUE)
+                       ->applyAdditionalConfigurationSettings();
+
+               // Timetracking started
+               $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']);
+               if (empty($configuredCookieName)) {
+                       $configuredCookieName = 'be_typo_user';
+               }
+               if ($_COOKIE[$configuredCookieName]) {
+                       $GLOBALS['TT'] = new \TYPO3\CMS\Core\TimeTracker\TimeTracker();
+               } else {
+                       $GLOBALS['TT'] = new \TYPO3\CMS\Core\TimeTracker\NullTimeTracker();
+               }
+
+               $GLOBALS['TT']->start();
+
+               \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeTypo3DbGlobal();
+               // Hook to preprocess the current request:
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
+                               $hookParameters = array();
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
+                       }
+                       unset($hookFunction);
+                       unset($hookParameters);
+               }
+               // Look for extension ID which will launch alternative output engine
+               if ($temp_extId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('eID')) {
+                       if ($classPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include'][$temp_extId])) {
+                               // Remove any output produced until now
+                               ob_clean();
+                               require $classPath;
+                       }
+                       die;
+               }
+
+               /** @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
+               $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
+                       'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController',
+                       $GLOBALS['TYPO3_CONF_VARS'],
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'),
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('type'),
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('no_cache'),
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('cHash'),
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('jumpurl'),
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('MP'),
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('RDCT')
+               );
+
+               if ($GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_force']
+                       && !\TYPO3\CMS\Core\Utility\GeneralUtility::cmpIP(
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR'),
+                               $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])
+               ) {
+                       $GLOBALS['TSFE']->pageUnavailableAndExit('This page is temporarily unavailable.');
+               }
+
+               $GLOBALS['TSFE']->connectToDB();
+               $GLOBALS['TSFE']->sendRedirect();
+
+               // Output compression
+               // Remove any output produced until now
+               ob_clean();
+               if ($GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] && extension_loaded('zlib')) {
+                       if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'])) {
+                               // Prevent errors if ini_set() is unavailable (safe mode)
+                               @ini_set('zlib.output_compression_level', $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel']);
+                       }
+                       ob_start(array(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Utility\\CompressionUtility'), 'compressionOutputHandler'));
+               }
+
+               // FE_USER
+               $GLOBALS['TT']->push('Front End user initialized', '');
+               /** @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
+               $GLOBALS['TSFE']->initFEuser();
+               $GLOBALS['TT']->pull();
+
+               // BE_USER
+               /** @var $GLOBALS['BE_USER'] \TYPO3\CMS\Backend\FrontendBackendUserAuthentication */
+               $GLOBALS['BE_USER'] = $GLOBALS['TSFE']->initializeBackendUser();
+
+               // Process the ID, type and other parameters.
+               // After this point we have an array, $page in TSFE, which is the page-record
+               // of the current page, $id.
+               $GLOBALS['TT']->push('Process ID', '');
+               // Initialize admin panel since simulation settings are required here:
+               if ($GLOBALS['TSFE']->isBackendUserLoggedIn()) {
+                       $GLOBALS['BE_USER']->initializeAdminPanel();
+                       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(TRUE);
+               } else {
+                       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadCachedTca();
+               }
+               $GLOBALS['TSFE']->checkAlternativeIdMethods();
+               $GLOBALS['TSFE']->clear_preview();
+               $GLOBALS['TSFE']->determineId();
+
+               // Now, if there is a backend user logged in and he has NO access to this page,
+               // then re-evaluate the id shown! _GP('ADMCMD_noBeUser') is placed here because
+               // \TYPO3\CMS\Version\Hook\PreviewHook might need to know if a backend user is logged in.
+               if (
+                       $GLOBALS['TSFE']->isBackendUserLoggedIn()
+                       && (!$GLOBALS['BE_USER']->extPageReadAccess($GLOBALS['TSFE']->page) || \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('ADMCMD_noBeUser'))
+               ) {
+                       // Remove user
+                       unset($GLOBALS['BE_USER']);
+                       $GLOBALS['TSFE']->beUserLogin = FALSE;
+                       // Re-evaluate the page-id.
+                       $GLOBALS['TSFE']->checkAlternativeIdMethods();
+                       $GLOBALS['TSFE']->clear_preview();
+                       $GLOBALS['TSFE']->determineId();
+               }
+
+               $GLOBALS['TSFE']->makeCacheHash();
+               $GLOBALS['TT']->pull();
+
+               // Admin Panel & Frontend editing
+               if ($GLOBALS['TSFE']->isBackendUserLoggedIn()) {
+                       $GLOBALS['BE_USER']->initializeFrontendEdit();
+                       if ($GLOBALS['BE_USER']->adminPanel instanceof \TYPO3\CMS\Frontend\View\AdminPanelView) {
+                               \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
+                                       ->initializeLanguageObject()
+                                       ->initializeSpriteManager();
+                       }
+                       if ($GLOBALS['BE_USER']->frontendEdit instanceof \TYPO3\CMS\Core\FrontendEditing\FrontendEditingController) {
+                               $GLOBALS['BE_USER']->frontendEdit->initConfigOptions();
+                       }
+               }
+
+               // Starts the template
+               $GLOBALS['TT']->push('Start Template', '');
+               $GLOBALS['TSFE']->initTemplate();
+               $GLOBALS['TT']->pull();
+               // Get from cache
+               $GLOBALS['TT']->push('Get Page from cache', '');
+               $GLOBALS['TSFE']->getFromCache();
+               $GLOBALS['TT']->pull();
+               // Get config if not already gotten
+               // After this, we should have a valid config-array ready
+               $GLOBALS['TSFE']->getConfigArray();
+               // Setting language and locale
+               $GLOBALS['TT']->push('Setting language and locale', '');
+               $GLOBALS['TSFE']->settingLanguage();
+               $GLOBALS['TSFE']->settingLocale();
+               $GLOBALS['TT']->pull();
+
+               // Convert POST data to internal "renderCharset" if different from the metaCharset
+               $GLOBALS['TSFE']->convPOSTCharset();
+
+               // Check JumpUrl
+               $GLOBALS['TSFE']->setExternalJumpUrl();
+               $GLOBALS['TSFE']->checkJumpUrlReferer();
+
+               $GLOBALS['TSFE']->handleDataSubmission();
+
+               // Check for shortcut page and redirect
+               $GLOBALS['TSFE']->checkPageForShortcutRedirect();
+
+               // Generate page
+               $GLOBALS['TSFE']->setUrlIdToken();
+               $GLOBALS['TT']->push('Page generation', '');
+               if ($GLOBALS['TSFE']->isGeneratePage()) {
+                       $GLOBALS['TSFE']->generatePage_preProcessing();
+                       $temp_theScript = $GLOBALS['TSFE']->generatePage_whichScript();
+                       if ($temp_theScript) {
+                               include $temp_theScript;
+                       } else {
+                               \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
+                               // Global content object
+                               $GLOBALS['TSFE']->newCObj();
+                               // LIBRARY INCLUSION, TypoScript
+                               $temp_incFiles = \TYPO3\CMS\Frontend\Page\PageGenerator::getIncFiles();
+                               foreach ($temp_incFiles as $temp_file) {
+                                       include_once './' . $temp_file;
+                               }
+                               // Content generation
+                               if (!$GLOBALS['TSFE']->isINTincScript()) {
+                                       \TYPO3\CMS\Frontend\Page\PageGenerator::renderContent();
+                                       $GLOBALS['TSFE']->setAbsRefPrefix();
+                               }
+                       }
+                       $GLOBALS['TSFE']->generatePage_postProcessing();
+               } elseif ($GLOBALS['TSFE']->isINTincScript()) {
+                       \TYPO3\CMS\Frontend\Page\PageGenerator::pagegenInit();
+                       // Global content object
+                       $GLOBALS['TSFE']->newCObj();
+                       // LIBRARY INCLUSION, TypoScript
+                       $temp_incFiles = \TYPO3\CMS\Frontend\Page\PageGenerator::getIncFiles();
+                       foreach ($temp_incFiles as $temp_file) {
+                               include_once './' . $temp_file;
+                       }
+               }
+               $GLOBALS['TT']->pull();
+
+               // $GLOBALS['TSFE']->config['INTincScript']
+               if ($GLOBALS['TSFE']->isINTincScript()) {
+                       $GLOBALS['TT']->push('Non-cached objects', '');
+                       $GLOBALS['TSFE']->INTincScript();
+                       $GLOBALS['TT']->pull();
+               }
+               // Output content
+               $sendTSFEContent = FALSE;
+               if ($GLOBALS['TSFE']->isOutputting()) {
+                       $GLOBALS['TT']->push('Print Content', '');
+                       $GLOBALS['TSFE']->processOutput();
+                       $sendTSFEContent = TRUE;
+                       $GLOBALS['TT']->pull();
+               }
+               // Store session data for fe_users
+               $GLOBALS['TSFE']->storeSessionData();
+               // Statistics
+               $GLOBALS['TYPO3_MISC']['microtime_end'] = microtime(TRUE);
+               $GLOBALS['TSFE']->setParseTime();
+               if (isset($GLOBALS['TSFE']->config['config']['debug'])) {
+                       $debugParseTime = (bool)$GLOBALS['TSFE']->config['config']['debug'];
+               } else {
+                       $debugParseTime = !empty($GLOBALS['TSFE']->TYPO3_CONF_VARS['FE']['debug']);
+               }
+               if ($GLOBALS['TSFE']->isOutputting() && $debugParseTime) {
+                       $GLOBALS['TSFE']->content .= LF . '<!-- Parsetime: ' . $GLOBALS['TSFE']->scriptParseTime . 'ms -->';
+               }
+               // Check JumpUrl
+               $GLOBALS['TSFE']->jumpurl();
+               // Preview info
+               $GLOBALS['TSFE']->previewInfo();
+               // Hook for end-of-frontend
+               $GLOBALS['TSFE']->hook_eofe();
+               // Finish timetracking
+               $GLOBALS['TT']->pull();
+               // Check memory usage
+               \TYPO3\CMS\Core\Utility\MonitorUtility::peakMemoryUsage();
+               // beLoginLinkIPList
+               echo $GLOBALS['TSFE']->beLoginLinkIPList();
+
+               // Admin panel
+               if (
+                       $GLOBALS['TSFE']->isBackendUserLoggedIn()
+                       && $GLOBALS['BE_USER'] instanceof \TYPO3\CMS\Backend\FrontendBackendUserAuthentication
+                       && $GLOBALS['BE_USER']->isAdminPanelVisible()
+               ) {
+                       $GLOBALS['TSFE']->content = str_ireplace('</head>', $GLOBALS['BE_USER']->adminPanel->getAdminPanelHeaderData() . '</head>', $GLOBALS['TSFE']->content);
+                       $GLOBALS['TSFE']->content = str_ireplace('</body>', $GLOBALS['BE_USER']->displayAdminPanel() . '</body>', $GLOBALS['TSFE']->content);
+               }
+
+               if ($sendTSFEContent) {
+                       echo $GLOBALS['TSFE']->content;
+               }
+               // Debugging Output
+               if (isset($GLOBALS['error']) && is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debugOutput'))) {
+                       $GLOBALS['error']->debugOutput();
+               }
+               if (TYPO3_DLOG) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('END of FRONTEND session', 'cms', 0, array('_FLUSH' => TRUE));
+               }
+               \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->shutdown();
+       }
+}
\ No newline at end of file
diff --git a/typo3/sysext/frontend/Resources/PHP/Eid/ExtDirect.php b/typo3/sysext/frontend/Resources/PHP/Eid/ExtDirect.php
new file mode 100644 (file)
index 0000000..2b442c1
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/**
+ * 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!
+ */
+if (!defined('PATH_typo3conf')) {
+       die('Could not access this script directly!');
+}
+$extDirectEidInstance = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\ExtDirectEidController');
+if ($extDirectEidInstance->actionIsAllowed()) {
+       $extDirectEidInstance->routeAction();
+       $extDirectEidInstance->render();
+}
diff --git a/typo3/sysext/frontend/Resources/PHP/Eid/ShowPic.php b/typo3/sysext/frontend/Resources/PHP/Eid/ShowPic.php
new file mode 100644 (file)
index 0000000..06bf643
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * 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!
+ */
+
+/**
+ * eID-Script for tx_cms_showpic
+ *
+ * Shows a picture from FAL in enlarged format in a separate window.
+ * Picture file and settings is supplied by GET-parameters:
+ *  - file = fileUid or Combined Identifier
+ *  - encoded in an parameter Array (with weird format - see ContentObjectRenderer about ll. 1500)
+ *     - width, height = usual width an height, m/c supported
+ *     - sample = 0/1
+ *     - effects
+ *     - frame
+ *     - bodyTag
+ *     - title
+ *     - wrap
+ *  - md5 = actually contains an hmac
+ */
+
+if (!defined('PATH_typo3conf')) {
+       die('The configuration path was not properly defined!');
+}
+
+// Make instance:
+$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\ShowImageController');
+$SOBE->execute();
diff --git a/typo3/sysext/frontend/Resources/Private/Templates/MainPage.html b/typo3/sysext/frontend/Resources/Private/Templates/MainPage.html
new file mode 100644 (file)
index 0000000..f7be057
--- /dev/null
@@ -0,0 +1,29 @@
+###XMLPROLOG_DOCTYPE###
+###HTMLTAG###
+###HEADTAG###
+
+###METACHARSET###
+###INLINECOMMENT###
+
+###BASEURL###
+###SHORTCUT###
+###TITLE###
+###META###
+
+###CSS_LIBS###
+###CSS_INCLUDE###
+###CSS_INLINE###
+
+###JS_LIBS###
+###JS_INCLUDE###
+###JS_INLINE###
+
+###HEADERDATA###
+</head>
+###BODY###
+###JS_LIBS_FOOTER###
+###JS_INCLUDE_FOOTER###
+###JS_INLINE_FOOTER###
+###FOOTERDATA###
+</body>
+</html>
index 5b0a27f..99d9ba5 100644 (file)
@@ -16,3 +16,15 @@ if (TYPO3_MODE === 'FE' && !isset($_REQUEST['eID'])) {
        'config.extTarget = _top'
        . LF . 'config.uniqueLinkVars = 1'
 );
+
+
+if (TYPO3_MODE === 'FE') {
+
+       // Register eID provider for showpic
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_cms_showpic'] = 'EXT:frontend/Resources/PHP/Eid/ShowPic.php';
+       // Register eID provider for ExtDirect for the frontend
+       $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['ExtDirect'] = 'EXT:frontend/Resources/PHP/Eid/ExtDirect.php';
+
+       // Register the core media wizard provider
+       \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::registerMediaWizardProvider('TYPO3\\CMS\\Frontend\\MediaWizard\\MediaWizardProvider');
+}
index 27d6e0e..3b54a87 100644 (file)
@@ -492,20 +492,6 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                                $cObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
                                $cObj->setCurrentVal($row['sys_language_uid']);
                                $output = $cObj->cObjGetSingle($this->settings['flagRendering'], $this->settings['flagRendering.']);
-                       } else {
-                               // ... otherwise, get flag from sys_language record:
-                               $languageRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('flag, title', 'sys_language', 'uid=' . (int)$row['sys_language_uid'] . $GLOBALS['TSFE']->cObj->enableFields('sys_language'));
-                               // Flag code:
-                               $flag = $languageRow['flag'];
-                               if ($flag) {
-                                       // FIXME not all flags from typo3/gfx/flags
-                                       // are available in media/flags/
-                                       $file = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(PATH_tslib) . 'media/flags/flag_' . $flag;
-                                       $imgInfo = @getimagesize((PATH_site . $file));
-                                       if (is_array($imgInfo)) {
-                                               $output = '<img src="' . $file . '" ' . $imgInfo[3] . ' title="' . htmlspecialchars($languageRow['title']) . '" alt="' . htmlspecialchars($languageRow['title']) . '" />';
-                                       }
-                               }
                        }
                }
                return $output;
index d0c64f7..ade0eb0 100644 (file)
@@ -2085,21 +2085,6 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        if (is_array($this->conf['flagRendering.'])) {
                                $this->cObj->setCurrentVal($row['sys_language_uid']);
                                return $this->cObj->cObjGetSingle($this->conf['flagRendering'], $this->conf['flagRendering.']);
-                       } else {
-                               // ... otherwise, get flag from sys_language record:
-                               // Get sys_language record
-                               $rowDat = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'sys_language', 'uid=' . (int)$row['sys_language_uid'] . ' ' . $this->cObj->enableFields('sys_language'));
-                               // Flag code:
-                               $flag = $rowDat['flag'];
-                               if ($flag) {
-                                       // FIXME not all flags from typo3/gfx/flags are available in media/flags/
-                                       $file = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix(PATH_tslib) . 'media/flags/flag_' . $flag;
-                                       $imgInfo = @getimagesize((PATH_site . $file));
-                                       if (is_array($imgInfo)) {
-                                               $output = '<img src="' . $file . '" ' . $imgInfo[3] . ' title="' . htmlspecialchars($rowDat['title']) . '" alt="' . htmlspecialchars($rowDat['title']) . '" />';
-                                               return $output;
-                                       }
-                               }
                        }
                }
                return '&nbsp;';