Skip to content

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

@pietos

Description

@pietos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions