Compare commits

...

71 Commits

Author SHA1 Message Date
df967fb108 Change require to use react/socket
Some checks failed
CI / PHPUnit (highest, 5.4) (push) Has been cancelled
CI / PHPUnit (highest, 5.5) (push) Has been cancelled
CI / PHPUnit (highest, 5.6) (push) Has been cancelled
CI / PHPUnit (highest, 7.0) (push) Has been cancelled
CI / PHPUnit (highest, 7.1) (push) Has been cancelled
CI / PHPUnit (highest, 7.2) (push) Has been cancelled
CI / PHPUnit (highest, 7.3) (push) Has been cancelled
CI / PHPUnit (highest, 7.4) (push) Has been cancelled
CI / PHPUnit (lowest, 5.4) (push) Has been cancelled
2025-04-09 23:45:36 +08:00
378f8201bb Update dep
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 23:16:21 +08:00
070b34dca5 Update dependencies
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 23:12:34 +08:00
1e9ebee316 Update on dependecies require
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 23:06:24 +08:00
5cdf7a56f6 Update dependencies
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 22:59:16 +08:00
5eb085e312 remove unused
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 19:50:27 +08:00
5bc609ccd7 updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 19:48:51 +08:00
b36d03dc03 Updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 19:44:17 +08:00
51828a7d3f Update version
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 18:36:55 +08:00
6313156a71 Minor update
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 17:42:55 +08:00
d2dfaa267c Updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 16:36:22 +08:00
476c0326f1 Updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 15:21:07 +08:00
e88f792e6d Updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 15:15:16 +08:00
2763c771a8 Updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 15:10:12 +08:00
84daca4a8a Updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 15:04:05 +08:00
73a939c102 Updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 15:00:07 +08:00
50725bbf4c major update
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 14:56:59 +08:00
11a39c8e46 Update on null args
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 14:33:22 +08:00
e70d9d7a96 Updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 14:24:56 +08:00
eab09f30df Minor update to cater php8
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 14:21:15 +08:00
05bb6c9d4e Updates
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 14:14:49 +08:00
fbaa2cfed0 Minor update on composer.json
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 14:11:44 +08:00
Faeez Mazlan
cb2297f0a0 Minor update
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2025-04-09 14:10:29 +08:00
Christian Lück
d77c7bcd07 Reviving Ratchet!
Some checks are pending
CI / PHPUnit (highest, 5.4) (push) Waiting to run
CI / PHPUnit (highest, 5.5) (push) Waiting to run
CI / PHPUnit (highest, 5.6) (push) Waiting to run
CI / PHPUnit (highest, 7.0) (push) Waiting to run
CI / PHPUnit (highest, 7.1) (push) Waiting to run
CI / PHPUnit (highest, 7.2) (push) Waiting to run
CI / PHPUnit (highest, 7.3) (push) Waiting to run
CI / PHPUnit (highest, 7.4) (push) Waiting to run
CI / PHPUnit (lowest, 5.4) (push) Waiting to run
2024-05-13 18:57:30 +02:00
Chris Boden
5012dc9545 Format changelog 2021-12-13 19:20:41 -05:00
Chris Boden
3b6125c59c
Merge pull request #929 from ratchetphp/v0.4.4
v0.4.4
2021-12-13 19:14:50 -05:00
Chris Boden
274054cb53 Update licence 2021-12-13 19:07:50 -05:00
Chris Boden
6771d2391d Update changelog and version 2021-12-13 19:06:48 -05:00
Chris Boden
73937da52a
Merge pull request #926 from frank9999/symfony6
Add Symfony 6 support
2021-12-12 18:12:14 -05:00
Frank Schreuder
7f1cc6d9d2 Add Symfony 6 support 2021-12-12 23:58:39 +01:00
Chris Boden
3d18955fe7 Use latest RFC6455 lib 2021-12-12 11:58:22 -05:00
Chris Boden
928854ac4c Merge branch 'Minifets-master' into v0.4.4 2021-12-12 11:55:12 -05:00
minifets@DESKTOP-QP6P5N5.localdomain
5b0194167e Revert "Update composer.json"
This reverts commit 5ebe073fee0f04a7d26aaa0504b0e8b69d0d2e36.
2021-12-12 11:54:06 -05:00
Minifets
3e97459d3f Update composer.json 2021-12-12 11:54:06 -05:00
Melnikov Alexandr
409139fabd Added context to App facade constructor 2021-12-12 11:54:06 -05:00
Chris Boden
08480d1811 Fix case on futureTick 2021-12-12 11:42:12 -05:00
Chris Boden
c3c83ea4c0 Merge branch 'erikn69-#922-support_psr7_2_0' into v0.4.4
# Conflicts:
#	composer.json
2021-12-12 11:42:03 -05:00
Chris Boden
547c117e6c
Merge pull request #896 from mbabker/patch-2
Add ReturnTypeWillChange attribute to silence PHP 8.1 deprecations
2021-12-12 11:38:34 -05:00
Chris Boden
6512da0c6c Lock minimum implicity dependency 2021-12-12 11:35:34 -05:00
Chris Boden
05b1e85365 Replace futureTick for older versions 2021-12-12 11:27:06 -05:00
Chris Boden
c5920ac1ce Skip Session tests until ini_set issue resolved 2021-12-12 11:19:46 -05:00
Erik Niebla
d239e94d19 Support for PSR7 2.x 2021-12-01 08:47:38 -05:00
Matt Bonneau
78fb27b015
Merge pull request #900 from zidingz/patch-1
Create SECURITY.md
2021-08-31 13:43:51 -04:00
Matt Bonneau
5a83bd3e4a Add email addresses to SECURITY.md 2021-08-31 13:40:20 -04:00
Ziding Zhang
f1ddbc7391
Create SECURITY.md
A simple instruction for security researchers.
2021-08-31 10:34:35 +01:00
Michael Babker
a30da130e3
Add ReturnTypeWillChange attribute to silence PHP 8.1 deprecations 2021-07-25 16:26:20 -05:00
Chris Boden
36983e12ff
Merge pull request #856 from simPod/ga
Add Github actions so CI runs
2021-01-26 09:05:50 -05:00
Simon Podlipsky
2a6d3aba7c Add Github actions so CI runs 2021-01-26 14:53:25 +01:00
Chris Boden
466a0ecc83
Merge pull request #814 from ratchetphp/v0.4.3-release
Prep for v0.4.3 release
2020-07-07 11:50:14 -04:00
Chris Boden
e78f8b5d0e Prep for v0.4.3 release 2020-06-04 10:22:07 -04:00
Chris Boden
dbc93b73d8
Merge pull request #809 from nineff/master
update to newest RFC6455 library version
2020-06-04 09:57:24 -04:00
Chris Boden
9ce2a127be
Merge pull request #810 from ratchetphp/fix-786
App should accept Ws MCI
2020-06-04 09:57:01 -04:00
Chris Boden
1942c97a7b App should accept Ws MCI 2020-05-28 11:16:10 -04:00
Nikolai Neff
4ea97511bf
update to newest RFC6455 library version 2020-05-25 17:47:42 +02:00
Matt Bonneau
57721e1f18
Merge pull request #766 from simPod/allow-symfony-5
Allow Symfony 5
2020-01-27 18:08:40 -05:00
Simon Podlipsky
b19d2aa885 Allow Symfony 5 2019-11-22 19:34:45 +01:00
Matt Bonneau
63868ca7ba
Merge pull request #746 from devgnx/patch-1
Fix server configuration link on docs
2019-07-15 12:06:04 -04:00
André Silva
bb1c571133
Fix server configuration link on docs 2019-07-14 22:30:48 -03:00
Matt Bonneau
b85c2a1f18
Merge pull request #722 from ratchetphp/no-tick-test
Stop using removed tick method
2019-03-10 13:14:50 -04:00
Chris Boden
963dff5b24 No more HHVM 2019-03-10 13:06:16 -04:00
Chris Boden
8a00b66715 Stop using removed tick method 2019-03-10 12:59:44 -04:00
Matt Bonneau
6bb65ffb6b
Fix example in README.md fixes #690 2018-12-13 21:40:51 -05:00
Matt Bonneau
bca7183c5a
Merge pull request #624 from FreeElephants/issue-576-disable-xdebux-warning
Issue #576: disable xdebux warning
2018-03-06 09:44:14 -05:00
Matt Bonneau
8bc7b9f4af Remove IDE from .gitignore 2018-03-06 09:28:01 -05:00
Matt Bonneau
cc56ca2451
Merge pull request #625 from FreeElephants/issue-623-use-vendor-phpunit
Issue 623 use vendor phpunit
2018-03-06 09:20:34 -05:00
samizdam
19a0a5b3e3 Use phpunit from vendor in Makefile. 2018-03-03 00:29:11 +03:00
samizdam
0b6fac212c Use RATCHET_DISABLE_XDEBUG_WARN env var for disable user warning. 2018-03-03 00:19:44 +03:00
samizdam
77b879c114 Ignore IDE files. 2018-03-03 00:12:06 +03:00
samizdam
82f2505b13 Merge branch 'master' of github.com:ratchetphp/Ratchet 2018-03-02 23:57:14 +03:00
samizdam
101f54dedc Merge tag 'v0.3.6' 2017-01-24 23:37:45 +03:00
samizdam
60e3bb85dd Factory new Request Url from url, instead path only: keep original request host, scheme, etc. 2016-11-25 21:18:44 +03:00
74 changed files with 344 additions and 246 deletions

52
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: "CI"
on:
pull_request:
push:
branches:
- "master"
schedule:
- cron: "42 3 * * *"
jobs:
phpunit:
name: "PHPUnit"
runs-on: "ubuntu-20.04"
strategy:
matrix:
php-version:
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
dependencies:
- "highest"
include:
- dependencies: "lowest"
php-version: "5.4"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
ini-values: "zend.assertions=1"
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
- name: "Run PHPUnit"
run: "vendor/bin/phpunit"

View File

@ -1,20 +0,0 @@
language: php
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm
dist: trusty
matrix:
allow_failures:
- php: hhvm
before_script:
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "session.serialize_handler = php" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- php -m
- composer install --dev --prefer-source

View File

@ -8,6 +8,21 @@ CHANGELOG
---
* 0.4.4 (2021-12-11)
* Correct and update dependencies for forward compatibility
* Added context for React Socket server to App
* Use non-deprecated Guzzle API calls
* 0.4.3 (2020-06-04)
* BF: Fixed interface acceptable regression in `App`
* Update RFC6455 library with latest fixes
* 0.4.2 (2020-01-27)
* Support Symfony 5
* BF: Use phpunit from vendor directory
* Allow disabling of xdebug warning by defining `RATCHET_DISABLE_XDEBUG_WARN`
* Stop using `LoopInterface::tick()` for testing
* 0.4.1 (2017-12-11)
* Only enableKeepAlive in App if no WsServer passed allowing user to set their own timeout duration
* Support Symfony 4

View File

@ -1,4 +1,4 @@
Copyright (c) 2011-2017 Chris Boden
Copyright (c) 2011 Chris Boden
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -2,10 +2,10 @@
# Users do not need to use `make`; Ratchet does not need to be compiled
test:
phpunit
vendor/bin/phpunit
cover:
phpunit --coverage-text --coverage-html=reports/coverage
vendor/bin/phpunit --coverage-text --coverage-html=reports/coverage
abtests:
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8001 LibEvent &

View File

@ -1,18 +1,23 @@
# Ratchet
[![Build Status](https://secure.travis-ci.org/ratchetphp/Ratchet.png?branch=master)](http://travis-ci.org/ratchetphp/Ratchet)
[![GitHub Actions][GA Image]][GA Link]
[![Autobahn Testsuite](https://img.shields.io/badge/Autobahn-passing-brightgreen.svg)](http://socketo.me/reports/ab/index.html)
[![Latest Stable Version](https://poser.pugx.org/cboden/ratchet/v/stable.png)](https://packagist.org/packages/cboden/ratchet)
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.
## Reviving Ratchet!
We're currently aiming to revive Ratchet to get it up to date with the latest versions and use this as a starting point for bigger updates to come.
We need your help to achieve this goal, see [ticket #1054](https://github.com/ratchetphp/Ratchet/issues/1054) for ways to help out. ❤️
## Requirements
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](http://socketo.me/docs/deploy#serverconfiguration).
You can find more details in the [server conf docs](http://socketo.me/docs/deploy#server_configuration).
### Documentation
@ -28,8 +33,8 @@ Need help? Have a question? Want to provide feedback? Write a message on the
```php
<?php
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\ConnectionInterface;
// Make sure composer dependencies have been installed
require __DIR__ . '/vendor/autoload.php';
@ -68,7 +73,7 @@ class MyChat implements MessageComponentInterface {
// Run the server application through the WebSocket protocol on port 8080
$app = new Ratchet\App('localhost', 8080);
$app->route('/chat', new MyChat);
$app->route('/chat', new MyChat, array('*'));
$app->route('/echo', new Ratchet\Server\EchoServer, array('*'));
$app->run();
```
@ -81,3 +86,7 @@ class MyChat implements MessageComponentInterface {
conn.onmessage = function(e) { console.log(e.data); };
conn.onopen = function(e) { conn.send('Hello Me!'); };
```
[GA Image]: https://github.com/ratchetphp/Ratchet/workflows/CI/badge.svg
[GA Link]: https://github.com/ratchetphp/Ratchet/actions?query=workflow%3A%22CI%22+branch%3Amaster

8
SECURITY.md Normal file
View File

@ -0,0 +1,8 @@
# Security Policy
## Reporting a Vulnerability
Please report security issues to:
* Chris Boden [cboden@gmail.com](cboden@gmail.com)
* Matt Bonneau [matt@bonneau.net](matt@bonneau.net)

View File

@ -1,5 +1,5 @@
{
"name": "cboden/ratchet"
"name": "mfmdevsystem/mxsocket"
, "type": "library"
, "description": "PHP WebSocket library"
, "keywords": ["WebSockets", "Server", "Ratchet", "Sockets", "WebSocket"]
@ -11,24 +11,33 @@
, "email": "cboden@gmail.com"
, "role": "Developer"
}
, {
"name": "Matt Bonneau"
, "role": "Developer"
}
, {
"name": "Mohamad Faeez"
, "email": "faeez@maximumbuilders.my"
, "role": "Developer"
}
]
, "support": {
"forum": "https://groups.google.com/forum/#!forum/ratchet-php"
, "issues": "https://github.com/ratchetphp/Ratchet/issues"
, "irc": "irc://irc.freenode.org/reactphp"
"issues": "https://github.com/ratchetphp/Ratchet/issues"
, "chat": "https://gitter.im/reactphp/reactphp"
}
, "autoload": {
"psr-4": {
"Ratchet\\": "src/Ratchet"
"mfmdevsystem\\socket\\": "src/Socket"
}
}
, "require": {
"php": ">=5.4.2"
, "ratchet/rfc6455": "^0.2"
, "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5"
, "guzzlehttp/psr7": "^1.0"
, "symfony/http-foundation": "^2.6|^3.0|^4.0"
, "symfony/routing": "^2.6|^3.0|^4.0"
"php": ">=8.4.0"
, "mfmdevsystem/rfc6455": "^0.4.2"
, "react/socket": "^1.0"
, "react/event-loop": "^0.4.0"
, "guzzlehttp/psr7": "^1.7|^2.0"
, "symfony/http-foundation": "^2.6|^3.0|^4.0|^5.0|^6.0"
, "symfony/routing": "^2.6|^3.0|^4.0|^5.0|^6.0"
}
, "require-dev": {
"phpunit/phpunit": "~4.8"

View File

@ -1,8 +0,0 @@
<?php
namespace Ratchet\WebSocket;
use Ratchet\ConnectionInterface;
use Ratchet\RFC6455\Messaging\MessageInterface;
interface MessageCallableInterface {
public function onMessage(ConnectionInterface $conn, MessageInterface $msg);
}

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet;
namespace mfmdevsystem\socket;
/**
* Wraps ConnectionInterface objects via the decorator pattern but allows

View File

@ -1,18 +1,19 @@
<?php
namespace Ratchet;
namespace mfmdevsystem\socket;
use React\EventLoop\LoopInterface;
use React\EventLoop\Factory as LoopFactory;
use React\Socket\Server as Reactor;
use React\Socket\SecureServer as SecureReactor;
use Ratchet\Http\HttpServerInterface;
use Ratchet\Http\OriginCheck;
use Ratchet\Wamp\WampServerInterface;
use Ratchet\Server\IoServer;
use Ratchet\Server\FlashPolicy;
use Ratchet\Http\HttpServer;
use Ratchet\Http\Router;
use Ratchet\WebSocket\WsServer;
use Ratchet\Wamp\WampServer;
use mfmdevsystem\socket\Http\HttpServerInterface;
use mfmdevsystem\socket\Http\OriginCheck;
use mfmdevsystem\socket\Wamp\WampServerInterface;
use mfmdevsystem\socket\Server\IoServer;
use mfmdevsystem\socket\Server\FlashPolicy;
use mfmdevsystem\socket\Http\HttpServer;
use mfmdevsystem\socket\Http\Router;
use mfmdevsystem\socket\WebSocket\MessageComponentInterface as WsMessageComponentInterface;
use mfmdevsystem\socket\WebSocket\WsServer;
use mfmdevsystem\socket\Wamp\WampServer;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RequestContext;
@ -60,9 +61,15 @@ class App {
* @param int $port Port to listen on. If 80, assuming production, Flash on 843 otherwise expecting Flash to be proxied through 8843
* @param string $address IP address to bind to. Default is localhost/proxy only. '0.0.0.0' for any machine.
* @param LoopInterface $loop Specific React\EventLoop to bind the application to. null will create one for you.
* @param array $context
*/
public function __construct($httpHost = 'localhost', $port = 8080, $address = '127.0.0.1', LoopInterface $loop = null) {
if (extension_loaded('xdebug')) {
public function __construct(?string $httpHost = null, ?int $port = null, ?string $address = null, ?LoopInterface $loop = null, ?array $context = null) {
if ($httpHost == null) $httpHost = 'localhost';
if ($port == null) $port = 80;
if ($address == null) $address = '127.0.0.1';
if ($context == null) $context = array();
if (extension_loaded('xdebug') && getenv('RATCHET_DISABLE_XDEBUG_WARN') === false) {
trigger_error('XDebug extension detected. Remember to disable this if performance testing or going live!', E_USER_WARNING);
}
@ -73,7 +80,7 @@ class App {
$this->httpHost = $httpHost;
$this->port = $port;
$socket = new Reactor($address . ':' . $port, $loop);
$socket = new Reactor($address . ':' . $port, $loop, $context);
$this->routes = new RouteCollection;
$this->_server = new IoServer(new HttpServer(new Router(new UrlMatcher($this->routes, new RequestContext))), $socket, $loop);
@ -105,7 +112,7 @@ class App {
} elseif ($controller instanceof WampServerInterface) {
$decorated = new WsServer(new WampServer($controller));
$decorated->enableKeepAlive($this->_server->loop);
} elseif ($controller instanceof MessageComponentInterface) {
} elseif ($controller instanceof MessageComponentInterface || $controller instanceof WsMessageComponentInterface) {
$decorated = new WsServer($controller);
$decorated->enableKeepAlive($this->_server->loop);
} else {

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet;
namespace mfmdevsystem\socket;
/**
* This is the interface to build a Ratchet application with.

View File

@ -1,11 +1,11 @@
<?php
namespace Ratchet;
namespace mfmdevsystem\socket;
/**
* The version of Ratchet being used
* The version of socket being used
* @var string
*/
const VERSION = 'Ratchet/0.4.1';
const VERSION = 'mfmdevsystem/socket/0.4.9';
/**
* A proxy object representing a connection to the application

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Http;
use Ratchet\ConnectionInterface;
use GuzzleHttp\Psr7 as gPsr;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\ConnectionInterface;
use GuzzleHttp\Psr7\Message;
use GuzzleHttp\Psr7\Response;
trait CloseResponseTrait {
@ -13,10 +13,10 @@ trait CloseResponseTrait {
*/
private function close(ConnectionInterface $conn, $code = 400, array $additional_headers = []) {
$response = new Response($code, array_merge([
'X-Powered-By' => \Ratchet\VERSION
'X-Powered-By' => \mfmdevsystem\socket\VERSION,
], $additional_headers));
$conn->send(gPsr\str($response));
$conn->send(Message::toString($response));
$conn->close();
}
}
}

View File

@ -1,8 +1,8 @@
<?php
namespace Ratchet\Http;
use Ratchet\MessageInterface;
use Ratchet\ConnectionInterface;
use GuzzleHttp\Psr7 as gPsr;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\MessageInterface;
use mfmdevsystem\socket\ConnectionInterface;
use GuzzleHttp\Psr7\Message;
/**
* This class receives streaming data from a client request
@ -59,6 +59,6 @@ class HttpRequestParser implements MessageInterface {
* @return \Psr\Http\Message\RequestInterface
*/
public function parse($headers) {
return gPsr\parse_request($headers);
return Message::parseRequest($headers);
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Http;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\ConnectionInterface;
class HttpServer implements MessageComponentInterface {
use CloseResponseTrait;

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Http;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\ConnectionInterface;
use Psr\Http\Message\RequestInterface;
interface HttpServerInterface extends MessageComponentInterface {
@ -10,5 +10,5 @@ interface HttpServerInterface extends MessageComponentInterface {
* @param \Psr\Http\Message\RequestInterface $request null is default because PHP won't let me overload; don't pass null!!!
* @throws \UnexpectedValueException if a RequestInterface is not passed
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null);
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null);
}

View File

@ -1,10 +1,10 @@
<?php
namespace Ratchet\Http;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\ConnectionInterface;
use Psr\Http\Message\RequestInterface;
class NoOpHttpServerController implements HttpServerInterface {
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
}
public function onMessage(ConnectionInterface $from, $msg) {

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Http;
use Ratchet\ConnectionInterface;
use Ratchet\MessageComponentInterface;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\ConnectionInterface;
use mfmdevsystem\socket\MessageComponentInterface;
use Psr\Http\Message\RequestInterface;
/**
@ -31,7 +31,7 @@ class OriginCheck implements HttpServerInterface {
/**
* {@inheritdoc}
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
$header = (string)$request->getHeader('Origin')[0];
$origin = parse_url($header, PHP_URL_HOST) ?: $header;

View File

@ -1,11 +1,11 @@
<?php
namespace Ratchet\Http;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\ConnectionInterface;
use Psr\Http\Message\RequestInterface;
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use GuzzleHttp\Psr7 as gPsr;
use GuzzleHttp\Psr7\Query;
class Router implements HttpServerInterface {
use CloseResponseTrait;
@ -26,7 +26,7 @@ class Router implements HttpServerInterface {
* {@inheritdoc}
* @throws \UnexpectedValueException If a controller is not \Ratchet\Http\HttpServerInterface
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
if (null === $request) {
throw new \UnexpectedValueException('$request can not be null');
}
@ -61,9 +61,9 @@ class Router implements HttpServerInterface {
$parameters[$key] = $value;
}
}
$parameters = array_merge($parameters, gPsr\parse_query($uri->getQuery() ?: ''));
$parameters = array_merge($parameters, Query::parse($uri->getQuery() ?: ''));
$request = $request->withUri($uri->withQuery(gPsr\build_query($parameters)));
$request = $request->withUri($uri->withQuery(Query::build($parameters)));
$conn->controller = $route['_controller'];
$conn->controller->onOpen($conn, $request);

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet;
namespace mfmdevsystem\socket;
interface MessageComponentInterface extends ComponentInterface, MessageInterface {
}

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet;
namespace mfmdevsystem\socket;
interface MessageInterface {
/**

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Server;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Server;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\ConnectionInterface;
/**
* A simple Ratchet application that will reply to all messages with the message it received

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Server;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Server;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\ConnectionInterface;
/**
* An app to go on a server stack to pass a policy file to a Flash socket

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Server;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Server;
use mfmdevsystem\socket\ConnectionInterface;
use React\Socket\ConnectionInterface as ReactConn;
/**

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Server;
use Ratchet\MessageComponentInterface;
namespace mfmdevsystem\socket\Server;
use mfmdevsystem\socket\MessageComponentInterface;
use React\EventLoop\LoopInterface;
use React\Socket\ServerInterface;
use React\EventLoop\Factory as LoopFactory;
@ -33,7 +33,7 @@ class IoServer {
* @param \React\Socket\ServerInterface $socket The React socket server to run the Ratchet application off of
* @param \React\EventLoop\LoopInterface|null $loop The React looper to run the Ratchet application off of
*/
public function __construct(MessageComponentInterface $app, ServerInterface $socket, LoopInterface $loop = null) {
public function __construct(MessageComponentInterface $app, ServerInterface $socket, ?LoopInterface $loop = null) {
if (false === strpos(PHP_VERSION, "hiphop")) {
gc_enable();
}
@ -54,7 +54,10 @@ class IoServer {
* @param string $address The address to receive sockets on (0.0.0.0 means receive connections from any)
* @return IoServer
*/
public static function factory(MessageComponentInterface $component, $port = 80, $address = '0.0.0.0') {
public static function factory(MessageComponentInterface $component, ?int $port = null, ?string $address = null) {
if ($port == null) $port = 80;
if ($address == null) $address = '0.0.0.0';
$loop = LoopFactory::create();
$socket = new Reactor($address . ':' . $port, $loop);

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Server;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Server;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\ConnectionInterface;
class IpBlackList implements MessageComponentInterface {
/**

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Session\Serialize;
namespace mfmdevsystem\socket\Session\Serialize;
interface HandlerInterface {
/**

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Session\Serialize;
namespace mfmdevsystem\socket\Session\Serialize;
class PhpBinaryHandler implements HandlerInterface {
/**

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Session\Serialize;
namespace mfmdevsystem\socket\Session\Serialize;
class PhpHandler implements HandlerInterface {
/**

View File

@ -1,10 +1,10 @@
<?php
namespace Ratchet\Session;
use Ratchet\ConnectionInterface;
use Ratchet\Http\HttpServerInterface;
namespace mfmdevsystem\socket\Session;
use mfmdevsystem\socket\ConnectionInterface;
use mfmdevsystem\socket\Http\HttpServerInterface;
use Psr\Http\Message\RequestInterface;
use Ratchet\Session\Storage\VirtualSessionStorage;
use Ratchet\Session\Serialize\HandlerInterface;
use mfmdevsystem\socket\Session\Storage\VirtualSessionStorage;
use mfmdevsystem\socket\Session\Serialize\HandlerInterface;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
@ -44,7 +44,9 @@ class SessionProvider implements HttpServerInterface {
* @param \Ratchet\Session\Serialize\HandlerInterface $serializer
* @throws \RuntimeException
*/
public function __construct(HttpServerInterface $app, \SessionHandlerInterface $handler, array $options = array(), HandlerInterface $serializer = null) {
public function __construct(HttpServerInterface $app, \SessionHandlerInterface $handler, ?array $options = null, ?HandlerInterface $serializer = null) {
if ($options == null) $options = array();
$this->_app = $app;
$this->_handler = $handler;
$this->_null = new NullSessionHandler;
@ -70,7 +72,7 @@ class SessionProvider implements HttpServerInterface {
/**
* {@inheritdoc}
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
$sessionName = ini_get('session.name');
$id = array_reduce($request->getHeader('Cookie'), function($accumulator, $cookie) use ($sessionName) {

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Session\Storage\Proxy;
namespace mfmdevsystem\socket\Session\Storage\Proxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
class VirtualProxy extends SessionHandlerProxy {

View File

@ -1,8 +1,8 @@
<?php
namespace Ratchet\Session\Storage;
namespace mfmdevsystem\socket\Session\Storage;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
use Ratchet\Session\Storage\Proxy\VirtualProxy;
use Ratchet\Session\Serialize\HandlerInterface;
use mfmdevsystem\socket\Session\Storage\Proxy\VirtualProxy;
use mfmdevsystem\socket\Session\Serialize\HandlerInterface;
class VirtualSessionStorage extends NativeSessionStorage {
/**

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Wamp;
namespace mfmdevsystem\socket\Wamp;
class Exception extends \Exception {
}

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Wamp;
namespace mfmdevsystem\socket\Wamp;
class JsonException extends Exception {
public function __construct() {

View File

@ -1,8 +1,8 @@
<?php
namespace Ratchet\Wamp;
use Ratchet\MessageComponentInterface;
use Ratchet\WebSocket\WsServerInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Wamp;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\WebSocket\WsServerInterface;
use mfmdevsystem\socket\ConnectionInterface;
/**
* WebSocket Application Messaging Protocol

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Wamp;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Wamp;
use mfmdevsystem\socket\ConnectionInterface;
/**
* A topic/channel containing connections that have subscribed to it
@ -86,6 +86,7 @@ class Topic implements \IteratorAggregate, \Countable {
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function getIterator() {
return $this->subscribers;
}
@ -93,6 +94,7 @@ class Topic implements \IteratorAggregate, \Countable {
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function count() {
return $this->subscribers->count();
}

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Wamp;
use Ratchet\ConnectionInterface;
use Ratchet\WebSocket\WsServerInterface;
namespace mfmdevsystem\socket\Wamp;
use mfmdevsystem\socket\ConnectionInterface;
use mfmdevsystem\socket\WebSocket\WsServerInterface;
class TopicManager implements WsServerInterface, WampServerInterface {
/**

View File

@ -1,8 +1,8 @@
<?php
namespace Ratchet\Wamp;
use Ratchet\ConnectionInterface;
use Ratchet\AbstractConnectionDecorator;
use Ratchet\Wamp\ServerProtocol as WAMP;
namespace mfmdevsystem\socket\Wamp;
use mfmdevsystem\socket\ConnectionInterface;
use mfmdevsystem\socket\AbstractConnectionDecorator;
use mfmdevsystem\socket\Wamp\ServerProtocol as WAMP;
/**
* A ConnectionInterface object wrapper that is passed to your WAMP application
@ -20,7 +20,7 @@ class WampConnection extends AbstractConnectionDecorator {
$this->WAMP->sessionId = str_replace('.', '', uniqid(mt_rand(), true));
$this->WAMP->prefixes = array();
$this->send(json_encode(array(WAMP::MSG_WELCOME, $this->WAMP->sessionId, 1, \Ratchet\VERSION)));
$this->send(json_encode(array(WAMP::MSG_WELCOME, $this->WAMP->sessionId, 1, \mfmdevsystem\socket\VERSION)));
}
/**

View File

@ -1,8 +1,8 @@
<?php
namespace Ratchet\Wamp;
use Ratchet\MessageComponentInterface;
use Ratchet\WebSocket\WsServerInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Wamp;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\WebSocket\WsServerInterface;
use mfmdevsystem\socket\ConnectionInterface;
/**
* Enable support for the official WAMP sub-protocol in your application

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Wamp;
use Ratchet\ComponentInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Wamp;
use mfmdevsystem\socket\ComponentInterface;
use mfmdevsystem\socket\ConnectionInterface;
/**
* An extension of Ratchet\ComponentInterface to server a WAMP application

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\WebSocket;
use Ratchet\RFC6455\Messaging\MessageBuffer;
namespace mfmdevsystem\socket\WebSocket;
use mfmdevsystem\RFC6455\Messaging\MessageBuffer;
class ConnContext {
/**
@ -9,7 +9,7 @@ class ConnContext {
public $connection;
/**
* @var \Ratchet\RFC6455\Messaging\MessageBuffer;
* @var \mfmdevsystem\RFC6455\Messaging\MessageBuffer;
*/
public $buffer;

View File

@ -0,0 +1,8 @@
<?php
namespace mfmdevsystem\socket\WebSocket;
use mfmdevsystem\socket\ConnectionInterface;
use mfmdevsystem\RFC6455\Messaging\MessageInterface;
interface MessageCallableInterface {
public function onMessage(ConnectionInterface $conn, MessageInterface $msg);
}

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\WebSocket;
use Ratchet\ComponentInterface;
namespace mfmdevsystem\socket\WebSocket;
use mfmdevsystem\socket\ComponentInterface;
interface MessageComponentInterface extends ComponentInterface, MessageCallableInterface {
}

View File

@ -1,8 +1,8 @@
<?php
namespace Ratchet\WebSocket;
use Ratchet\AbstractConnectionDecorator;
use Ratchet\RFC6455\Messaging\DataInterface;
use Ratchet\RFC6455\Messaging\Frame;
namespace mfmdevsystem\socket\WebSocket;
use mfmdevsystem\socket\AbstractConnectionDecorator;
use mfmdevsystem\RFC6455\Messaging\DataInterface;
use mfmdevsystem\RFC6455\Messaging\Frame;
/**
* {@inheritdoc}
@ -25,7 +25,7 @@ class WsConnection extends AbstractConnectionDecorator {
}
/**
* @param int|\Ratchet\RFC6455\Messaging\DataInterface
* @param int|\mfmdevsystem\RFC6455\Messaging\DataInterface
*/
public function close($code = 1000) {
if ($this->WebSocket->closing) {

View File

@ -1,20 +1,20 @@
<?php
namespace Ratchet\WebSocket;
use Ratchet\ComponentInterface;
use Ratchet\ConnectionInterface;
use Ratchet\MessageComponentInterface as DataComponentInterface;
use Ratchet\Http\HttpServerInterface;
use Ratchet\Http\CloseResponseTrait;
namespace mfmdevsystem\socket\WebSocket;
use mfmdevsystem\socket\ComponentInterface;
use mfmdevsystem\socket\ConnectionInterface;
use mfmdevsystem\socket\MessageComponentInterface as DataComponentInterface;
use mfmdevsystem\socket\Http\HttpServerInterface;
use mfmdevsystem\socket\Http\CloseResponseTrait;
use Psr\Http\Message\RequestInterface;
use Ratchet\RFC6455\Messaging\MessageInterface;
use Ratchet\RFC6455\Messaging\FrameInterface;
use Ratchet\RFC6455\Messaging\Frame;
use Ratchet\RFC6455\Messaging\MessageBuffer;
use Ratchet\RFC6455\Messaging\CloseFrameChecker;
use Ratchet\RFC6455\Handshake\ServerNegotiator;
use Ratchet\RFC6455\Handshake\RequestVerifier;
use mfmdevsystem\RFC6455\Messaging\MessageInterface;
use mfmdevsystem\RFC6455\Messaging\FrameInterface;
use mfmdevsystem\RFC6455\Messaging\Frame;
use mfmdevsystem\RFC6455\Messaging\MessageBuffer;
use mfmdevsystem\RFC6455\Messaging\CloseFrameChecker;
use mfmdevsystem\RFC6455\Handshake\ServerNegotiator;
use mfmdevsystem\RFC6455\Handshake\RequestVerifier;
use React\EventLoop\LoopInterface;
use GuzzleHttp\Psr7 as gPsr;
use GuzzleHttp\Psr7\Message;
/**
* The adapter to handle WebSocket requests/responses
@ -37,12 +37,12 @@ class WsServer implements HttpServerInterface {
protected $connections;
/**
* @var \Ratchet\RFC6455\Messaging\CloseFrameChecker
* @var \mfmdevsystem\RFC6455\Messaging\CloseFrameChecker
*/
private $closeFrameChecker;
/**
* @var \Ratchet\RFC6455\Handshake\ServerNegotiator
* @var \mfmdevsystem\RFC6455\Handshake\ServerNegotiator
*/
private $handshakeNegotiator;
@ -104,7 +104,7 @@ class WsServer implements HttpServerInterface {
/**
* {@inheritdoc}
*/
public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) {
public function onOpen(ConnectionInterface $conn, ?RequestInterface $request = null) {
if (null === $request) {
throw new \UnexpectedValueException('$request can not be null');
}
@ -114,9 +114,9 @@ class WsServer implements HttpServerInterface {
$conn->WebSocket = new \StdClass;
$conn->WebSocket->closing = false;
$response = $this->handshakeNegotiator->handshake($request)->withHeader('X-Powered-By', \Ratchet\VERSION);
$response = $this->handshakeNegotiator->handshake($request)->withHeader('X-Powered-By', \mfmdevsystem\socket\VERSION);
$conn->send(gPsr\str($response));
$conn->send(Message::toString($response));
if (101 !== $response->getStatusCode()) {
return $conn->close();

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\WebSocket;
namespace mfmdevsystem\socket\WebSocket;
/**
* WebSocket Server Interface

View File

@ -1,10 +1,10 @@
<?php
use Ratchet\ConnectionInterface;
use mfmdevsystem\socket\ConnectionInterface;
require dirname(dirname(dirname(__DIR__))) . '/vendor/autoload.php';
class BinaryEcho implements \Ratchet\WebSocket\MessageComponentInterface {
public function onMessage(ConnectionInterface $from, \Ratchet\RFC6455\Messaging\MessageInterface $msg) {
public function onMessage(ConnectionInterface $from, \mfmdevsystem\RFC6455\Messaging\MessageInterface $msg) {
$from->send($msg);
}

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet;
namespace mfmdevsystem\socket;
abstract class AbstractMessageComponentTestCase extends \PHPUnit_Framework_TestCase {
protected $_app;

View File

@ -1,8 +1,8 @@
<?php
namespace Ratchet\Mock;
use Ratchet\MessageComponentInterface;
use Ratchet\WebSocket\WsServerInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Mock;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\WebSocket\WsServerInterface;
use mfmdevsystem\socket\ConnectionInterface;
class Component implements MessageComponentInterface, WsServerInterface {
public $last = array();

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Mock;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Mock;
use mfmdevsystem\socket\ConnectionInterface;
class Connection implements ConnectionInterface {
public $last = array(

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Mock;
use Ratchet\AbstractConnectionDecorator;
namespace mfmdevsystem\socket\Mock;
use mfmdevsystem\socket\AbstractConnectionDecorator;
class ConnectionDecorator extends AbstractConnectionDecorator {
public $last = array(

View File

@ -1,8 +1,8 @@
<?php
namespace Ratchet\Mock;
use Ratchet\Wamp\WampServerInterface;
use Ratchet\WebSocket\WsServerInterface;
use Ratchet\ConnectionInterface;
namespace mfmdevsystem\socket\Mock;
use mfmdevsystem\socket\Wamp\WampServerInterface;
use mfmdevsystem\socket\WebSocket\WsServerInterface;
use mfmdevsystem\socket\ConnectionInterface;
class WampComponent implements WampServerInterface, WsServerInterface {
public $last = array();

View File

@ -1,9 +1,9 @@
<?php
namespace Ratchet;
use Ratchet\ConnectionInterface;
use Ratchet\MessageComponentInterface;
use Ratchet\WebSocket\WsServerInterface;
use Ratchet\Wamp\WampServerInterface;
namespace mfmdevsystem\socket;
use mfmdevsystem\socket\ConnectionInterface;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\WebSocket\WsServerInterface;
use mfmdevsystem\socket\Wamp\WampServerInterface;
class NullComponent implements MessageComponentInterface, WsServerInterface, WampServerInterface {
public function onOpen(ConnectionInterface $conn) {}

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Wamp\Stub;
use Ratchet\WebSocket\WsServerInterface;
use Ratchet\Wamp\WampServerInterface;
namespace mfmdevsystem\socket\Wamp\Stub;
use mfmdevsystem\socket\WebSocket\WsServerInterface;
use mfmdevsystem\socket\Wamp\WampServerInterface;
interface WsWampServerInterface extends WsServerInterface, WampServerInterface {
}

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\WebSocket\Stub;
use Ratchet\MessageComponentInterface;
use Ratchet\WebSocket\WsServerInterface;
namespace mfmdevsystem\socket\WebSocket\Stub;
use mfmdevsystem\socket\MessageComponentInterface;
use mfmdevsystem\socket\WebSocket\WsServerInterface;
interface WsMessageComponentInterface extends MessageComponentInterface, WsServerInterface {
}

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet;
use Ratchet\Mock\ConnectionDecorator;
namespace mfmdevsystem\socket;
use mfmdevsystem\socket\Mock\ConnectionDecorator;
/**
* @covers Ratchet\AbstractConnectionDecorator

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Http;
namespace mfmdevsystem\socket\Http;
/**
* @covers Ratchet\Http\HttpRequestParser

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Http;
use Ratchet\AbstractMessageComponentTestCase;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\AbstractMessageComponentTestCase;
/**
* @covers Ratchet\Http\HttpServer

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Http;
use Ratchet\AbstractMessageComponentTestCase;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\AbstractMessageComponentTestCase;
/**
* @covers Ratchet\Http\OriginCheck

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Http;
use Ratchet\WebSocket\WsServerInterface;
namespace mfmdevsystem\socket\Http;
use mfmdevsystem\socket\WebSocket\WsServerInterface;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
use Symfony\Component\Routing\RequestContext;

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Server;
use Ratchet\Server\EchoServer;
namespace mfmdevsystem\socket\Server;
use mfmdevsystem\socket\Server\EchoServer;
class EchoServerTest extends \PHPUnit_Framework_TestCase {
protected $_conn;

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Application\Server;
use Ratchet\Server\FlashPolicy;
namespace mfmdevsystem\socket\Application\Server;
use mfmdevsystem\socket\Server\FlashPolicy;
/**
* @covers Ratchet\Server\FlashPolicy

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Application\Server;
use Ratchet\Server\IoConnection;
namespace mfmdevsystem\socket\Application\Server;
use mfmdevsystem\socket\Server\IoConnection;
/**
* @covers Ratchet\Server\IoConnection

View File

@ -1,7 +1,8 @@
<?php
namespace Ratchet\Server;
use Ratchet\Server\IoServer;
namespace mfmdevsystem\socket\Server;
use mfmdevsystem\socket\Server\IoServer;
use React\EventLoop\StreamSelectLoop;
use React\EventLoop\LoopInterface;
use React\Socket\Server;
/**
@ -16,6 +17,14 @@ class IoServerTest extends \PHPUnit_Framework_TestCase {
protected $reactor;
protected function tickLoop(LoopInterface $loop) {
$loop->futureTick(function () use ($loop) {
$loop->stop();
});
$loop->run();
}
public function setUp() {
$this->app = $this->getMock('\\Ratchet\\MessageComponentInterface');
@ -32,7 +41,7 @@ class IoServerTest extends \PHPUnit_Framework_TestCase {
$client = stream_socket_client("tcp://localhost:{$this->port}");
$this->server->loop->tick();
$this->tickLoop($this->server->loop);
//$this->assertTrue(is_string($this->app->last['onOpen'][0]->remoteAddress));
//$this->assertTrue(is_int($this->app->last['onOpen'][0]->resourceId));
@ -52,16 +61,16 @@ class IoServerTest extends \PHPUnit_Framework_TestCase {
socket_set_block($client);
socket_connect($client, 'localhost', $this->port);
$this->server->loop->tick();
$this->tickLoop($this->server->loop);
socket_write($client, $msg);
$this->server->loop->tick();
$this->tickLoop($this->server->loop);
socket_shutdown($client, 1);
socket_shutdown($client, 0);
socket_close($client);
$this->server->loop->tick();
$this->tickLoop($this->server->loop);
}
public function testOnClose() {
@ -73,13 +82,13 @@ class IoServerTest extends \PHPUnit_Framework_TestCase {
socket_set_block($client);
socket_connect($client, 'localhost', $this->port);
$this->server->loop->tick();
$this->tickLoop($this->server->loop);
socket_shutdown($client, 1);
socket_shutdown($client, 0);
socket_close($client);
$this->server->loop->tick();
$this->tickLoop($this->server->loop);
}
public function testFactory() {

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Server;
use Ratchet\Server\IpBlackList;
namespace mfmdevsystem\socket\Server;
use mfmdevsystem\socket\Server\IpBlackList;
/**
* @covers Ratchet\Server\IpBlackList

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Session\Serialize;
use Ratchet\Session\Serialize\PhpHandler;
namespace mfmdevsystem\socket\Session\Serialize;
use mfmdevsystem\socket\Session\Serialize\PhpHandler;
/**
* @covers Ratchet\Session\Serialize\PhpHandler

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Session;
use Ratchet\AbstractMessageComponentTestCase;
namespace mfmdevsystem\socket\Session;
use mfmdevsystem\socket\AbstractMessageComponentTestCase;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
@ -11,6 +11,8 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
*/
class SessionProviderTest extends AbstractMessageComponentTestCase {
public function setUp() {
return $this->markTestIncomplete('Test needs to be updated for ini_set issue in PHP 7.2');
if (!class_exists('Symfony\Component\HttpFoundation\Session\Session')) {
return $this->markTestSkipped('Dependency of Symfony HttpFoundation failed');
}

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Session\Storage;
use Ratchet\Session\Serialize\PhpHandler;
namespace mfmdevsystem\socket\Session\Storage;
use mfmdevsystem\socket\Session\Serialize\PhpHandler;
use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;

View File

@ -1,7 +1,7 @@
<?php
namespace Ratchet\Wamp;
use Ratchet\Mock\Connection;
use Ratchet\Mock\WampComponent as TestComponent;
namespace mfmdevsystem\socket\Wamp;
use mfmdevsystem\socket\Mock\Connection;
use mfmdevsystem\socket\Mock\WampComponent as TestComponent;
/**
* @covers \Ratchet\Wamp\ServerProtocol

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Wamp;
namespace mfmdevsystem\socket\Wamp;
/**
* @covers Ratchet\Wamp\TopicManager

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Wamp;
namespace mfmdevsystem\socket\Wamp;
/**
* @covers Ratchet\Wamp\Topic

View File

@ -1,5 +1,5 @@
<?php
namespace Ratchet\Wamp;
namespace mfmdevsystem\socket\Wamp;
/**
* @covers Ratchet\Wamp\WampConnection

View File

@ -1,6 +1,6 @@
<?php
namespace Ratchet\Wamp;
use Ratchet\AbstractMessageComponentTestCase;
namespace mfmdevsystem\socket\Wamp;
use mfmdevsystem\socket\AbstractMessageComponentTestCase;
/**
* @covers Ratchet\Wamp\WampServer