WebServerConfigurationFileService

class \TYPO3\CMS\Install\Service\WebServerConfigurationFileService

Handles webserver specific configuration files

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

Methods

addWebServerSpecificBackendRoutingRewriteRules()

public addWebServerSpecificBackendRoutingRewriteRules() : bool

Return values

bool

addApacheBackendRoutingRewriteRules()

protected addApacheBackendRoutingRewriteRules() : bool

Return values

bool

addMicrosoftIisBackendRoutingRewriteRules()

protected addMicrosoftIisBackendRoutingRewriteRules() : bool

Return values

bool

getConfigurationFileContent()

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

string

isApache()

protected isApache() : bool

Return values

bool

isMicrosoftIis()

protected isMicrosoftIis() : bool

Return values

bool

performBackendRoutingRewriteRulesUpdate()

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

Return values

bool
On this page