With Joomla! CLI I'm trying to set the force_ssl
to the entire site.
php cli/joomla.php config:set sef=false mailonline=false force_ssl=2 -vvv
But I get an error in administrator/components/com_config/src/Model/ApplicationModel.php
line 364:
[Error] Call to undefined method Joomla\CMS\Application\ConsoleApplication::setUserState()
It works fine with any other config variables. The problem is only with force_ssl
.
Labels |
Added:
No Code Attached Yet
|
A missing live site in the CLI might occur in more situations.
I think populateHttpHost should not set the SERVER if live_site is unset.
and Uri should throw an exception if $_SERVER['HTTP_HOST'] is unset for $uri == 'SERVER'
Enforcing users to set the live_site when ever needed.
it is NOTHING to do with live_site
The exception happens here: https://github.com/joomla/joomla-cms/blob/5.1-dev/administrator/components/com_config/src/Model/ApplicationModel.php#L364
But the reason that the code goes into that
catch
block is becauseUri::getInstance()->getHost()
returns'joomla.invalid'
here https://github.com/joomla/joomla-cms/blob/5.1-dev/administrator/components/com_config/src/Model/ApplicationModel.php#L340 when running in the CLI, and so the later HTTP request in line 354 fails, and we end in thatcatch
block where thesetUserState
call fails.So the question is what to do with that complete check at all when we are in the CLI.