Hey guys,
the registrar does not seem to work (at least for me). I followed th documentation and set it up like so:
-------------------
Code:
<?php
namespace Config;
class Registrar{
public function __construct(){
defined('LOCATION') || define('LOCATION', $_SERVER['CI_ENVIRONMENT']);
}
public static function App(): array{
$conf = [];
$conf['baseURL'] = 'http://192.168.0.1:81/';
if(LOCATION == 'staging') $conf['baseURL'] = 'http://mydomain.com/';
return $conf;
}
}
---------------------
I always get the error
Fatal error: Uncaught CodeIgniter\Exceptions\ConfigException: Config\App::$baseURL "/" is not a valid URL. in ...\vendor\codeigniter4\framework\system\HTTP\SiteURI.php:201
Autodiscovery is set to true.
Its only workig if a manually set the baseURL in App.php but the URL should be set dynamically based on the environment. CI3 was way more comfortable and dynamic to set up.
Anybody knows the problem?
Thanks and kind regards,
Daniel