Welcome Guest, Not a member yet? Register   Sign In
Error using base_url inside CLI route
#1

After updating my project from 3.8.5 to 4.4.0 i've encountered an error with my CLI routes that send e-mails with a link to my website. To test I created a new project with composer and tried to echo the base url of my project. If someone could help me I'd be glad.

CLI output:

Code:
PS C:\projects\project-root> php public/index.php home

[AssertionError]

assert($currentURI instanceof SiteURI)

at SYSTEMPATH\Helpers\url_helper.php:52

Routes file:

PHP Code:
<?php

use CodeIgniter\Router\RouteCollection;

/**
* @var RouteCollection $routes
*/
$routes->cli('home''Home::index'); 

Home controller:

PHP Code:
<?php

namespace App\Controllers;

class 
Home extends BaseController
{
    public function 
index()
    {
        echo 
base_url();
    }

Reply


Messages In This Thread
Error using base_url inside CLI route - by estherpeixoto - 09-05-2023, 06:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB