Review main Merged

22440[BUGFIX] Class loader tries to load classes it cannot load

Andreas Wolf CR +2 V +2 Easy +7 −0 updated 07/27/13, 20:36

Commit message

If a class file from a third-party package is loaded which does not
follow the Vendor\Product\Classname convention (e.g. Product\Classname),
the class loader still tries to access the third component of the class
name, leading to a warning (and thus an exception, depending on your
configuration).

To fix this problem, the class loader now checks in advance if it can
possibly load this class (or rather if the classname conforms to the
specification for the CMS universe).

Review

  • Code review CR +2
    • Stefan Neufeind +2
  • Verified V +2
    • Stefan Neufeind +2

Issues 1

Files 1

Review log 14

  1. Mr. Jenkins commented on patch set 1 07/20/13, 10:21

  2. Philipp Gampe voted on patch set 1 CR +1 07/20/13, 10:42

  3. Markus Klein updated the commit message in patch set 1 07/20/13, 10:46

  4. Mr. Jenkins commented on patch set 2 07/20/13, 10:47

  5. Markus Klein commented on patch set 2 CR +1 07/20/13, 10:55

    How test this with minimum effort?
  6. Andreas Wolf commented on patch set 2 07/20/13, 11:02

    Just try loading a class from a composer package that only has one namespace path. I had a clone of https://github.com/t3node/TYPO3-BDD, executed composer install and included the autoload.php afterwards. Loading some Symfony file failed afterwards.
  7. Markus Klein voted on patch set 2 V +1 07/22/13, 11:19

  8. Stefan Neufeind commented on patch set 2 CR +1 07/25/13, 22:09

    Change looks okay to me. Just have a nitpick about your example in the comment.

    ClassLoader.php:348

    nitpick: Classname would always be last in this example
  9. Frans Saris voted on patch set 2 CR +1 07/26/13, 21:06

  10. Stefan Neufeind uploaded patch set 3 07/27/13, 20:34

  11. Stefan Neufeind commented on patch set 3 V +2 CR +2 07/27/13, 20:35

    Only took care of the comment-nitpick. Merging with previous votes.
  12. Stefan Neufeind merged patch set 4 07/27/13, 20:35

  13. Mr. Jenkins commented on patch set 3 07/27/13, 20:35

  14. Stefan Neufeind commented on patch set 4 07/27/13, 20:36

    Cherry Picked This patchset was cherry picked to change: I1cd3964b9486ea591fb373533fd6cef4e9ce3989