-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
added a DebuClassLoader::findFile() method to make the wrapping less invasive #7168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👎 for the interface:
|
mh, i think all autoloaders should follow a common interface, maybe its worth to think about a PSR? |
ah I see |
@digitalkaoz Such an interface would have to be in PHP itself, otherwise, you would have to require it first each time (as it cannot be autoloaded before registering the autoloader). And an autoloader in PHP is just a callable. |
Yes @stof, i know, but it would be nice if all autoloaders follows a common pattern , call it a convention ;) |
This PR was merged into the 2.1 branch. Commits ------- 0690709 added a DebuClassLoader::findFile() method to make the wrapping less invasive Discussion ---------- added a DebuClassLoader::findFile() method to make the wrapping less invasive | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT i have classified it as a bug fix, since due to the wrapping it can break assumptions about the loaded class loader, so implementing this method at least doesnt break the assumption that ``findFile()`` is available. actually i think we should also introduced a loader interface to reduce the duct typing --------------------------------------------------------------------------- by stof at 2013-02-24T16:39:46Z :-1: for the interface: - it would make the use of the autoloader more difficult (you would have to require the interface before requiring the loader) - it would forbid using these wrappers with the composer ClassLoader --------------------------------------------------------------------------- by digitalkaoz at 2013-02-24T19:16:36Z mh, i think all autoloaders should follow a common interface, maybe its worth to think about a PSR? --------------------------------------------------------------------------- by lsmith77 at 2013-02-24T19:27:27Z ah I see --------------------------------------------------------------------------- by stof at 2013-02-24T20:33:07Z @digitalkaoz Such an interface would have to be in PHP itself, otherwise, you would have to require it first each time (as it cannot be autoloaded before registering the autoloader). And an autoloader in PHP is just a callable. --------------------------------------------------------------------------- by digitalkaoz at 2013-02-24T20:47:10Z Yes @stof, i know, but it would be nice if all autoloaders follows a common pattern , call it a convention ;)
After upgrading from 2.1.8 and running my tests I get a maximum nesting level error on this exact method. When I echo the $class I see that with every test the search for all required $classes is nested an extra 4 times, resulting in a nesting level limit error at some point. In 2.1.8. I had no problems. If I comment this out all tests pass as well. I am running functional tests with the crawler on a API.
|
i have classified it as a bug fix, since due to the wrapping it can break assumptions about the loaded class loader, so implementing this method at least doesnt break the assumption that
findFile()
is available.actually i think we should also introduced a loader interface to reduce the duct typing