PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
26 Apr 2026

Pull Request resolves # .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

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:

  • Introduce HttpClientFactory to create http object with options use userAgent, proxy pre-populated (if not specified by client code)
  • Make the http factory accessible from container
  • Inject http factory and make it auto-injected to controllers/models when it is needed

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.

Testing Instructions

  • Use Joomla 6.2
  • Apply patch
  • Access to System -> Languages -> Install Languages, make languages are loaded properly

Actual result BEFORE applying this Pull Request

  • Works. But we have to write boilerplate/repeating same code in Joomla to create Http object

Expected result AFTER applying this Pull Request

  • Works. Not having to write boilerplate code to create Http object anymore. Plus, it is ready to support outbound proxy in Joomla again (there are changes in Joomla framework package is needed, I saw a PR for that already available)

Link to documentations

Please select:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

avatar joomdonation joomdonation - open - 26 Apr 2026
avatar joomdonation joomdonation - change - 26 Apr 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Apr 2026
Category Administration com_installer Libraries
avatar joomdonation joomdonation - change - 26 Apr 2026
Labels Added: PR-6.2-dev
avatar exlemor exlemor - test_item - 27 Apr 2026 - Tested successfully
avatar exlemor
exlemor - comment - 27 Apr 2026

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.

avatar exlemor
exlemor - comment - 27 Apr 2026

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.

avatar github-actions[bot]
github-actions[bot] - comment - 24 May 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

avatar joomdonation joomdonation - change - 29 May 2026
Labels Added: Conflicting Files
7780e26 29 May 2026 avatar joomdonation CS
avatar joomdonation joomdonation - change - 29 May 2026
Labels Removed: Conflicting Files
f255cd3 29 May 2026 avatar joomdonation CS
avatar laoneo
laoneo - comment - 29 May 2026

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?

avatar joomdonation
joomdonation - comment - 30 May 2026

@laoneo I checked the framework http package and do not see aware interfaces there. Are you sure it is available?

avatar laoneo
laoneo - comment - 30 May 2026

I meant that you create it there, not that it is already available.

avatar joomdonation
joomdonation - comment - 30 May 2026

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.

avatar richard67
richard67 - comment - 3 Jun 2026

We have discussed it in the maintainers team and agree with @laoneo that the framework would be the better place for it.

Add a Comment

Login with GitHub to post a comment