Skip to content
Snippets Groups Projects
Commit 2d9cebbc authored by Łukasz Uznański's avatar Łukasz Uznański Committed by Christian Kuhn
Browse files

[TASK] Use ServerRequestInterface in LoginFramesetController

* deprecate public properties
* deprecate public (non-routed) methods

Resolves: #84368
Releases: master
Change-Id: Ib3f4724dc77384ece76cc6b3c6b9adee38c595e8
Reviewed-on: https://review.typo3.org/56246


Reviewed-by: default avatarMathias Brodala <mbrodala@pagemachine.de>
Tested-by: default avatarMathias Brodala <mbrodala@pagemachine.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent a987175f
Branches
Tags
No related merge requests found
<?php
declare(strict_types = 1);
namespace TYPO3\CMS\Backend\Controller;
/*
......@@ -16,6 +17,8 @@ namespace TYPO3\CMS\Backend\Controller;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Template\DocumentTemplate;
use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -47,20 +50,30 @@ class LoginFramesetController
*/
public function mainAction(ServerRequestInterface $request): ResponseInterface
{
$this->main();
$this->createFrameset();
return new HtmlResponse($this->content);
}
/**
* Main function.
* Creates the header code and the frameset for the two frames.
*
* @deprecated since v9, will be removed in v10
*/
public function main()
{
trigger_error('Method main() will be replaced by protected method createFrameset() in v10. Do not call from other extension', E_USER_DEPRECATED);
$this->createFrameset();
}
/**
* Main function.
* Creates the header code and the frameset for the two frames.
*/
protected function createFrameset(): void
{
$title = 'TYPO3 Re-Login (' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . ')';
$this->getDocumentTemplate()->startPage($title);
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
/** @var UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
// Create the frameset for the window
$this->content = $this->getPageRenderer()->render(PageRenderer::PART_HEADER) . '
<frameset rows="*,1">
......@@ -73,9 +86,9 @@ class LoginFramesetController
/**
* Returns an instance of DocumentTemplate
*
* @return \TYPO3\CMS\Backend\Template\DocumentTemplate
* @return DocumentTemplate
*/
protected function getDocumentTemplate()
protected function getDocumentTemplate(): DocumentTemplate
{
return $GLOBALS['TBE_TEMPLATE'];
}
......@@ -83,7 +96,7 @@ class LoginFramesetController
/**
* @return PageRenderer
*/
protected function getPageRenderer()
protected function getPageRenderer(): PageRenderer
{
return GeneralUtility::makeInstance(PageRenderer::class);
}
......
.. include:: ../../Includes.txt
=================================================================================
Deprecation: #84368 - Protected methods and properties in LoginFramesetController
=================================================================================
See :issue:`84368`
Description
===========
This file is about third party usage (consumer that call the class as well as
signals or hooks depending on it) of :php:`TYPO3\CMS\Backend\Controller\LoginFramesetController`.
All methods not used as entry points by :php:`TYPO3\CMS\Backend\Http\RouteDispatcher` will be
removed or set to protected in v10 and throw deprecation warnings if used from a third party:
* [not scanned] :php:`main()`
Impact
======
Calling above method on an instance of :php:`LoginFramesetController` will throw a deprecation warning in v9 and a PHP fatal in v10.
Affected Installations
======================
The extension scanner will find all usages, but may also find some false positives. In general all extensions
that set properties or call methods except :php:`mainAction()` are affected.
Migration
=========
In general, extensions should not instantiate and re-use controllers of the core. Existing
usages should be rewritten to be free of calls like these.
.. index:: Backend, PHP-API, PartiallyScanned
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment