26836[TASK] Class Loader optimisation
Commit message
Review
-
Code review CR +2
- Helmut Hummel +2
- Thomas Maroschik +1
- Markus Klein +1
-
Verified V +2
- Helmut Hummel +2
Issues 1
Files 3
Review log 17
-
Helmut Hummel commented on patch set 1 V -1 CR -2 01/15/14, 14:06
Do NOT review, this is WIP! -
Mr. Jenkins commented on patch set 1 01/15/14, 14:21
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/13019/ : SUCCESS -
Oliver Hader uploaded patch set 2 01/15/14, 22:16
-
Oliver Hader commented on patch set 2 CR -1 01/15/14, 22:16
Still work in progress... -
Mr. Jenkins commented on patch set 2 01/15/14, 22:29
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/13041/ : SUCCESS -
Helmut Hummel uploaded patch set 3 02/01/14, 09:47
-
Mr. Jenkins commented on patch set 3 02/01/14, 10:02
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/13493/ : SUCCESS -
Helmut Hummel uploaded patch set 4 02/13/14, 13:37
-
Helmut Hummel voted on patch set 4 CR 0 02/13/14, 13:37
-
Mr. Jenkins commented on patch set 4 02/13/14, 13:51
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/14038/ : SUCCESS https://ci.typo3.org/job/typo3-v4-core-gerrit/14037/ : SUCCESS -
Markus Klein commented on patch set 4 02/13/14, 14:05
ClassLoader.php:341Why removing this again. AFAIK this was introduced to handle problems with case(in)sensitive filesystems -
Markus Klein commented on patch set 4 CR -1 02/13/14, 14:07
ClassLoader.php:341Reply -
Helmut Hummel commented on patch set 4 02/13/14, 15:11
@Markus: Yes, I removed a fix, which does not work. The real reason why this causes trouble is case sensitivity on case sensitive file systems, while class names in PHP are case insensitive, combined with allowing old style naming conventions like Tx_Foo_Bar Classes like: Vendor\Foo\Bar resolve to ext/foo/Classes/Bar.php Classes like: Tx_Foo_Bar also resolve to ext/foo/Classes/Bar.php At this point in time the class loader cannot know if the class defined in that file is using namespaces or not. When we now instantiate Vendor\Foo\Bar and after that do a class_exists to Tx_Foo_Bar the class loader tries to load the class a second time, but require_once detects that this file has already been loaded. But when we do a class_exists on tx_foo_bar we get a fatal on case insensitive filesystems as the file ext/foo/Classes/bar.php exists but require_once does not detect it is actually the same file. Now in this very case the lines I removed would help as it uppercases every word after the separator, but it still fails with class files that have different casing in the filename or directories. e.g. classes like Tx_Foo_BarBaz or Vendor\Foo\BarBaz still trigger a fatal when instantiating Vendor\Foo\BarBaz and after that call class_exists on tx_foo_barbaz as the fix I removed would convert the path to ext/foo/Classes/Barbaz.php which still differs from ext/foo/Classes/BarBaz.php All the above was btw. true starting with 6.0 (which started to allow both Tx_ and Vendor\ class names to be resolved to paths This is why I created a bugreport http://forge.typo3.org/issues/55418 But until now I have no idea how we can fix this properly. Besides that, the bug that triggered the fatal for Xavier is resolved meanwhile here: https://review.typo3.org/#/c/26999/ All in all these are the reasons I decided to remove a fix that does only fix an edge case, but if you think fixing this edge case is important enough I would also be fine keeping it -
Markus Klein commented on patch set 4 CR +1 02/13/14, 17:17
Thanks for the detailed explanation. I really appreciate that. Fine with me of course then. -
Thomas Maroschik voted on patch set 4 CR +1 02/14/14, 15:00
-
Helmut Hummel voted on patch set 4 V +2 CR +2 02/14/14, 15:33
-
Helmut Hummel merged patch set 5 02/14/14, 15:33