Use internal table locator with fallback classes#1046
Use internal table locator with fallback classes#1046nicosp wants to merge 3 commits intocakephp:3.nextfrom QoboLtd:bake-internal-table-locator
Conversation
src/Command/BakeCommand.php
Outdated
| parent::initialize(); | ||
| // Use our own table locator with fallback classes | ||
| $locator = new TableLocator(); | ||
| $locator->allowFallbackClass(true); |
There was a problem hiding this comment.
I wonder, could we check if there is already one locator defined that has fallback activated?
Then we could skip adding another one.
There was a problem hiding this comment.
We don't have a way to check unless I am missing something.
There was a problem hiding this comment.
nvm. I figured it out. Not ideal but it works for now.
There was a problem hiding this comment.
Yeah, this looks like the safest BC way once we remove it from the app skeleton.
|
Why the hacky try/catch and new instance creation instead of a single line |
|
If we remove the fallback in app skeleton, we might still have existing apps already declare it. |
|
How is simply resetting a flag, even if already set, an overall, instead of recreating a locator instance? |
|
Also replacing the existing locator instance with a new one would lose and customization/config. For e.g. one can set additional locations for the location using the |
|
Yeah there should be no replacement. Only adding if not there yet |
|
@ADmad you might have misread. It does not replace. |
These lines do replace the locator instance. All that needs to be done is toggle on the fallback behavior. |
|
Closing in favor of #1047 |
No description provided.