[BUGFIX] Remove Closure in signalSlotDispatcher 85/37485/6
authorNicole Cordes <typo3@cordes.co>
Tue, 3 Mar 2015 09:49:34 +0000 (10:49 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 4 Mar 2015 18:23:01 +0000 (19:23 +0100)
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

index 5b4a587..783eebd 100644 (file)
@@ -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);