Repository navigation
4.3.3 - Prado::using() loads a namespaced class only an autoloader finds - #1685
Merged
Merged
Conversation
This was referenced Nov 28, 2026
Member
Author
|
This is an important fix for 4.3.3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prado::using(), and soPrado::usingClass(), returned null for a namespaced class that was not loaded yet when no class map entry or path alias named it, such as a class Composer autoloads. A component configured by such a class name was rejected. In pradosoft/prado-rpc, aTRpcServiceprovider given as an application's Composer class failed this way, as did the defaultPrado\\Web\\Services\\TRpcServerbefore it was loaded. prado-rpc works around it in pradosoft/prado-rpc#2.using()loads a namespaced class, interface, or trait through the registered autoloaders. One attempt is made per name: an autoloader loads all three kinds by name.Prado::autoload()callsusing(). PHP does not autoload a name again while it is autoloading it, so a name no autoloader finds still returns null without recursion.Prado\\Test\\Unit\\Harness\\Autoloadnamespace that nothing loads earlier. There are also tests for an unknown name throughautoload()and for a directory namespace without*. The three load tests fail without the fix.The same fix for 4.4 is #1686 on master. Checked: php-cs-fixer, PHPStan, and the unit suite pass (8593 tests).