« Previous | Next » 

Revision f4533c9f

IDf4533c9ffe2d2a4dee785582a90b06835b157b3b
Parent d17f44e0
Child e3a893e0

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