Skip to content

Commit

Permalink
[TASK] Deprecate TypoScriptFrontendController->page_cache_reg1
Browse files Browse the repository at this point in the history
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 <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
lolli42 committed Feb 16, 2018
1 parent cb4051c commit b184829
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 1 deletion.
@@ -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
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
9 changes: 8 additions & 1 deletion typo3/sysext/indexed_search/Classes/Indexer.php
Expand Up @@ -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) {
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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'],
Expand Down
Expand Up @@ -326,4 +326,9 @@
'Deprecation-83606-ImpexpSizeHandlingRemoved.rst',
],
],
'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->page_cache_reg1' => [
'restFiles' => [
'Deprecation-83905-TypoScriptFrontendController-page_cache_reg1.rst',
],
],
];

0 comments on commit b184829

Please sign in to comment.