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

Bug: Calling the base_url() from the cli results into assert($currentURI instanceof SiteURI) #8059

Closed
pietos opened this issue Oct 18, 2023 · 1 comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@pietos
Copy link

pietos commented Oct 18, 2023

PHP Version

8.1

CodeIgniter4 Version

4.4.1

CodeIgniter4 Installation Method

Manual (zip or tar.gz)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MariaDB 10.2

What happened?

Since I upgraded to 4.4.1 I can't use the base_url() anymore from the CLI.
I verified this in multiple projects and it all results into:

[AssertionError]

assert($currentURI instanceof SiteURI)

at SYSTEMPATH\Helpers\url_helper.php:52

Similar to this issue:
https://forum.codeigniter.com/showthread.php?tid=88410

Steps to Reproduce

  • Create a controller called worker and function test that includes base_url()
	public function test()
	{

		echo base_url();exit;

         }
  • On the cli: php public/index.php worker test

Expected Output

The base_url as a string

Anything else?

No response

@pietos pietos added the bug Verified issues on the current code behavior or pull requests that will fix them label Oct 18, 2023
@kenjis
Copy link
Member

kenjis commented Oct 18, 2023

It was fixed by #7901.
Try the latest develop branch.

@kenjis kenjis closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

No branches or pull requests

2 participants