Bug #91074
closedtypo3conf/ folder is not created when using a custom app-dir that is not an ancestor of the public directory
0%
Description
In composer mode in composer.json:
"extra": {
"typo3/cms": {
"app-dir": "custom",
"web-dir": "public"
}
},
In this case Environment::$projectPath would be /path/to/root/custom and Environment::$publicPath would be /path/to/root/public.
The typo3conf folder is then generated in /path/to/root/custom/typo3conf instead of /path/to/root/public/typo3conf.
This is actually by accident, because "custom" and "public" have the same length.
Reason is the code in https://git.typo3.org/Packages/TYPO3.CMS.git/blob/9fb677f6f3b3a1cd584b9ef183b35da771d3e25d:/typo3/sysext/install/Classes/FolderStructure/DefaultFactory.php#l134
$publicPath = substr(Environment::getPublicPath(), strlen(Environment::getProjectPath())+1);
which tries to substract the project path from the public path, while assuming that project path is an ancestor, which results in a public path
""
to be calculate.The result should rather be
"../public"
.
We should rather generate a relative path and adapt the FolderStructur Factory to handle relative paths, include partent dots ("..").
Updated by Benni Mack over 4 years ago
- Target version changed from 10 LTS to next-patchlevel
Updated by Benjamin Franzke almost 3 years ago
- Status changed from New to Rejected
Closing, app-dir
will be removed with typo3/cms-composer-installers
v4:
https://github.com/TYPO3/CmsComposerInstallers/releases/tag/v4.0.0-RC1
Breaking changes
It is not possible any more to change app-dir or root-dir within the root composer.json Only web-dir can still be changed,
but it needs to be a sub directory of the composer.json directory