From e4303bb6726e0ca37c568ceda0d018f905d00282 Mon Sep 17 00:00:00 2001
From: Steffen Ritter <info@rs-websystems.de>
Date: Thu, 21 Jun 2012 22:26:12 +0200
Subject: [PATCH] [TASK] Move GlobalScope template-init to Bootstrap

The Template Class is currently initialized in global
scope in init.php.
Move that to the Bootstrap.

Change-Id: I9b1be2d9f953f7b3bf76849985bf160e976232b5
Resolves: #38269
Releases: 6.0
Reviewed-on: http://review.typo3.org/12274
Reviewed-by: Oliver Klee
Reviewed-by: Wouter Wolters
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
---
 typo3/classes/Bootstrap.php | 13 +++++++++++++
 typo3/init.php              |  6 +-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/typo3/classes/Bootstrap.php b/typo3/classes/Bootstrap.php
index b220b23982d1..32480afcf221 100644
--- a/typo3/classes/Bootstrap.php
+++ b/typo3/classes/Bootstrap.php
@@ -1529,5 +1529,18 @@ class Typo3_Bootstrap {
 			die('Calculated absolute path to typo3conf directory does not exist');
 		}
 	}
+
+	/**
+	 * Provides an instance of "template" for backend-modules to
+	 * work with.
+	 *
+	 * @return Typo3_Bootstrap
+	 */
+	public function initializeBackendTemplate() {
+		$GLOBALS['TBE_TEMPLATE'] = t3lib_div::makeInstance('template');
+
+		return $this;
+	}
+
 }
 ?>
diff --git a/typo3/init.php b/typo3/init.php
index 7b0bc4b6b7d8..5c62983cc8e7 100644
--- a/typo3/init.php
+++ b/typo3/init.php
@@ -110,12 +110,8 @@ Typo3_Bootstrap::getInstance()
 	->initializeBackendUser()
 	->initializeBackendUserMounts()
 	->initializeLanguageObject()
+	->initializeBackendTemplate()
 	->endOutputBufferingAndCleanPreviousOutput()
 	->initializeOutputCompression();
 
-// ******************************
-// The template is loaded
-// ******************************
-$GLOBALS['TBE_TEMPLATE'] = t3lib_div::makeInstance('template');
-
 ?>
\ No newline at end of file
-- 
GitLab