From 9687a4297b17b70238a7ceabb4c691ed77123dbc Mon Sep 17 00:00:00 2001
From: Nicole Cordes <typo3@cordes.co>
Date: Tue, 3 Mar 2015 10:49:34 +0100
Subject: [PATCH] [BUGFIX] Remove Closure in signalSlotDispatcher

As the classAliasMap is a singleton we don't need to initialize it on
every dispatch, but we can call the method directly on the instance.
This prevents a closure for signalSlotDispatcher which otherwise throws
an exception on serialization.

Releases: master
Resolves: #65473
Change-Id: I1280a4a054f3b63b4b5e71262d4d054b511f001b
Reviewed-on: http://review.typo3.org/37485
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 typo3/sysext/core/ext_localconf.php | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/typo3/sysext/core/ext_localconf.php b/typo3/sysext/core/ext_localconf.php
index 5b4a5877df88..783eebda0ffc 100644
--- a/typo3/sysext/core/ext_localconf.php
+++ b/typo3/sysext/core/ext_localconf.php
@@ -41,23 +41,22 @@ $signalSlotDispatcher->connect(
 );
 
 if (!\TYPO3\CMS\Core\Core\Bootstrap::usesComposerClassLoading()) {
-	$buildAliasMap = function() {
-		$bootstrap = \TYPO3\CMS\Core\Core\Bootstrap::getInstance();
-		$classAliasMap = $bootstrap->getEarlyInstance(\TYPO3\CMS\Core\Core\ClassAliasMap::class);
-		$classAliasMap->buildStaticMappingFile();
-	};
+	$bootstrap = \TYPO3\CMS\Core\Core\Bootstrap::getInstance();
+	$classAliasMap = $bootstrap->getEarlyInstance(\TYPO3\CMS\Core\Core\ClassAliasMap::class);
 	$signalSlotDispatcher->connect(
 		\TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService::class,
 		'hasInstalledExtensions',
-		$buildAliasMap
+		$classAliasMap,
+		'buildStaticMappingFile'
 	);
 
 	$signalSlotDispatcher->connect(
 		\TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class,
 		'afterExtensionUninstall',
-		$buildAliasMap
+		$classAliasMap,
+		'buildStaticMappingFile'
 	);
-	unset($buildAliasMap);
+	unset($bootstrap, $classAliasMap);
 }
 
 unset($signalSlotDispatcher);
-- 
GitLab