‪TYPO3CMS  11.5
TYPO3\CMS\Install\Service\WebServerConfigurationFileService Class Reference

Public Member Functions

 __construct ()
 
 addWebServerSpecificBackendRoutingRewriteRules ()
 

Protected Member Functions

 addApacheBackendRoutingRewriteRules ()
 
 addMicrosoftIisBackendRoutingRewriteRules ()
 
string getConfigurationFileContent (string $filename)
 
bool updateNecessary (string $configurationFileContent)
 
string performBackendRoutingRewriteRulesUpdate (string $pattern, string $newRewriteRule, string $configurationFileContent)
 
 isApache ()
 
 isMicrosoftIis ()
 
 getWebServer ()
 

Protected Attributes

string $webServer
 
string $publicPath
 

Detailed Description

Handles webserver specific configuration files

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

Definition at line 27 of file WebServerConfigurationFileService.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addApacheBackendRoutingRewriteRules()

◆ addMicrosoftIisBackendRoutingRewriteRules()

◆ addWebServerSpecificBackendRoutingRewriteRules()

◆ getConfigurationFileContent()

string TYPO3\CMS\Install\Service\WebServerConfigurationFileService::getConfigurationFileContent ( string  $filename)
protected

Returns the webserver configuration if it exists, is readable and is writeable

Parameters
string$filename‪The webserver configuration file name
Returns
‪string The webserver configuration or an empty string

Definition at line 126 of file WebServerConfigurationFileService.php.

Referenced by TYPO3\CMS\Install\Service\WebServerConfigurationFileService\addApacheBackendRoutingRewriteRules(), and TYPO3\CMS\Install\Service\WebServerConfigurationFileService\addMicrosoftIisBackendRoutingRewriteRules().

◆ getWebServer()

TYPO3\CMS\Install\Service\WebServerConfigurationFileService::getWebServer ( )
protected

◆ isApache()

◆ isMicrosoftIis()

◆ performBackendRoutingRewriteRulesUpdate()

string TYPO3\CMS\Install\Service\WebServerConfigurationFileService::performBackendRoutingRewriteRulesUpdate ( string  $pattern,
string  $newRewriteRule,
string  $configurationFileContent 
)
protected

Removes the 'typo3' directory from the existing "known directory" rewrite rule and adds the new backend rewrite rule between this rule and the frontend rewrite rule.

Pattern must contain three capturing groups: 1: The "known directory" rule from which "typo3" should be removed 2: The "typo3" string to be removed 3: The subsequent part including the frontend rewrite rule

The new rule will then be added between group 1 and group 3.

Parameters
string$pattern
string$newRewriteRule
string$configurationFileContent
Returns
‪string The updated webserver configuration

Definition at line 176 of file WebServerConfigurationFileService.php.

Referenced by TYPO3\CMS\Install\Service\WebServerConfigurationFileService\addApacheBackendRoutingRewriteRules(), and TYPO3\CMS\Install\Service\WebServerConfigurationFileService\addMicrosoftIisBackendRoutingRewriteRules().

◆ updateNecessary()

bool TYPO3\CMS\Install\Service\WebServerConfigurationFileService::updateNecessary ( string  $configurationFileContent)
protected

Checks if the webserver configuration needs to be updated.

This currently checks if the "known directory" rule still contains the typo3 directory and the frontend rewrite rule exists. Later is needed since the backend rewrite rule must be placed before.

Parameters
string$configurationFileContent
Returns
‪bool

Definition at line 146 of file WebServerConfigurationFileService.php.

References TYPO3\CMS\Install\Service\WebServerConfigurationFileService\isApache(), and TYPO3\CMS\Install\Service\WebServerConfigurationFileService\isMicrosoftIis().

Referenced by TYPO3\CMS\Install\Service\WebServerConfigurationFileService\addApacheBackendRoutingRewriteRules(), and TYPO3\CMS\Install\Service\WebServerConfigurationFileService\addMicrosoftIisBackendRoutingRewriteRules().

Member Data Documentation

◆ $publicPath

string TYPO3\CMS\Install\Service\WebServerConfigurationFileService::$publicPath
protected

Definition at line 30 of file WebServerConfigurationFileService.php.

◆ $webServer

string TYPO3\CMS\Install\Service\WebServerConfigurationFileService::$webServer
protected

Definition at line 29 of file WebServerConfigurationFileService.php.