[4.0] Trigger deprecation notices in the CacheController, minor code restructuring for legacy loader#24705
Merged
wilsonge merged 1 commit intojoomla:4.0-devfrom Apr 24, 2019
mbabker:cache-controller-cleanup
Merged
[4.0] Trigger deprecation notices in the CacheController, minor code restructuring for legacy loader#24705wilsonge merged 1 commit intojoomla:4.0-devfrom mbabker:cache-controller-cleanup
wilsonge merged 1 commit intojoomla:4.0-devfrom
mbabker:cache-controller-cleanup
Conversation
wilsonge
reviewed
Apr 23, 2019
| @@ -102,29 +102,35 @@ public static function getInstance($type = 'output', $options = array()) | |||
| } | |||
| catch (\RuntimeException $e) | |||
Contributor
There was a problem hiding this comment.
If we're doing this can we change this to a PSR KeyNotFoundException please
Contributor
Author
There was a problem hiding this comment.
It's not a container exception. The default cache controller factory is throwing RuntimeException, it might be better to define a Joomla\CMS\Cache\Exception\ControllerNotFoundException to be thrown by the factory but that's beyond scope of this PR.
Contributor
Author
There was a problem hiding this comment.
(Plus that new Exception could be the type thrown by the legacy load path if the class isn't resolved)
Contributor
|
Thanks! |
fancyFranci
pushed a commit
to fancyFranci/joomla-cms
that referenced
this pull request
Apr 24, 2019
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.
Summary of Changes
Move the legacy controller loading code into the catch block, it's rather easy when reading the file to think all of that code should be executed but in reality it is a fallback if the factory fails to create a controller
Trigger deprecation notices when adding new paths or loading controllers through the legacy code path
Testing Instructions
Code review, the odds of anyone having some pre-existing code implementing a custom cache controller laying around are pretty slim.