WebServerConfigurationFileService
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.
Table of Contents
Properties
- $publicPath : string
- $webServer : string
Methods
- __construct() : mixed
- addWebServerSpecificBackendRoutingRewriteRules() : bool
- addApacheBackendRoutingRewriteRules() : bool
- addMicrosoftIisBackendRoutingRewriteRules() : bool
- getConfigurationFileContent() : string
- Returns the webserver configuration if it exists, is readable and is writeable
- getWebServer() : string
- isApache() : bool
- isMicrosoftIis() : bool
- performBackendRoutingRewriteRulesUpdate() : string
- 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.
- updateNecessary() : bool
- Checks if the webserver configuration needs to be updated.
Properties
$publicPath
protected
string
$publicPath
$webServer
protected
string
$webServer
Methods
__construct()
public
__construct() : mixed
addWebServerSpecificBackendRoutingRewriteRules()
public
addWebServerSpecificBackendRoutingRewriteRules() : bool
Return values
booladdApacheBackendRoutingRewriteRules()
protected
addApacheBackendRoutingRewriteRules() : bool
Return values
booladdMicrosoftIisBackendRoutingRewriteRules()
protected
addMicrosoftIisBackendRoutingRewriteRules() : bool
Return values
boolgetConfigurationFileContent()
Returns the webserver configuration if it exists, is readable and is writeable
protected
getConfigurationFileContent(string $filename) : string
Parameters
- $filename : string
-
The webserver configuration file name
Return values
string —The webserver configuration or an empty string
getWebServer()
protected
getWebServer() : string
Return values
stringisApache()
protected
isApache() : bool
Return values
boolisMicrosoftIis()
protected
isMicrosoftIis() : bool
Return values
boolperformBackendRoutingRewriteRulesUpdate()
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.
protected
performBackendRoutingRewriteRulesUpdate(string $pattern, string $newRewriteRule, string $configurationFileContent) : string
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
- $pattern : string
- $newRewriteRule : string
- $configurationFileContent : string
Return values
string —The updated webserver configuration
updateNecessary()
Checks if the webserver configuration needs to be updated.
protected
updateNecessary(string $configurationFileContent) : bool
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
- $configurationFileContent : string