[BUGFIX] ObjectManager dependencies in SignalSlot registration
authorOliver Hader <oliver@typo3.org>
Sun, 22 Jul 2012 15:10:23 +0000 (17:10 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 17 Aug 2012 13:51:02 +0000 (15:51 +0200)
commit2c08ed96eefe0ce77a25a12886117f0a7b3f313e
treea63c716f896c6e5cb751c066dc3f477a0f6eec43
parentd0d2970b4d3df561736f2b1f3dcdfd5a4f994aa9
[BUGFIX] ObjectManager dependencies in SignalSlot registration

The SignalSlotDispatcher has a connect() and dispatch() method.
The connect() method usually might be used in ext_localconf.php
to register accordant slots - however, the SignalSlotDispatcher
relies on a fully initialized ObjectManager that also relies on
a fully initialized Caching Framework.

Since the Caches are not ready yet in ext_localconf.php the
whole thing will fail.

This patch removes the dependency of the ObjectManager
injecting itself to the SignalSlotDispatcher by explicitely
calling the initializeObject() method at a later point.

The SignalSlotDispatcher can then be used like this:

t3lib_div::makeInstance('Tx_Extbase_SignalSlot_Dispatcher')
  ->connect('Tx_MyClass', 'MySignal', 'Slot', 'slotMethod');

Change-Id: Ib0122a341865c334448f23a46bc8841c4817fdf7
Fixes: #39174
Releases: 4.7, 6.0
Reviewed-on: http://review.typo3.org/12989
Reviewed-by: Daniel Lorenz
Reviewed-by: Jacob Rasmussen
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extbase/Classes/SignalSlot/Dispatcher.php
typo3/sysext/extbase/Tests/Unit/SignalSlot/DispatcherTest.php