-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
rework: URI creation and URL helper #7282
Conversation
f93e1dd
to
1cd23f7
Compare
4463439
to
43e8df1
Compare
69675b1
to
1e1b087
Compare
bb7229b
to
257357a
Compare
All checks passed! However, to be honest I am a little concerned about whether the existing Controller/HTTP tests will be broken. |
c0838c4
to
c1f5b60
Compare
Rebased. |
c1f5b60
to
ad50637
Compare
ad50637
to
1300aea
Compare
1300aea
to
cdd4614
Compare
b47fa76
to
fc6c3a6
Compare
Co-authored-by: MGatner <[email protected]>
1ba6f36
to
c6f3d57
Compare
I expect few tests to fail unless you test the URI by setting the state of dependent objects and/or global variables, as CI4 does. I don't think this is such an unrealistic expectation, since in a normal web app, site URIs are rarely tested. |
Thank you for reviews! |
🥳 |
Needs
#7252,#7256,#7297Description
Fixes #7123, #7296, #7643
$this->request->getUri()
returns a normalized current URI (SiteURI
)$indexPage
isindex.php
, the URI containsindex.php
$this->request->getUri()->getPath()
returns full URI pathcurrent_url(true)
returns the same instance with$this->request->getUri()
base_url()
andsite_url()
now support protocol-relative linksControllerTestTrait::withUri()
updates the Request instance, too. Because the Request instance has the URI instance. See https://forum.codeigniter.com/showthread.php?tid=88213SiteURIFactory
,SiteURI
Services::siteurifactory()
Services::superglobals()
SiteURI::baseUrl()
andSiteURI::siteUrl()
_get_uri()
site_url()
,base_url()
,current_url()
useSiteURI
(Services::request()->getUri()
)Before:
After:
Checklist: