Commit e67853b5 authored by Helmut Hummel's avatar Helmut Hummel Committed by Benni Mack
Browse files

[TASK] Remove dead and outdated check for TYPO3_PATH_WEB constant

The check for the constant TYPO3_PATH_WEB was an experiment,
to allow a document root with public assets only, but
this never worked out and was never really used.

The check can safely be removed, as it won't do anything
useful anyway.

Also adapt a comment in SystemEnvironmentBuilder
which still refers to this variable/constant and its
usage in the helhum/typo3-secure-web package.
This statement can be removed as helhum/typo3-secure-web
is not actually using that constant/envvar.

Resolves: #91215
Related: #63025
Releases: master
Change-Id: I1b44ba97f4654d1e4e200d7ad1a7c228dba48c25
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64330


Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Tested-by: default avatarJosef Glatz <josefglatz@gmail.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarJosef Glatz <josefglatz@gmail.com>
parent a92fd9f7
......@@ -179,11 +179,14 @@ class SystemEnvironmentBuilder
}
/**
* Absolute path to the root of the typo3 instance. This is often identical to the web document root path (eg. .../public),
* but may be different. For instance helhum/typo3-secure-web uses this: Then, rootPath TYPO3_PATH_ROOT is the absolute path to
* the private directory where code and runtime files are located (currently typo3/ext, typo3/sysext, fileadmin, typo3temp),
* while TYPO3_PATH_WEB is the public/ web document folder that gets assets like fileadmin and Resources/Public folders
* from extensions linked in.
* Absolute path to the "classic" site root of the TYPO3 application.
* This semantically refers to the directory where executable server-side code, configuration
* and runtime files are located (e.g. typo3conf/ext, typo3/sysext, typo3temp/var).
* In practice this is always identical to the public web document root path which contains
* files that are served by the webserver directly (fileadmin/ and public resources).
*
* This is not to be confused with the app-path that is used in composer-mode installations (by default).
* Resources in app-path are located outside the document root.
*
* @param int $entryPointLevel Number of subdirectories where the entry script is located under the document root
* @param int $requestType
......
......@@ -819,15 +819,10 @@ class NormalizedParams
*/
protected static function determineSiteUrl(string $requestDir, string $pathThisScript, string $pathSite): string
{
if (defined('TYPO3_PATH_WEB')) {
// This can only be set by external entry scripts
$siteUrl = $requestDir;
} else {
$pathThisScriptDir = substr(dirname($pathThisScript), strlen($pathSite)) . '/';
$siteUrl = substr($requestDir, 0, -strlen($pathThisScriptDir));
$siteUrl = rtrim($siteUrl, '/') . '/';
}
return $siteUrl;
$pathThisScriptDir = substr(dirname($pathThisScript), strlen($pathSite)) . '/';
$siteUrl = substr($requestDir, 0, -strlen($pathThisScriptDir));
return rtrim($siteUrl, '/') . '/';
}
/**
......
......@@ -2777,12 +2777,9 @@ class GeneralUtility
$retVal = self::getIndpEnv('TYPO3_REQUEST_HOST') . self::dirname(self::getIndpEnv('SCRIPT_NAME')) . '/';
break;
case 'TYPO3_SITE_URL':
$url = self::getIndpEnv('TYPO3_REQUEST_DIR');
// This can only be set by external entry scripts
if (defined('TYPO3_PATH_WEB')) {
$retVal = $url;
} elseif (Environment::getCurrentScript()) {
if (Environment::getCurrentScript()) {
$lPath = PathUtility::stripPathSitePrefix(PathUtility::dirnameDuringBootstrap(Environment::getCurrentScript())) . '/';
$url = self::getIndpEnv('TYPO3_REQUEST_DIR');
$siteUrl = substr($url, 0, -strlen($lPath));
if (substr($siteUrl, -1) !== '/') {
$siteUrl .= '/';
......
Supports Markdown
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