From fc7f54698706a2ff4fc86c2a6ee96f50026a530b Mon Sep 17 00:00:00 2001 From: Benni Mack <benni@typo3.org> Date: Sun, 13 Nov 2016 15:00:50 +0100 Subject: [PATCH] [TASK] Manual require_once of crawler removal The crawler is still included via a require_once in indexed_search, even though the class loader since TYPO3 6.2 does that transparently. So, the method is still called, which makes it impossible to move EXT:crawler lib to a different location inside the extension. The patch removes the call to the method, as the autoloader fetches the file anyway. It also deprecates the method call within EXT:indexed_search. Resolves: #78679 Releases: master Change-Id: I9654b89a520fe0aefd55a713613db794b8c88f72 Reviewed-on: https://review.typo3.org/50643 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de> Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de> Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl> Tested-by: Wouter Wolters <typo3@wouterwolters.nl> Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com> Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com> --- ...nclusionViaRequire_onceInIndexedSearch.rst | 40 +++++++++++++++++++ .../sysext/indexed_search/Classes/Indexer.php | 3 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-78679-CrawlerInclusionViaRequire_onceInIndexedSearch.rst diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-78679-CrawlerInclusionViaRequire_onceInIndexedSearch.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-78679-CrawlerInclusionViaRequire_onceInIndexedSearch.rst new file mode 100644 index 000000000000..4d9abf25973e --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-78679-CrawlerInclusionViaRequire_onceInIndexedSearch.rst @@ -0,0 +1,40 @@ +.. include:: ../../Includes.txt + +========================================================================== +Deprecation: #78679 - Crawler inclusion via require_once in Indexed Search +========================================================================== + +See :issue:`78679` + +Description +=========== + +The system extension "Indexed Search" has support for EXT:crawler, by using the crawler library +to index a page. + +This functionality is done under the hood via the Indexer class, which does a manual PHP call on +"require_once" - code which is not necessary anymore, since the TYPO3 Core class loader. The public +PHP method `TYPO3\CMS\IndexedSearch\Indexer->includeCrawlerClass()` is therefore marked as +deprecated. + + +Impact +====== + +Calling the method `TYPO3\CMS\IndexedSearch\Indexer->includeCrawlerClass()` will trigger a +deprecation log message. + + +Affected Installations +====================== + +Any TYPO3 installation with a custom indexer written in PHP, and Indexed Search and Crawler +installed, and the custom indexer using the method call above. + + +Migration +========= + +Remove the function call, as TYPO3 includes the PHP class automatically. + +.. index:: ext:indexed_search, PHP-API \ No newline at end of file diff --git a/typo3/sysext/indexed_search/Classes/Indexer.php b/typo3/sysext/indexed_search/Classes/Indexer.php index f6e5557ea579..a9afc00a3b23 100644 --- a/typo3/sysext/indexed_search/Classes/Indexer.php +++ b/typo3/sysext/indexed_search/Classes/Indexer.php @@ -766,7 +766,6 @@ class Indexer // Get links: $list = $this->extractHyperLinks($content); if ($this->indexerConfig['useCrawlerForExternalFiles'] && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('crawler')) { - $this->includeCrawlerClass(); $crawler = GeneralUtility::makeInstance(\tx_crawler_lib::class); } // Traverse links: @@ -2098,9 +2097,11 @@ class Indexer * Includes the crawler class * * @return void + * @deprecated since TYPO3 v8, will be removed in TYPO3 v9, autoloader is taking care of that functionality */ public function includeCrawlerClass() { + GeneralUtility::logDeprecatedFunction(); require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('crawler') . 'class.tx_crawler_lib.php'; } -- GitLab