‪TYPO3CMS  10.4
TYPO3\CMS\Install\Middleware\Maintenance Class Reference
Inheritance diagram for TYPO3\CMS\Install\Middleware\Maintenance:

Public Member Functions

 __construct (FailsafePackageManager $packageManager, ConfigurationManager $configurationManager, PasswordHashFactory $passwordHashFactory, ContainerInterface $container)
 
ResponseInterface process (ServerRequestInterface $request, RequestHandlerInterface $handler)
 

Protected Member Functions

bool canHandleRequest (ServerRequestInterface $request)
 
bool checkEnableInstallToolFile ()
 
bool checkSessionToken (ServerRequestInterface $request, SessionService $session)
 
bool checkSessionLifetime (SessionService $session)
 
bool checkIfEssentialConfigurationExists ()
 
 recreatePackageStatesFileIfMissing ()
 
ResponseInterface null enforceReferrer (ServerRequestInterface $request)
 

Protected Attributes

FailsafePackageManager $packageManager
 
ConfigurationManager $configurationManager
 
PasswordHashFactory $passwordHashFactory
 
array $controllers
 

Private Attributes

ContainerInterface $container
 

Detailed Description

Default middleware for all requests inside the TYPO3 Install Tool, which does a simple hardcoded dispatching to a controller based on the get/post variable.

This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.

Definition at line 55 of file Maintenance.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Install\Middleware\Maintenance::__construct ( FailsafePackageManager  $packageManager,
ConfigurationManager  $configurationManager,
PasswordHashFactory  $passwordHashFactory,
ContainerInterface  $container 
)

Member Function Documentation

◆ canHandleRequest()

bool TYPO3\CMS\Install\Middleware\Maintenance::canHandleRequest ( ServerRequestInterface  $request)
protected

This request handler can handle any request when not in CLI mode. Warning: Order of these methods is security relevant and interferes with different access conditions (new/existing installation). See the single method comments for details.

Parameters
ServerRequestInterface$request
Returns
‪bool Returns always TRUE

Definition at line 270 of file Maintenance.php.

References $GLOBALS, TYPO3\CMS\Install\Middleware\Maintenance\checkIfEssentialConfigurationExists(), and TYPO3\CMS\Install\Service\EnableFileService\isFirstInstallAllowed().

Referenced by TYPO3\CMS\Install\Middleware\Maintenance\process().

◆ checkEnableInstallToolFile()

bool TYPO3\CMS\Install\Middleware\Maintenance::checkEnableInstallToolFile ( )
protected

Checks if ENABLE_INSTALL_TOOL exists.

Returns
‪bool

Definition at line 286 of file Maintenance.php.

References TYPO3\CMS\Install\Service\EnableFileService\checkInstallToolEnableFile().

Referenced by TYPO3\CMS\Install\Middleware\Maintenance\process().

◆ checkIfEssentialConfigurationExists()

bool TYPO3\CMS\Install\Middleware\Maintenance::checkIfEssentialConfigurationExists ( )
protected

Check if LocalConfiguration.php and PackageStates.php exist

Returns
‪bool TRUE when the essential configuration is available, otherwise FALSE

Definition at line 350 of file Maintenance.php.

Referenced by TYPO3\CMS\Install\Middleware\Maintenance\canHandleRequest().

◆ checkSessionLifetime()

bool TYPO3\CMS\Install\Middleware\Maintenance::checkSessionLifetime ( SessionService  $session)
protected

Check if session expired. If the session has expired, the login form is displayed.

Parameters
SessionService$session
Returns
‪bool True if session lifetime is OK

Definition at line 334 of file Maintenance.php.

Referenced by TYPO3\CMS\Install\Middleware\Maintenance\process().

◆ checkSessionToken()

bool TYPO3\CMS\Install\Middleware\Maintenance::checkSessionToken ( ServerRequestInterface  $request,
SessionService  $session 
)
protected

Use form protection API to find out if protected POST forms are ok.

Parameters
ServerRequestInterface$request
SessionService$session
Returns
‪bool

Definition at line 298 of file Maintenance.php.

References TYPO3\CMS\Core\FormProtection\FormProtectionFactory\get().

Referenced by TYPO3\CMS\Install\Middleware\Maintenance\process().

◆ enforceReferrer()

ResponseInterface null TYPO3\CMS\Install\Middleware\Maintenance::enforceReferrer ( ServerRequestInterface  $request)
protected

Evaluates HTTP Referer header (which is denied by client to be a custom value) - attempts to ensure the value is given using a HTML client refresh. see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface|null

Definition at line 382 of file Maintenance.php.

Referenced by TYPO3\CMS\Install\Middleware\Maintenance\process().

◆ process()

◆ recreatePackageStatesFileIfMissing()

TYPO3\CMS\Install\Middleware\Maintenance::recreatePackageStatesFileIfMissing ( )
protected

Create PackageStates.php if missing and LocalConfiguration exists.

It is fired if PackageStates.php is deleted on a running instance, all packages marked as "part of minimal system" are activated in this case.

Definition at line 361 of file Maintenance.php.

References TYPO3\CMS\Core\Core\Environment\getLegacyConfigPath(), and TYPO3\CMS\Core\Package\PackageInterface\isPartOfMinimalUsableSystem().

Referenced by TYPO3\CMS\Install\Middleware\Maintenance\process().

Member Data Documentation

◆ $configurationManager

ConfigurationManager TYPO3\CMS\Install\Middleware\Maintenance::$configurationManager
protected

◆ $container

ContainerInterface TYPO3\CMS\Install\Middleware\Maintenance::$container
private

◆ $controllers

array TYPO3\CMS\Install\Middleware\Maintenance::$controllers
protected
Initial value:
= array(
'icon' => IconController::class,
'layout' => LayoutController::class,
'login' => LoginController::class,
'maintenance' => MaintenanceController::class,
'settings' => SettingsController::class,
'upgrade' => UpgradeController::class,
'environment' => EnvironmentController::class,
)

List of valid controllers

Definition at line 75 of file Maintenance.php.

◆ $packageManager

FailsafePackageManager TYPO3\CMS\Install\Middleware\Maintenance::$packageManager
protected

◆ $passwordHashFactory

PasswordHashFactory TYPO3\CMS\Install\Middleware\Maintenance::$passwordHashFactory
protected