« Previous | Next » 

Revision e9af4a33

IDe9af4a33fc2626ffe79d75a0e9a13ba0d73a1d7c
Parent 627427ff
Child c340454a

Added by Christian Müller over 7 years ago

[BUGFIX] ClassLoader should check sub namespaces

This change cleans the ``ClassLoader`` up and fixes a problem with
nested autoloading namespaces. Before a nested namespace got preference
and was only tried for loading a class. Now every possible path is
tried for nested namespaces.

An example are the two packages:

- guzzlehttp/guzzle
Which declares autoloading as: ``"GuzzleHttp\\": "src/"``

- guzzlehttp/log-subscriber
Which delcares autoloading as: ``"GuzzleHttp\\Subscriber\\Log\\": "src/"``

As the second declaration was nested in the first one it got precedence
for all classes inside of ``GuzzleHttp\\Subscriber\\`` making it
impossible to load classes inside that namespace from the first package.
With this change both paths are tried in order of their nesting level.

Kudos go to Jens Schulze for reporting, preparing an initial fix and the
test.

Change-Id: Ic25bcb039c2bf9976f9f7b34c901bad8e13d528d
Releases: master, 3.0, 2.3
Fixes: FLOW-238

  • added
  • modified
  • copied
  • renamed
  • deleted