Skip to content

Commit

Permalink
[!!!][TASK] Remove deprecated methods in TypoScriptFrontendController
Browse files Browse the repository at this point in the history
The following PHP class methods that have previously been marked as
deprecated for v13 have been removed in class
`\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController`:

- `addCacheTags()`
- `getPageCacheTags()`

Resolves: #105460
Related: #105377
Related: #102422
Releases: main
Change-Id: I9c24f68e6b697e76c2cfc5bd721027ce176b30ed
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86775
Tested-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
  • Loading branch information
thomashohn authored and lolli42 committed Oct 25, 2024
1 parent 2d04110 commit 7b71591
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions Classes/Controller/TypoScriptFrontendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,37 +405,6 @@ protected function setSysLastChanged(ServerRequestInterface $request): void
}
}

/**
* Adds tags to this page's cache entry, you can then f.e. remove cache
* entries by tag
*
* @param array $tags An array of tag
* @deprecated since TYPO3 v13, will be removed in TYPO3 v14. Use $request->getAttribute('frontend.cache.collector')->addCacheTags(new CacheTag($tag, $lifetime)) instead.
*/
public function addCacheTags(array $tags)
{
trigger_error(
'TypoScriptFrontendController->addCacheTags has been marked as deprecated in TYPO3 v13. Use $request->getAttribute(\'frontend.cache.collector\')->addCacheTags(new CacheTag($tag, $lifetime)) instead.',
E_USER_DEPRECATED,
);
$cacheDataCollector = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.cache.collector');
$cacheDataCollector->addCacheTags(...array_map(fn(string $tag) => new CacheTag($tag), $tags));
}

/**
* @return array
* @deprecated since TYPO3 v13, will be removed in TYPO3 v14. Use $request->getAttribute('frontend.cache.collector')->getCacheTags() instead.
*/
public function getPageCacheTags(): array
{
trigger_error(
'TypoScriptFrontendController->getPageCacheTags has been marked as deprecated in TYPO3 v13. Use $request->getAttribute(\'frontend.cache.collector\')->getCacheTags() instead.',
E_USER_DEPRECATED,
);
$cacheDataCollector = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.cache.collector');
return array_map(fn(CacheTag $cacheTag) => $cacheTag->name, $cacheDataCollector->getCacheTags());
}

/**
* Sets up TypoScript "config." options and set properties in $TSFE.
*
Expand Down

0 comments on commit 7b71591

Please sign in to comment.