[TASK] Use proper PHP 5.5 class references (no singleton) 06/40606/3
authorBenjamin Mack <benni@typo3.org>
Thu, 25 Jun 2015 07:57:57 +0000 (09:57 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Thu, 25 Jun 2015 09:08:45 +0000 (11:08 +0200)
Resolves: #67743
Releases: master
Change-Id: Iad5c37fbf0350d52b03ea7d8a92b2e82440cb3de
Reviewed-on: http://review.typo3.org/40606
Reviewed-by: Frederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/form/Classes/Utility/FormUtility.php
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
typo3/sysext/indexed_search/Classes/Example/PluginHook.php
typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php
typo3/sysext/indexed_search/Classes/Indexer.php
typo3/sysext/indexed_search/ext_localconf.php
typo3/sysext/indexed_search_mysql/ext_localconf.php
typo3/sysext/rtehtmlarea/ext_localconf.php

index b6829b7..c9e718e 100644 (file)
@@ -93,7 +93,7 @@ class FormUtility implements \TYPO3\CMS\Core\SingletonInterface {
                foreach ($this->getFormObjects() as $formObject) {
                        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClass'][] = array(
                                $formObject,
                foreach ($this->getFormObjects() as $formObject) {
                        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClass'][] = array(
                                $formObject,
-                               'EXT:form/Classes/Controller/FormController.php:&TYPO3\\CMS\\Form\\Controller\\FormController'
+                               \TYPO3\CMS\Form\Controller\FormController::class
                        );
                }
                return $this;
                        );
                }
                return $this;
index 916e25e..6d0f023 100644 (file)
@@ -811,7 +811,7 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
        protected function procSearchWordsByLexer($searchWords) {
                $newSearchWords = array();
                // Init lexer (used to post-processing of search words)
        protected function procSearchWordsByLexer($searchWords) {
                $newSearchWords = array();
                // Init lexer (used to post-processing of search words)
-               $lexerObjRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ? $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] : 'EXT:indexed_search/Classes/Lexer.php:&TYPO3\\CMS\\IndexedSearch\\Lexer';
+               $lexerObjRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ?: \TYPO3\CMS\IndexedSearch\Lexer::class;
                $this->lexerObj = GeneralUtility::getUserObj($lexerObjRef);
                // Traverse the search word array
                foreach ($searchWords as $wordDef) {
                $this->lexerObj = GeneralUtility::getUserObj($lexerObjRef);
                // Traverse the search word array
                foreach ($searchWords as $wordDef) {
index cc694be..5755ad8 100644 (file)
@@ -223,7 +223,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        }
                }
                // Init lexer (used to post-processing of search words)
                        }
                }
                // Init lexer (used to post-processing of search words)
-               $lexerObjRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ? $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] : 'EXT:indexed_search/Classes/Lexer.php:&TYPO3\\CMS\\IndexedSearch\\Lexer';
+               $lexerObjRef = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['lexer'] ?: \TYPO3\CMS\IndexedSearch\Lexer::class;
                $this->lexerObj = GeneralUtility::getUserObj($lexerObjRef);
                // If "_sections" is set, this value overrides any existing value.
                if ($this->piVars['_sections']) {
                $this->lexerObj = GeneralUtility::getUserObj($lexerObjRef);
                // If "_sections" is set, this value overrides any existing value.
                if ($this->piVars['_sections']) {
index db67706..f74fd0b 100644 (file)
@@ -39,7 +39,7 @@ class PluginHook {
         * The example reverses the order of elements in the ranking selector box. You can modify other values like this or add / remove items.
         *
         * This hook is activated by this key / value pair in ext_localconf.php
         * The example reverses the order of elements in the ranking selector box. You can modify other values like this or add / remove items.
         *
         * This hook is activated by this key / value pair in ext_localconf.php
-        * 'initialize_postProc' => 'EXT:indexed_search/example/class.pihook.php:&tx_indexedsearch_pihook',
+        * 'initialize_postProc' => \TYPO3\CMS\IndexedSearch\Example\PluginHook::class,
         *
         * @return void
         */
         *
         * @return void
         */
index be3adb2..d5965e2 100644 (file)
@@ -43,7 +43,7 @@ class CrawlerHook {
        /**
         * @var string
         */
        /**
         * @var string
         */
-       public $callBack = '&TYPO3\\CMS\\IndexedSearch\\Hook\\CrawlerHook';
+       public $callBack = CrawlerHook::class;
 
        // The object reference to this class.
        /**
 
        // The object reference to this class.
        /**
index 163703a..ce5d9e4 100644 (file)
@@ -692,7 +692,7 @@ class Indexer {
                                                                'conf' => $this->conf
                                                        );
                                                        unset($params['conf']['content']);
                                                                'conf' => $this->conf
                                                        );
                                                        unset($params['conf']['content']);
-                                                       $crawler->addQueueEntry_callBack(0, $params, '&TYPO3\\CMS\\IndexedSearch\\Hook\\CrawlerFilesHook', $this->conf['id']);
+                                                       $crawler->addQueueEntry_callBack(0, $params, Hook\CrawlerFilesHook::class, $this->conf['id']);
                                                        $this->log_setTSlogMessage('media "' . $params['document'] . '" added to "crawler" queue.', 1);
                                                } else {
                                                        $this->indexRegularDocument($linkInfo['href'], FALSE, $linkSource, $ext);
                                                        $this->log_setTSlogMessage('media "' . $params['document'] . '" added to "crawler" queue.', 1);
                                                } else {
                                                        $this->indexRegularDocument($linkInfo['href'], FALSE, $linkSource, $ext);
@@ -704,7 +704,7 @@ class Indexer {
                                                                'conf' => $this->conf
                                                        );
                                                        unset($params['conf']['content']);
                                                                'conf' => $this->conf
                                                        );
                                                        unset($params['conf']['content']);
-                                                       $crawler->addQueueEntry_callBack(0, $params, '&TYPO3\\CMS\\IndexedSearch\\Hook\\CrawlerFilesHook', $this->conf['id']);
+                                                       $crawler->addQueueEntry_callBack(0, $params, Hook\CrawlerFilesHook::class, $this->conf['id']);
                                                        $this->log_setTSlogMessage('media "' . $params['document'] . '" added to "crawler" queue.', 1);
                                                } else {
                                                        $this->indexRegularDocument($linkSource);
                                                        $this->log_setTSlogMessage('media "' . $params['document'] . '" added to "crawler" queue.', 1);
                                                } else {
                                                        $this->indexRegularDocument($linkSource);
index 1954264..120f2bc 100644 (file)
@@ -4,41 +4,41 @@ defined('TYPO3_MODE') or die();
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43('indexed_search');
 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin('indexed_search', 'Pi2', array('Search' => 'form,search'), array('Search' => 'form,search'));
 // Attach to hooks:
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43('indexed_search');
 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin('indexed_search', 'Pi2', array('Search' => 'form,search'), array('Search' => 'form,search'));
 // Attach to hooks:
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'][] = 'TYPO3\\CMS\\IndexedSearch\\Indexer';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache']['tx_indexedsearch'] = '&TYPO3\\CMS\\IndexedSearch\\Hook\\TypoScriptFrontendHook->headerNoCache';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'][] = \TYPO3\CMS\IndexedSearch\Indexer::class;
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache']['tx_indexedsearch'] = \TYPO3\CMS\IndexedSearch\Hook\TypoScriptFrontendHook::class . '->headerNoCache';
 // Register with "crawler" extension:
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['procInstructions']['tx_indexedsearch_reindex'] = 'Re-indexing';
 // Register with "crawler" extension:
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['procInstructions']['tx_indexedsearch_reindex'] = 'Re-indexing';
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['cli_hooks']['tx_indexedsearch_crawl'] = '&TYPO3\\CMS\\IndexedSearch\\Hook\\CrawlerHook';
+$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['crawler']['cli_hooks']['tx_indexedsearch_crawl'] = \TYPO3\CMS\IndexedSearch\Hook\CrawlerHook::class;
 // Register with TCEmain:
 // Register with TCEmain:
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['tx_indexedsearch'] = '&TYPO3\\CMS\\IndexedSearch\\Hook\\CrawlerHook';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['tx_indexedsearch'] = '&TYPO3\\CMS\\IndexedSearch\\Hook\\CrawlerHook';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['tx_indexedsearch'] = \TYPO3\CMS\IndexedSearch\Hook\CrawlerHook::class;
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['tx_indexedsearch'] = \TYPO3\CMS\IndexedSearch\Hook\CrawlerHook::class;
 // Configure default document parsers:
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] = array(
 // Configure default document parsers:
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['external_parsers'] = array(
-       'pdf' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'doc' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'pps' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'ppt' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'xls' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'sxc' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'sxi' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'sxw' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'ods' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'odp' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'odt' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'rtf' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'txt' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'html' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'htm' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'csv' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'xml' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'jpg' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'jpeg' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser',
-       'tif' => '&TYPO3\\CMS\\IndexedSearch\\FileContentParser'
+       'pdf'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'doc'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'pps'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'ppt'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'xls'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'sxc'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'sxi'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'sxw'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'ods'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'odp'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'odt'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'rtf'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'txt'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'html' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'htm'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'csv'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'xml'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'jpg'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'jpeg' => \TYPO3\CMS\IndexedSearch\FileContentParser::class,
+       'tif'  => \TYPO3\CMS\IndexedSearch\FileContentParser::class
 );
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] = 'index_phash,index_fulltext,index_rel,index_words,index_section,index_grlist,index_stat_search,index_stat_word,index_debug,index_config';
 // unserializing the configuration so we can use it here:
 $_EXTCONF = unserialize($_EXTCONF);
 // Use the advanced doubleMetaphone parser instead of the internal one (usage of metaphone parsers is generally disabled by default)
 if (isset($_EXTCONF['enableMetaphoneSearch']) && (int)$_EXTCONF['enableMetaphoneSearch'] == 2) {
 );
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] = 'index_phash,index_fulltext,index_rel,index_words,index_section,index_grlist,index_stat_search,index_stat_word,index_debug,index_config';
 // unserializing the configuration so we can use it here:
 $_EXTCONF = unserialize($_EXTCONF);
 // Use the advanced doubleMetaphone parser instead of the internal one (usage of metaphone parsers is generally disabled by default)
 if (isset($_EXTCONF['enableMetaphoneSearch']) && (int)$_EXTCONF['enableMetaphoneSearch'] == 2) {
-       $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['metaphone'] = '&TYPO3\\CMS\\IndexedSearch\\Utility\\DoubleMetaPhoneUtility';
+       $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['metaphone'] = \TYPO3\CMS\IndexedSearch\Utility\DoubleMetaPhoneUtility::class;
 }
 }
index bd6d721..c43f49f 100644 (file)
@@ -2,6 +2,6 @@
 defined('TYPO3_MODE') or die();
 
 // Configure hook to query the fulltext index
 defined('TYPO3_MODE') or die();
 
 // Configure hook to query the fulltext index
-$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks']['getResultRows_SQLpointer'] = '&TYPO3\CMS\IndexedSearchMysql\Hook\MysqlFulltextIndexHook';
+$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['pi1_hooks']['getResultRows_SQLpointer'] = \TYPO3\CMS\IndexedSearchMysql\Hook\MysqlFulltextIndexHook::class;
 // Use all index_* tables except "index_rel" and "index_words"
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] = 'index_phash,index_fulltext,index_section,index_grlist,index_stat_search,index_stat_word,index_debug,index_config';
 // Use all index_* tables except "index_rel" and "index_words"
 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['use_tables'] = 'index_phash,index_fulltext,index_section,index_grlist,index_stat_search,index_stat_word,index_debug,index_config';
index 45d751c..a549d6d 100644 (file)
@@ -2,7 +2,7 @@
 defined('TYPO3_MODE') or die();
 
 // Registering the RTE object
 defined('TYPO3_MODE') or die();
 
 // Registering the RTE object
-$GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg']['rtehtmlarea'] = array('objRef' => '&TYPO3\\CMS\\Rtehtmlarea\\RteHtmlAreaBase');
+$GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg']['rtehtmlarea'] = array('objRef' => \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase::class);
 
 // Register FormEngine node type resolver hook to render RTE in FormEngine if enabled
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeResolver'][1433167475] = array(
 
 // Register FormEngine node type resolver hook to render RTE in FormEngine if enabled
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['nodeResolver'][1433167475] = array(