[TASK] PATH_tslib is defined twice in bootstrap
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / index_ts.php
index bccdb77..2d6b81e 100644 (file)
@@ -40,7 +40,7 @@
 // *******************************
 // Checking PHP version
 // *******************************
-if (version_compare(phpversion(), '5.2', '<')) die ('TYPO3 requires PHP 5.2.0 or higher.');
+if (version_compare(phpversion(), '5.3', '<')) die ('TYPO3 requires PHP 5.3.0 or higher.');
 
 // *******************************
 // Set error reporting
@@ -70,14 +70,6 @@ define('TYPO3_mainDir', 'typo3/');           // This is the directory of the backend admi
 define('PATH_typo3', PATH_site.TYPO3_mainDir);
 define('PATH_typo3conf', PATH_site.'typo3conf/');
 
-if (!defined('PATH_tslib')) {
-       if (@is_dir(PATH_site.TYPO3_mainDir.'sysext/cms/tslib/')) {
-               define('PATH_tslib', PATH_site.TYPO3_mainDir.'sysext/cms/tslib/');
-       } elseif (@is_dir(PATH_site.'tslib/')) {
-               define('PATH_tslib', PATH_site.'tslib/');
-       }
-}
-
 if (!@is_dir(PATH_typo3conf))  die('Cannot find configuration. This file is probably executed from the wrong location.');
 
 // *********************
@@ -91,53 +83,34 @@ unset($error);
 // *********************
 ob_start();
 
-// *********************
-// Timetracking started
-// *********************
-if ($_SESSION['TYPO3-TT-start']) {
-       require_once(PATH_t3lib.'class.t3lib_timetrack.php');
-       $TT = new t3lib_timeTrack;
-} else {
-       require_once(PATH_t3lib.'class.t3lib_timetracknull.php');
-       $TT = new t3lib_timeTrackNull;
-}
-
-$TT->start();
-$TT->push('','Script start');
-
 
 // *********************
 // Mandatory libraries included
 // *********************
-$TT->push('Include class t3lib_db, t3lib_div, t3lib_extmgm','');
-       require_once(PATH_t3lib.'class.t3lib_div.php');
-       require_once(PATH_t3lib.'class.t3lib_extmgm.php');
-$TT->pull();
-
+require_once(PATH_t3lib . 'class.t3lib_div.php');
+require_once(PATH_t3lib . 'class.t3lib_extmgm.php');
 
 
 // **********************
 // Include configuration
 // **********************
-$TT->push('Include config files','');
 require(PATH_t3lib.'config_default.php');
 if (!defined ('TYPO3_db'))     die ('The configuration file was not included.');       // the name of the TYPO3 database is stored in this constant. Here the inclusion of the config-file is verified by checking if this var is set.
 if (!t3lib_extMgm::isLoaded('cms'))    die('<strong>Error:</strong> The main frontend extension "cms" was not loaded. Enable it in the extension manager in the backend.');
 
-if (!defined('PATH_tslib')) {
-       define('PATH_tslib', t3lib_extMgm::extPath('cms').'tslib/');
-}
 
-
-// Restart time tracking if BE login exists
-if (!$_SESSION['TYPO3-TT-start'] && $_COOKIE[t3lib_beUserAuth::getCookieName()]) {
-       $_SESSION['TYPO3-TT-start'] = TRUE;
-
-       $TT = new t3lib_timeTrack;
-       $TT->start();
-       $TT->push('', 'Script start (late)');
+// *********************
+// Timetracking started
+// *********************
+if ($_COOKIE[t3lib_beUserAuth::getCookieName()]) {
+       require_once(PATH_t3lib . 'class.t3lib_timetrack.php');
+       $TT = new t3lib_timeTrack();
+} else {
+       require_once(PATH_t3lib . 'class.t3lib_timetracknull.php');
+       $TT = new t3lib_timeTrackNull();
 }
-
+$TT->start();
+$TT->push('', 'Script start');
 
 // *********************
 // Error & Exception handling
@@ -160,7 +133,6 @@ $TYPO3_DB->debugOutput = $TYPO3_CONF_VARS['SYS']['sqlDebug'];
 $CLIENT = t3lib_div::clientInfo();                             // Set to the browser: net / msie if 4+ browsers
 $TT->pull();
 
-
 // *******************************
 // Checking environment
 // *******************************
@@ -226,22 +198,6 @@ if($TYPO3_CONF_VARS['FE']['pageUnavailable_force'] &&
 
 $TSFE->connectToDB();
 
-       // In case of a keyword-authenticated preview, re-initialize the TSFE object:
-if ($temp_previewConfig = $TSFE->ADMCMD_preview())     {
-       $TSFE = t3lib_div::makeInstance('tslib_fe',
-               $TYPO3_CONF_VARS,
-               t3lib_div::_GP('id'),
-               t3lib_div::_GP('type'),
-               t3lib_div::_GP('no_cache'),
-               t3lib_div::_GP('cHash'),
-               t3lib_div::_GP('jumpurl'),
-               t3lib_div::_GP('MP'),
-               t3lib_div::_GP('RDCT')
-       );
-       $TSFE->ADMCMD_preview_postInit($temp_previewConfig);
-}
-
-
 $TSFE->sendRedirect();
 
 
@@ -251,7 +207,7 @@ $TSFE->sendRedirect();
 // Remove any output produced until now
 ob_clean();
 if ($TYPO3_CONF_VARS['FE']['compressionLevel'] && extension_loaded('zlib'))    {
-       if (t3lib_div::testInt($TYPO3_CONF_VARS['FE']['compressionLevel'])) {
+       if (t3lib_utility_Math::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']);
        }
@@ -274,12 +230,6 @@ $TT->pull();
 $BE_USER = $TSFE->initializeBackendUser();
 
 
-// ********************
-// Workspace preview:
-// ********************
-$TSFE->workspacePreviewInit();
-
-
 // *****************************************
 // 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
@@ -395,6 +345,12 @@ switch($TSFE->checkDataSubmission())       {
 }
 
 
+// *******************************
+// Check for shortcut page and redirect
+// *******************************
+$TSFE->checkPageForShortcutRedirect();
+
+
 // ********************************
 // Generate page
 // *******************************
@@ -515,6 +471,10 @@ $TSFE->hook_eofe();
 // ********************
 $TT->pull();
 
+// ******************
+// Check memory usage
+// ******************
+t3lib_utility_Monitor::peakMemoryUsage();
 
 // ******************
 // beLoginLinkIPList
@@ -544,4 +504,4 @@ if (TYPO3_DLOG) {
        t3lib_div::devLog('END of FRONTEND session', 'cms', 0, array('_FLUSH' => TRUE));
 }
 
-?>
\ No newline at end of file
+?>