[BUGFIX] Signal-Slot Disposal fails in File Abstraction Layer
authorOliver Hader <oliver@typo3.org>
Thu, 12 Apr 2012 11:35:52 +0000 (13:35 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 12 Apr 2012 13:33:51 +0000 (15:33 +0200)
Due to the recent clean-up of the Signal-Slot-Dispatcher
(t3lib vs. Extbase), the File Abstraction Layer still needs
to be adjusted.

Change-Id: I3982f665959edfd2cb84060d7f82d8c611758df2
Releases: 6.0
Fixes: #35899
Reviewed-on: http://review.typo3.org/10329
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/file/Service/IndexerService.php
t3lib/file/Storage.php

index 5aa152a..b053429 100644 (file)
@@ -231,9 +231,11 @@ class t3lib_file_Service_IndexerService implements t3lib_Singleton {
         * @signal
         */
        protected function emitPreFileIndexSignal(t3lib_file_File $fileObject, $fileInfo) {
         * @signal
         */
        protected function emitPreFileIndexSignal(t3lib_file_File $fileObject, $fileInfo) {
-               /** @var t3lib_SignalSlot_Dispatcher $dispatcher */
-               $dispatcher = t3lib_div::makeInstance('t3lib_SignalSlot_Dispatcher');
-               $dispatcher->dispatch('t3lib_file_Storage', 'preFileIndex', array($fileObject, $fileInfo));
+               $this->getSignalSlotDispatcher()->dispatch(
+                       't3lib_file_Storage',
+                       'preFileIndex',
+                       array($fileObject, $fileInfo)
+               );
        }
 
        /**
        }
 
        /**
@@ -244,11 +246,30 @@ class t3lib_file_Service_IndexerService implements t3lib_Singleton {
         * @signal
         */
        protected function emitPostFileIndexSignal(t3lib_file_File $fileObject, $fileInfo) {
         * @signal
         */
        protected function emitPostFileIndexSignal(t3lib_file_File $fileObject, $fileInfo) {
-               /** @var t3lib_SignalSlot_Dispatcher $dispatcher */
-               $dispatcher = t3lib_div::makeInstance('t3lib_SignalSlot_Dispatcher');
-               $dispatcher->dispatch('t3lib_file_Storage', 'postFileIndex', array($fileObject, $fileInfo));
+               $this->getSignalSlotDispatcher()->dispatch(
+                       't3lib_file_Storage',
+                       'postFileIndex',
+                       array($fileObject, $fileInfo)
+               );
        }
 
        }
 
+       /**
+        * Get the SignalSlot dispatcher
+        *
+        * @return Tx_Extbase_SignalSlot_Dispatcher
+        */
+       protected function getSignalSlotDispatcher() {
+               return $this->getObjectManager()->get('Tx_Extbase_SignalSlot_Dispatcher');
+       }
+
+       /**
+        * Get the ObjectManager
+        *
+        * @return Tx_Extbase_Object_ObjectManager
+        */
+       protected function getObjectManager() {
+               return t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
+       }
 }
 
 
 }
 
 
index 6ca401c..103aa60 100644 (file)
@@ -146,7 +146,7 @@ class t3lib_file_Storage {
        protected $capabilities;
 
        /**
        protected $capabilities;
 
        /**
-        * @var t3lib_SignalSlot_Dispatcher
+        * @var Tx_Extbase_SignalSlot_Dispatcher
         */
        protected $signalSlotDispatcher;
 
         */
        protected $signalSlotDispatcher;
 
@@ -1880,7 +1880,7 @@ class t3lib_file_Storage {
         * @param array $configuration
         */
        protected function emitPreFileProcess(t3lib_file_ProcessedFile $processedFile, t3lib_file_FileInterface $file, $context, array $configuration = array()) {
         * @param array $configuration
         */
        protected function emitPreFileProcess(t3lib_file_ProcessedFile $processedFile, t3lib_file_FileInterface $file, $context, array $configuration = array()) {
-               t3lib_SignalSlot_Dispatcher::getInstance()->dispatch(
+               $this->getSignalSlotDispatcher()->dispatch(
                        't3lib_file_Storage',
                        self::SIGNAL_PreFileProcess,
                        array($this, $this->driver, $processedFile, $file, $context, $configuration)
                        't3lib_file_Storage',
                        self::SIGNAL_PreFileProcess,
                        array($this, $this->driver, $processedFile, $file, $context, $configuration)
@@ -1896,7 +1896,7 @@ class t3lib_file_Storage {
         * @param array $configuration
         */
        protected function emitPostFileProcess(t3lib_file_ProcessedFile $processedFile, t3lib_file_FileInterface $file, $context, array $configuration = array()) {
         * @param array $configuration
         */
        protected function emitPostFileProcess(t3lib_file_ProcessedFile $processedFile, t3lib_file_FileInterface $file, $context, array $configuration = array()) {
-               t3lib_SignalSlot_Dispatcher::getInstance()->dispatch(
+               $this->getSignalSlotDispatcher()->dispatch(
                        't3lib_file_Storage',
                        self::SIGNAL_PostFileProcess,
                        array($this, $this->driver, $processedFile, $file, $context, $configuration)
                        't3lib_file_Storage',
                        self::SIGNAL_PostFileProcess,
                        array($this, $this->driver, $processedFile, $file, $context, $configuration)
@@ -1966,15 +1966,26 @@ class t3lib_file_Storage {
        }
 
        /**
        }
 
        /**
-        * @return t3lib_SignalSlot_Dispatcher
+        * Get the SignalSlot dispatcher
+        *
+        * @return Tx_Extbase_SignalSlot_Dispatcher
         */
        protected function getSignalSlotDispatcher() {
                if (!isset($this->signalSlotDispatcher)) {
         */
        protected function getSignalSlotDispatcher() {
                if (!isset($this->signalSlotDispatcher)) {
-                       $this->signalSlotDispatcher = t3lib_div::makeInstance('t3lib_SignalSlot_Dispatcher');
+                       $this->signalSlotDispatcher = $this->getObjectManager()->get('Tx_Extbase_SignalSlot_Dispatcher');
                }
                return $this->signalSlotDispatcher;
        }
 
                }
                return $this->signalSlotDispatcher;
        }
 
+       /**
+        * Get the ObjectManager
+        *
+        * @return Tx_Extbase_Object_ObjectManager
+        */
+       protected function getObjectManager() {
+               return t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
+       }
+
        /**
         * @return t3lib_file_Factory
         */
        /**
         * @return t3lib_file_Factory
         */