Bug #66994

Composer autoload path detection is a bit too restricture

Added by Claus Due over 4 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-05-16
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

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.


Related issues

Related to TYPO3 Core - Feature #67808: Introduce "Application" classes for all entry points Closed 2015-06-29
Duplicated by TYPO3 Core - Task #67363: Support Composer classloader from vendor directory Closed 2015-06-09

History

#1 Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39580

#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 about 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 about 4 years ago

Please also have a look at Flow setup which adds a custom ClassLoader which evaluates the root composer.json accordingly.

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 classmap).

#5 Updated by Helmut Hummel about 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.

#6 Updated by Helmut Hummel about 4 years ago

  • Status changed from Accepted to Resolved

#7 Updated by Benni Mack 11 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF