feat(app): Allow turning off defined routes and/or auto routing#9749
feat(app): Allow turning off defined routes and/or auto routing#9749lonnieezell wants to merge 6 commits intocodeigniter4:4.7from
Conversation
|
is it possible to do inheritance? get rid of the conditions? nothing like that: This is an assumption, it may not work. |
Well, this was an attempt to do that to some extent, but the AutoRouter relies on the defined routes to ensure that any controllers used in defined routes can't be auto-routed. My preference would have been to separate them completely and have auto-router checked first, ignoring the defined routes. Then, if no route is matched it would move to checking defined routes. That would be nice and clean, but would also be a pretty big breaking change, and a potentially problematic one for lots of sites. So I did it this way hoping to keep things working for all sites as it does now. |
michalsn
left a comment
There was a problem hiding this comment.
Saved time with Auto Routing is nice - that's a useful enhancement.
Most of the suppressed PHPStan errors don't seem related to your code changes. I think it's time to sync the 4.7 branch with develop. I'll try to do that tomorrow.
5de0a16 to
40e9309
Compare
|
It looks like there are commits from a different PR included here. Could you please rebase and make sure only the commits relevant to this PR are included? |
@michalsn Which commits? I did pull down the latest 4.7 and rebased last night. Then cs-fix and rector. |
|
@lonnieezell this one: "refactor(app): Standardize subdomain detection logic" This is clearly a commit from a different PR. We should not see these changes here. However, I'm not sure what happened. You can try: |
40e9309 to
cbbe656
Compare
|
ok, this is a mess and I managed to lose some of the original code. I'm closing for now and will revisit later. |
Description
This allows users to choose which type of routing they want to use - auto routing or defined routing, and turn the other one completely off. This is especially beneficial if you're using auto-routing exclusively because it previously loaded up the entire route collection anyway and dealt with that overhead, even if it was empty.
Estimated performance increases:
Checklist: