User tests: Successful: Unsuccessful:
Pull Request for Issue #35625 .
set a default
With the command php cli/joomla.php list, you get a list of all available CLI commands.
The script throws a PHP notice if the system plugin "System - Page Cache" is enabled:
Notice: Undefined index: HTTP_HOST in /xxx/libraries/src/Uri/Uri.php on line 103
No Notice
no
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
make more sense now ?
@alikon I don't think that it is a good idea to prepare Uri
to understand the Application context and change the internal behavior according to the execution.
If an object has to use "isClient", then it is a bad signal and it is better to think twice about what we are doing.
The problem is the application context mismatch, why the current Application is calling Uri without sending the right parameter.
As I pointed out in #35818, the problem is that the Content Component boots the Site Application with $container->get(SiteApplication::class)
. The Content Component doesn't have to force the Site Application.
About #35625, the problem is that the php cli/joomla.php list
is firing the "System - Page Cache" when it's called from the console. Why would a console application fire the "System - Page Cache" plugin? It shouldn't. By default, a console application doesn't have to interact with the site cache.
I have tested this item
With the code and tutorial I wrote yesterday I can confirm this works as described.
I have tested this item
No No No.
Faking an URL 'localhost' into $_SERVER['HTTP_HOST'] is not the way to solve it.
The problem is the "System - Page Cache" plugin executing in the console context. The plugin must ignore the execution when it is in the console context.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-11-06 09:12:29 |
Closed_By | ⇒ | alikon | |
Labels |
Added:
?
|
Although this mutes the PHP Notice, it is not the correct fix. Look at Uri.php and you will see the Notice comes when Joomla assumes you are running IIS
The correct fix is to make Uri.php CLI Aware and not have it try to generate http urls using invalid data.