From b18482918e9f855b28fb7c27b264c8b28671dca3 Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Thu, 15 Feb 2018 00:38:46 +0100 Subject: [PATCH] [TASK] Deprecate TypoScriptFrontendController->page_cache_reg1 Property page_cache_reg1 is a poor man limited way to manipulate page cache tagging. It has been of very little use and is deprecated now. The usage in indexed_search (which always only added the default "0" to database) is dropped along the way. Change-Id: I9ea129fc6d20adb7a35a719f3d9d630aa663952f Resolves: #83905 Releases: master Reviewed-on: https://review.typo3.org/55723 Tested-by: TYPO3com Reviewed-by: Benni Mack Tested-by: Benni Mack Reviewed-by: Anja Leichsenring Tested-by: Anja Leichsenring Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- ...riptFrontendController-page_cache_reg1.rst | 34 +++++++++++++++++++ .../TypoScriptFrontendController.php | 3 ++ .../Repository/AdministrationRepository.php | 4 +++ .../Repository/IndexSearchRepository.php | 2 ++ .../sysext/indexed_search/Classes/Indexer.php | 9 ++++- .../Php/PropertyPublicMatcher.php | 5 +++ 6 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-83905-TypoScriptFrontendController-page_cache_reg1.rst diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-83905-TypoScriptFrontendController-page_cache_reg1.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-83905-TypoScriptFrontendController-page_cache_reg1.rst new file mode 100644 index 000000000000..fad1dff0e691 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-83905-TypoScriptFrontendController-page_cache_reg1.rst @@ -0,0 +1,34 @@ +.. include:: ../../Includes.txt + +=================================================================== +Deprecation: #83905 - TypoScriptFrontendController->page_cache_reg1 +=================================================================== + +See :issue:`83905` + +Description +=========== + +Property :php:`TypoScriptFrontendController->page_cache_reg1` has been deprecated + + +Impact +====== + +Setting this property triggers a deprecation log entry. + + +Affected Installations +====================== + +This property was of very little use ever since, it is unlikely an instance runs an +extension consuming it. +The extension scanner will find usages. + + +Migration +========= + +Use method :php:`TypoScriptFrontendController->addCacheTags()` to influence page cache tagging. + +.. index:: Frontend, PHP-API, FullyScanned \ No newline at end of file diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index fa4b80cac588..89f8015d4ff6 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -184,6 +184,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface * and later perform some external cache management, like clearing only a part * of the cache of a page... * @var int + * @deprecated since TYPO3 v9, will be removed in TYPO3 v10. */ public $page_cache_reg1 = 0; @@ -3137,6 +3138,8 @@ public function setPageCacheContent($content, $data, $expirationTstamp) $this->cacheExpires = $expirationTstamp; $this->pageCacheTags[] = 'pageId_' . $cacheData['page_id']; if ($this->page_cache_reg1) { + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove this "if" along with property page_cache_reg1 + trigger_error('Property page_cache_reg1 has been deprecated and will be removed in core version 10', E_USER_DEPRECATED); $reg1 = (int)$this->page_cache_reg1; $cacheData['reg1'] = $reg1; $this->pageCacheTags[] = 'reg1_' . $reg1; diff --git a/typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php b/typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php index c76a49e77415..7abfb8988dc2 100644 --- a/typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php +++ b/typo3/sysext/indexed_search/Classes/Domain/Repository/AdministrationRepository.php @@ -144,6 +144,7 @@ public function getExternalDocumentsStatistic() 'cHashParams', 'data_filename', 'data_page_id', + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove along with database field data_page_reg1 'data_page_reg1', 'data_page_type', 'data_page_mp', @@ -329,6 +330,7 @@ public function getPageStatistic() 'cHashParams', 'data_filename', 'data_page_id', + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove along with database field data_page_reg1 'data_page_reg1', 'data_page_type', 'data_page_mp', @@ -492,6 +494,7 @@ public function getTree($pageId, $depth = 4, $mode) 'IP.cHashParams', 'IP.data_filename', 'IP.data_page_id', + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove along with database field data_page_reg1 'IP.data_page_reg1', 'IP.data_page_type', 'IP.data_page_mp', @@ -528,6 +531,7 @@ public function getTree($pageId, $depth = 4, $mode) 'IP.cHashParams', 'IP.data_filename', 'IP.data_page_id', + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove along with database field data_page_reg1 'IP.data_page_reg1', 'IP.data_page_type', 'IP.data_page_mp', diff --git a/typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php b/typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php index 28ed7361263b..7cec12b87bf1 100644 --- a/typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php +++ b/typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php @@ -539,6 +539,7 @@ protected function execFinalQuery_fulltext($searchData, $freeIndexUid = -1) 'IP.phash_grouping', 'IP.data_filename', 'IP.data_page_id', + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove along with database field data_page_reg1 'IP.data_page_reg1', 'IP.data_page_type', 'IP.data_page_mp', @@ -1001,6 +1002,7 @@ protected function execFinalQuery($list, $freeIndexUid = -1) 'IP.phash_grouping', 'IP.data_filename', 'IP.data_page_id', + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove along with database field data_page_reg1 'IP.data_page_reg1', 'IP.data_page_type', 'IP.data_page_mp', diff --git a/typo3/sysext/indexed_search/Classes/Indexer.php b/typo3/sysext/indexed_search/Classes/Indexer.php index 0355b4e6e419..9e1dbe4c62bb 100644 --- a/typo3/sysext/indexed_search/Classes/Indexer.php +++ b/typo3/sysext/indexed_search/Classes/Indexer.php @@ -289,8 +289,11 @@ public function hook_indexContent(&$pObj) // Array of the additional parameters $this->conf['crdate'] = $pObj->page['crdate']; // The creation date of the TYPO3 page - $this->conf['page_cache_reg1'] = $pObj->page_cache_reg1; + // reg1 of the caching table. Not known what practical use this has. + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove along with database field data_page_reg1 + $this->conf['page_cache_reg1'] = $pObj->page_cache_reg1; + // Root line uids $this->conf['rootline_uids'] = []; foreach ($pObj->config['rootLine'] as $rlkey => $rldat) { @@ -379,7 +382,10 @@ public function backend_initIndexer($id, $type, $sys_language_uid, $MP, $uidRL, // Set to defaults $this->conf['freeIndexUid'] = 0; $this->conf['freeIndexSetId'] = 0; + + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove along with database field data_page_reg1 $this->conf['page_cache_reg1'] = 0; + // Root line uids $this->conf['rootline_uids'] = $uidRL; // Configuration of behavior: @@ -1437,6 +1443,7 @@ public function submitPage() 'cHashParams' => serialize($this->cHashParams), 'contentHash' => $this->content_md5h, 'data_page_id' => $this->conf['id'], + // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Remove along with database field data_page_reg1 'data_page_reg1' => $this->conf['page_cache_reg1'], 'data_page_type' => $this->conf['type'], 'data_page_mp' => $this->conf['MP'], diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php index d8bfb6f4a7a3..af858e654ab6 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyPublicMatcher.php @@ -326,4 +326,9 @@ 'Deprecation-83606-ImpexpSizeHandlingRemoved.rst', ], ], + 'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->page_cache_reg1' => [ + 'restFiles' => [ + 'Deprecation-83905-TypoScriptFrontendController-page_cache_reg1.rst', + ], + ], ];