Download the PHP package nadar/ratchetphp without Composer
On this page you can find all versions of the php package nadar/ratchetphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nadar/ratchetphp
More information about nadar/ratchetphp
Files in nadar/ratchetphp
Package ratchetphp
Short Description PHP WebSocket library (PHP 8.5 compatible fork of Ratchet)
License MIT
Homepage http://socketo.me
Informations about the package ratchetphp
Ratchet (nadar fork)
A PHP library for asynchronously serving WebSockets. Build up your application through simple interfaces and re-use your application without changing any of its code just by combining different components.
About this fork
nadar/ratchetphpis a maintenance fork of Ratchet focused on PHP 8.5 compatibility. PHP 8.5 deprecated theSplObjectStoragealias methodsattach(),detach()andcontains()in favour of theArrayAccessmethodsoffsetSet(),offsetUnset()andoffsetExists()(see the PHP 8.5 deprecations RFC). This fork replaces every deprecated call so running Ratchet on PHP 8.5 no longer emits deprecation notices. This fork requires PHP 8.5.⚠️ Switching the dependency is not enough. The deprecated
SplObjectStoragemethods are typically also used in your own application code (the classic chat example keeps its clients in anSplObjectStorage), socomposer updatealone will not silence the deprecations — you have to update that code too. See UPGRADE.md for the human guide and AGENTS.md for a checklist an AI agent can follow.
Installation
Already using plesk/ratchetphp (or upstream Ratchet)? Read
UPGRADE.md first — you will need to update SplObjectStorage
calls in your own code.
Requirements
- PHP 8.5 or higher.
Shell access is required and root access is recommended. To avoid proxy/firewall blockage it's recommended WebSockets are requested on port 80 or 443 (SSL), which requires root access. In order to do this, along with your sync web stack, you can either use a reverse proxy or two separate machines. You can find more details in the server conf docs.
Documentation
User and API documentation is available on Ratchet's website: http://socketo.me
See https://github.com/cboden/Ratchet-examples for some out-of-the-box working demos using Ratchet.
A quick example
$ php chat.php
Note:
SplObjectStorageitself still works on PHP 8.5 — only its alias methodsattach(),detach()andcontains()were deprecated. The example above already uses theArrayAccessequivalents ($clients[$conn] = null;,unset($clients[$conn]);,isset($clients[$conn])), so it runs on PHP 8.5 without any deprecation notices. See UPGRADE.md if you need to migrate the same pattern in your own application code.
Checking PHP 8.5 compatibility
This fork ships tooling to verify PHP 8.5 compatibility:
The GitHub Actions CI runs the test suite, the PHPCompatibility check and the coding-standards check against PHP 8.5 on every push and pull request.
License
MIT — see LICENSE.
All versions of ratchetphp with dependencies
ratchet/rfc6455 Version ^0.4.0
react/socket Version ^1.13.0
react/event-loop Version ^1.4.0
guzzlehttp/psr7 Version ^2.5.0
symfony/http-foundation Version ^7.0
symfony/routing Version ^7.0