User tests: Successful: Unsuccessful:
Pull Request resolves # .
Currently, creating a HTTP object in Joomla to make http requests requires repetitive boilerplate code like below across our code base to populate userAgent:
$version = new Version();
$httpOption = new Registry();
$httpOption->set('userAgent', $version->getUserAgent('Joomla', true, false));
try {
$http = (new HttpFactory())->getHttp($httpOption);
$response = $http->get($url);
} catch (\RuntimeException) {
$response = null;
}It is even more boilerplate code if we want to support proxy options ( Outbound Proxy was supported when we use Joomla CMS Http package, but was lost when we migrated our code to use framework Http package)
This PRs address that limitation by:
I made a sample change to LanguagesModel to show how to use the Http factory to create http object (the new way). If this PR is accepted, I will make a new PR to convert all existing code in Joomla to use the new http factory to create http object.
Please select:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_installer Libraries |
| Labels |
Added:
PR-6.2-dev
|
||
I have tested this item ✅ successfully on 39a6082
I have tested this successfully. Thanks @joomdonation! Work as described, no console error message, no error log entries (even with Maximum Error Reporting on) etc etc
This pull request has conflicts, please resolve those before we can evaluate the pull request.
| Labels |
Added:
Conflicting Files
|
||
| Labels |
Removed:
Conflicting Files
|
||
As the aware interfaces are in the respective framework packages, wouldn't it better to move it from the cms to the HTTP package as well in this pr?
I meant that you create it there, not that it is already available.
Ah, OK, thanks. For that, I'm unsure, so I added the question to meeting documentation to ask for final decision from maintainers before making PR to move the interface and trait to the framework package.
I have tested this item ✅ successfully on 39a6082
I have tested this successfully. Thanks @joomdonation! Work as described, no console error message, no error log entries (even with Maximum Error Reporting on) etc etc
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47692.