Skip to content

[4.x] Deprecate the socket transport - #90

Open
Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-deprecate-socket-transport
Open

Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-deprecate-socket-transport

Conversation

@Hackwar

@Hackwar Hackwar commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary of Changes

The socket transport implements HTTP/1.x by hand on top of fsockopen(): it cannot be configured for TLS (no stream context, so no CA bundle, minimum TLS version or client certificate), does not support proxies and does not decode chunked responses. The cURL and stream transports cover every environment in which it would be picked: the stream transport only needs allow_url_fopen.

This deprecates it ahead of its removal in 5.0:

  • @deprecated 5.0 on the class;
  • a constructor that calls trigger_deprecation('joomla/http', '__DEPLOY_VERSION__', …) and then the parent constructor;
  • symfony/deprecation-contracts (^2|^3, as in the other framework packages) is added to require; it is the package's first use of it.

The removal for 5.0 follows in a separate PR against 5.x-dev.

Testing Instructions

Tests/Transport/SocketDeprecationTest.php (new): creating a Socket raises exactly one E_USER_DEPRECATED with the removal notice (before: none). The existing transport tests still pass with the deprecation (it is silenced the usual way).

Documentation Changes Required

docs/classes/TransportInterface.md: the transport table marks Transport\Socket as deprecated. The 5.0 update guide entry is added with the removal PR (there is no docs/v4-to-v5-update.md on 4.x-dev).

🤖 Generated with Claude Code

The socket transport implements HTTP/1.x by hand: it cannot be configured
for TLS, does not support proxies and does not decode chunked responses.
The cURL and stream transports cover every environment it is used in.

Mark it deprecated and trigger a deprecation when it is created, ahead of
its removal in 5.0. This adds symfony/deprecation-contracts as a
dependency, as in the other framework packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Hackwar

Hackwar commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

I agree with deprecating it, but the question would be if we want to wait until 6.0 for the removal or already do this in 5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant