PHP Version
8.3
CodeIgniter4 Version
4.6
CodeIgniter4 Installation Method
Git
Which operating systems have you tested for this bug?
Linux
Which server did you use?
cli-server (PHP built-in webserver)
What happened?
At the moment, Superglobals looks like a stub. There are no necessary actions:
-
There is no getting all the values as an array. For example, to replace it in the Router: $this->globals['server'] = $_SERVER;
|
if ($host !== null) { |
|
$request = service('request'); |
|
$_SERVER = $request->getServer(); |
|
$_SERVER['HTTP_HOST'] = $host; |
|
$request->setGlobal('server', $_SERVER); |
|
} |
-
The server() method can return not only a string, but also string|int|float|array. Array for argv, float for REQUEST_TIME
|
public function server(string $key): ?string |
-
Keys cannot be deleted as unset($_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'])
|
unset($_ENV['CI_ENVIRONMENT'], $_SERVER['CI_ENVIRONMENT']); |
-
Something important is in the process..
To upgrade to Superglobals, you need to check the all code. Because in many places, $_SERVER is overwritten. I'll try to get started.
I could send a PR, but I need to understand what to do. Is the function that I described enough for this?
I'm really sorry, this is more of a feature request. But I have problems accessing the forum.
PHP Version
8.3
CodeIgniter4 Version
4.6
CodeIgniter4 Installation Method
Git
Which operating systems have you tested for this bug?
Linux
Which server did you use?
cli-server (PHP built-in webserver)
What happened?
At the moment, Superglobals looks like a stub. There are no necessary actions:
There is no getting all the values as an array. For example, to replace it in the
Router:$this->globals['server'] = $_SERVER;CodeIgniter4/system/Commands/Utilities/Routes.php
Lines 89 to 94 in e475fd8
The server() method can return not only a
string, but alsostring|int|float|array. Array for argv, float for REQUEST_TIMECodeIgniter4/system/Superglobals.php
Line 33 in e475fd8
Keys cannot be deleted as
unset($_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'])CodeIgniter4/system/Commands/Utilities/Environment.php
Line 121 in e475fd8
Something important is in the process..
To upgrade to Superglobals, you need to check the all code. Because in many places, $_SERVER is overwritten. I'll try to get started.
I could send a PR, but I need to understand what to do. Is the function that I described enough for this?
I'm really sorry, this is more of a feature request. But I have problems accessing the forum.