Skip to content
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

fix: base_url()/site_url() does not work on CLI #7901

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Sep 6, 2023

Description
Follow-up #7282
From https://forum.codeigniter.com/showthread.php?tid=88410

assert($currentURI instanceof SiteURI)
at SYSTEMPATH\Helpers\url_helper.php:34

The following functions (and more) does not work:

  • base_url
  • site_url
  • anchor

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them 4.4 labels Sep 6, 2023
Copy link
Contributor

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. CLIRequest ext. Request ext. OutgoingRequest, but it still has the old URI(). Does it need to be fixed or is it a bug?
https://github.com/kenjis/CodeIgniter4/blob/87454e6f289c3331f3e09d9b0018ae61b01a8dc1/system/HTTP/Request.php#L52C36-L52C36

@kenjis
Copy link
Member Author

kenjis commented Sep 8, 2023

@neznaika0 Thank you for pointing out.
Yes, Request is an incoming, server-side HTTP request.
So it should not have URI. The old code remains in place.
See #6698

@kenjis kenjis merged commit a42b84f into codeigniter4:develop Sep 12, 2023
@kenjis kenjis deleted the fix-cli-base_url branch September 12, 2023 20:41
@kenjis
Copy link
Member Author

kenjis commented Sep 12, 2023

@MGatner Thank you for reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.4 bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants