Skip to content

Commit

Permalink
[TASK] Streamline PageRenderer class
Browse files Browse the repository at this point in the history
Some methods are not in use anymore, and also
some FQCN can be shortened in order to
clean up this class for further refactorings.

Resolves: #88673
Releases: master
Change-Id: I642caec9386945d0217984b76f586a9a24e13d14
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61214
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Alexander Schnitzler <review.typo3.org@alexanderschnitzler.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Sven Juergens <typo3@blue-side.de>
Reviewed-by: Alexander Schnitzler <review.typo3.org@alexanderschnitzler.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
bmack authored and andreaskienast committed Jul 3, 2019
1 parent 16bfda4 commit 72b3e9e
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions typo3/sysext/core/Classes/Page/PageRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Localization\Locales;
use TYPO3\CMS\Core\Localization\LocalizationFactory;
use TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry;
use TYPO3\CMS\Core\Resource\ResourceCompressor;
use TYPO3\CMS\Core\Service\MarkerBasedTemplateService;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\PathUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;

/**
* TYPO3 pageRender class
* This class render the HTML of a webpage, usable for BE and FE
*/
class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
class PageRenderer implements SingletonInterface
{
// Constants for the part to be rendered
const PART_COMPLETE = 0;
Expand Down Expand Up @@ -73,7 +75,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
protected $moveJsFromHeaderToFooter = false;

/**
* @var \TYPO3\CMS\Core\Localization\Locales
* @var Locales
*/
protected $locales;

Expand All @@ -94,7 +96,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
protected $languageDependencies = [];

/**
* @var \TYPO3\CMS\Core\Resource\ResourceCompressor
* @var ResourceCompressor
*/
protected $compressor;

Expand Down Expand Up @@ -333,7 +335,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
public function __construct($templateFile = '')
{
$this->reset();
$this->locales = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\Locales::class);
$this->locales = GeneralUtility::makeInstance(Locales::class);
if ($templateFile !== '') {
$this->templateFile = $templateFile;
}
Expand Down Expand Up @@ -1705,7 +1707,7 @@ public function renderPageWithUncachedObjects($substituteHash)
* of uncached content objects (USER_INT, COA_INT)
*
* @param string $cachedPageContent
* @param string $substituteHash The hash that is used for the placehoder markers
* @param string $substituteHash The hash that is used for the variables
* @internal
* @return string
*/
Expand Down Expand Up @@ -2448,12 +2450,12 @@ protected function doCompressJavaScript()
/**
* Returns instance of \TYPO3\CMS\Core\Resource\ResourceCompressor
*
* @return \TYPO3\CMS\Core\Resource\ResourceCompressor
* @return ResourceCompressor
*/
protected function getCompressor()
{
if ($this->compressor === null) {
$this->compressor = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\ResourceCompressor::class);
$this->compressor = GeneralUtility::makeInstance(ResourceCompressor::class);
}
return $this->compressor;
}
Expand Down Expand Up @@ -2513,7 +2515,7 @@ protected function getStreamlinedFileName($file, $prepareForOutput = true)
*
* @param string $file
* @return string
* @see TypoScriptFrontendController::setAbsRefPrefix()
* @see \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::setAbsRefPrefix()
*/
protected function getAbsoluteWebPath(string $file): string
{
Expand All @@ -2523,16 +2525,6 @@ protected function getAbsoluteWebPath(string $file): string
return PathUtility::getAbsoluteWebPath($file);
}

/**
* Returns global frontend controller
*
* @return TypoScriptFrontendController
*/
protected function getTypoScriptFrontendController()
{
return $GLOBALS['TSFE'];
}

/*****************************************************/
/* */
/* Hooks */
Expand Down

0 comments on commit 72b3e9e

Please sign in to comment.