Composer autoload path detection is a bit too restricture
Problem: the current resolving of autoloading paths relies on two hardcoded paths which completely break if any segment of the path involved is a symlink.
Example: typo3_src in DOCUMENT_ROOT is symlink to other folder. Autoloader file resolving attempts to load file using a bizarro ../../../../../...... path.
Suggested fix: allow configuring this as an ENV variable.
#2 Updated by Helmut Hummel over 4 years ago
- Status changed from Under Review to Needs Feedback
Claus Due wrote:
Example: typo3_src in DOCUMENT_ROOT is symlink to other folder.
How did that happen? If you install TYPO3 with composer (in a currently supported way), typo3_src is a folder, not a symlink.
#3 Updated by Helmut Hummel over 4 years ago
- Status changed from Needs Feedback to Accepted
OK. After thinking about this a bit longer, I came to the conclusion to agree that we need to be more flexible here.
My current idea:
The typo3/composer-installer plugin should evaluate the vendor dir specified in the root composer.json and should write an autoload.php file into the typo3 sources directory. This way we could always only require this file, while the user has full flexibility by being able to specify the path to the vendor dir.
#4 Updated by Mathias Brodala over 4 years ago
Please also have a look at Flow setup which adds a custom ClassLoader which evaluates the root
Going a step back I'd like to ask, if we need all this stuff at all, especially in light of #67212. If the Composer
autoload.php is already included before our bootstrap is launched, everything will just work. Of course we need some kind of handling for legacy extensions without Composer autoload configuration (e.g. via
#5 Updated by Helmut Hummel over 4 years ago
This is now resolved elegantly with #67808 being merged in master and some adaptions to the installer plugin, (exactly like I have written before).
Basically it does not matter any more where the vendor dir is. TYPO3 always finds the class loading information from composer, without any additional configuration.