From 1f5f51f6e96e1c057b677bfd249f787126ef13c7 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Sat, 23 Jul 2022 14:56:59 -0400 Subject: [PATCH 1/3] Dockerize chat app --- Dockerfile | 22 ++++++++++++++++++++++ Makefile | 6 ++++++ bin/run-all-the-things.php | 2 +- composer.json | 4 ++-- 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f445882a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM wyrihaximusnet/php:7.4-nts-alpine + +RUN mkdir -p /opt/app/socketo.me +WORKDIR /opt/app/socketo.me + +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" +RUN php composer-setup.php +RUN rm composer-setup.php +RUN chmod +x composer.phar + +COPY bin bin +COPY src src +#COPY views views +#COPY web web +COPY composer.json ./ +COPY composer.lock ./ +RUN ./composer.phar install --ansi --no-interaction --prefer-dist -o --no-scripts --no-plugins +RUN rm composer.phar + +ENTRYPOINT ["php"] +CMD ["bin/run-all-the-things.php"] diff --git a/Makefile b/Makefile index 3c06430d..c58be7f4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,10 @@ build: + docker build -t socketome . + +run: + docker run --rm -it -p 8080:8080 socketome + +setup: rm -rf web/vendor mkdir -p web/vendor cp -r vendor/cujojs/when web/vendor/when diff --git a/bin/run-all-the-things.php b/bin/run-all-the-things.php index 89498619..980b40f8 100644 --- a/bin/run-all-the-things.php +++ b/bin/run-all-the-things.php @@ -25,7 +25,7 @@ $login->pushHandler($stdout); $logout->pushHandler($stdout); - $app = new App($host); + $app = new App($host, 8080, '0.0.0.0'); $app->route('/chat', new MessageLogger( // Log events in case of "oh noes" new ServerProtocol( // WAMP; the new hotness sub-protocol diff --git a/composer.json b/composer.json index d8a9cc55..15870a77 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "cboden/Ratchet-website" + "name": "cboden/socketome" , "homepage": "http://socketo.me" , "license": "DBAD" , "authors": [ @@ -10,7 +10,7 @@ ] , "require": { "php": ">=5.4.0" - , "cboden/Ratchet": "0.3.*" + , "cboden/ratchet": "0.3.*" , "silex/silex": "1.0.*@dev" , "twig/twig": "1.10.*" , "monolog/monolog": "~1.6" From 037801a41bb1b016fe9ca2bace3b075e23a558d7 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Sun, 7 Aug 2022 12:00:40 -0400 Subject: [PATCH 2/3] Get site loading through fpm/nginx --- docker-compose.yml | 30 ++++++++++++++++++++++++++++++ docker/Dockerfile-nginx | 3 +++ docker/nginx-localhost.conf | 13 +++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 docker-compose.yml create mode 100644 docker/Dockerfile-nginx create mode 100644 docker/nginx-localhost.conf diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..bdd1a4d6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,30 @@ +version: "3" + +services: + nginx: + build: + context: ./docker + dockerfile: Dockerfile-nginx + ports: + - "8080:80" + networks: + - ratchet + volumes: + - ./web/:/var/www/html/ + - ./vendor:/var/www/vendor/ + - ./logs/nginx:/var/log/nginx/ + + php: + image: php:fpm-alpine + networks: + - ratchet + volumes: + - ./web/:/var/www/html/ + - ./vendor:/var/www/vendor/ + - ./logs/fpm:/var/log/fpm-php.www.log + + +networks: + ratchet: + name: ratchet + driver: bridge diff --git a/docker/Dockerfile-nginx b/docker/Dockerfile-nginx new file mode 100644 index 00000000..84ffc7ae --- /dev/null +++ b/docker/Dockerfile-nginx @@ -0,0 +1,3 @@ +FROM nginx:alpine + +ADD nginx-localhost.conf /etc/nginx/conf.d/default.conf diff --git a/docker/nginx-localhost.conf b/docker/nginx-localhost.conf new file mode 100644 index 00000000..efcab7da --- /dev/null +++ b/docker/nginx-localhost.conf @@ -0,0 +1,13 @@ +server { + listen 0.0.0.0:80; + root /var/www/html; + location / { + index index.php index.html; + } + location ~ \.php$ { + include fastcgi_params; + fastcgi_pass php:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; + } +} From 75a69f5495249f17b1cf55a153d335beb958f508 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Sun, 7 Aug 2022 22:39:00 -0400 Subject: [PATCH 3/3] Fix website Update packages to newer versions Proxy based on URI path Dockerize all website components Fix cookie issues --- .gitignore | 1 + Makefile | 2 +- bin/run-all-the-things.php | 16 +- composer.json | 4 +- composer.lock | 1342 ++++++++++++++++++------- docker-compose.yml | 14 +- Dockerfile => docker/Dockerfile-chat | 2 - docker/nginx-localhost.conf | 23 +- src/Ratchet/Website/Chat/Bot.php | 5 +- src/Ratchet/Website/Chat/ChatRoom.php | 6 +- views/demo.html.twig | 4 +- views/layout.html.twig | 2 +- web/{chat => app}/chat.css | 0 web/{chat => app}/chat.js | 0 web/{chat => app}/transport.js | 2 +- 15 files changed, 1058 insertions(+), 365 deletions(-) rename Dockerfile => docker/Dockerfile-chat (96%) rename web/{chat => app}/chat.css (100%) rename web/{chat => app}/chat.js (100%) rename web/{chat => app}/transport.js (99%) diff --git a/.gitignore b/.gitignore index 23079d89..9ec4fdb4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ vendor web/vendor web/reports/ab-archive rSrc +/logs diff --git a/Makefile b/Makefile index c58be7f4..7379340e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ build: - docker build -t socketome . + docker build -f docker/Dockerfile-chat -t socketome . run: docker run --rm -it -p 8080:8080 socketome diff --git a/bin/run-all-the-things.php b/bin/run-all-the-things.php index 980b40f8..e88a1fe1 100644 --- a/bin/run-all-the-things.php +++ b/bin/run-all-the-things.php @@ -1,5 +1,4 @@ stop(); + }); + Loop::addSignal(SIGTERM, $func = function ($signal) use (&$func) { + echo 'Received signal: ', (string)$signal, PHP_EOL; + + Loop::removeSignal(SIGTERM, $func); + Loop::get()->stop(); + }); + // GO GO GO! $app->run(); diff --git a/composer.json b/composer.json index 15870a77..ff4df8d9 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,9 @@ ] , "require": { "php": ">=5.4.0" - , "cboden/ratchet": "0.3.*" + , "cboden/ratchet": "^0.4" + , "react/event-loop": "^1.0" + , "react/socket": "^1.0" , "silex/silex": "1.0.*@dev" , "twig/twig": "1.10.*" , "monolog/monolog": "~1.6" diff --git a/composer.lock b/composer.lock index 9eb19597..a5ab59a9 100644 --- a/composer.lock +++ b/composer.lock @@ -1,36 +1,40 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "hash": "af3664d17b797781be1c646e74f9e3f0", + "content-hash": "0e712656d21404441fa2c96093db2da9", "packages": [ { "name": "cboden/ratchet", - "version": "v0.3.2", + "version": "v0.4", "source": { "type": "git", - "url": "https://github.com/cboden/Ratchet.git", - "reference": "d36a8699df04354147a4f47845035b1ea8239189" + "url": "https://github.com/ratchetphp/Ratchet.git", + "reference": "c03b1b0f56d1732a4bffcdbef5eae444f8c9e73b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cboden/Ratchet/zipball/d36a8699df04354147a4f47845035b1ea8239189", - "reference": "d36a8699df04354147a4f47845035b1ea8239189", + "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/c03b1b0f56d1732a4bffcdbef5eae444f8c9e73b", + "reference": "c03b1b0f56d1732a4bffcdbef5eae444f8c9e73b", "shasum": "" }, "require": { - "guzzle/http": "~3.6", - "php": ">=5.3.9", - "react/socket": "0.3.*|0.4.*", - "symfony/http-foundation": "~2.2", - "symfony/routing": "~2.2" + "guzzlehttp/psr7": "^1.0", + "php": ">=5.4.2", + "ratchet/rfc6455": "^0.2", + "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5", + "symfony/http-foundation": "^2.2|^3.0", + "symfony/routing": "^2.2|^3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" }, "type": "library", "autoload": { - "psr-0": { - "Ratchet": "src" + "psr-4": { + "Ratchet\\": "src/Ratchet" } }, "notification-url": "https://packagist.org/downloads/", @@ -41,7 +45,6 @@ { "name": "Chris Boden", "email": "cboden@gmail.com", - "homepage": "http://res.im", "role": "Developer" } ], @@ -51,9 +54,16 @@ "Ratchet", "WebSockets", "server", - "sockets" + "sockets", + "websocket" ], - "time": "2014-06-08 15:19:45" + "support": { + "forum": "https://groups.google.com/forum/#!forum/ratchet-php", + "irc": "irc://irc.freenode.org/reactphp", + "issues": "https://github.com/ratchetphp/Ratchet/issues", + "source": "https://github.com/ratchetphp/Ratchet/tree/master" + }, + "time": "2017-09-14T12:18:28+00:00" }, { "name": "cujojs/when", @@ -63,32 +73,29 @@ "url": "https://github.com/cujojs/when.git", "reference": "00fdea1f49c697f97754b8ed6416082f362830ad" }, - "type": "library", - "time": "2012-03-19 13:01:08" + "type": "library" }, { "name": "evenement/evenement", - "version": "v2.0.0", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/igorw/evenement.git", - "reference": "f6e843799fd4f4184d54d8fc7b5b3551c9fa803e" + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/f6e843799fd4f4184d54d8fc7b5b3551c9fa803e", - "reference": "f6e843799fd4f4184d54d8fc7b5b3551c9fa803e", + "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=7.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } + "require-dev": { + "phpunit/phpunit": "^6.0" }, + "type": "library", "autoload": { "psr-0": { "Evenement": "src" @@ -101,8 +108,7 @@ "authors": [ { "name": "Igor Wiedler", - "email": "igor@wiedler.ch", - "homepage": "http://wiedler.ch/igor/" + "email": "igor@wiedler.ch" } ], "description": "Événement is a very simple event dispatching library for PHP", @@ -110,7 +116,11 @@ "event-dispatcher", "event-emitter" ], - "time": "2012-11-02 14:49:47" + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/master" + }, + "time": "2017-07-23T21:35:13+00:00" }, { "name": "gimite/web-socket-js", @@ -120,86 +130,230 @@ "url": "https://github.com/gimite/web-socket-js", "reference": "master" }, - "type": "library", - "time": "2012-11-03 05:36:51" + "type": "library" }, { - "name": "guzzle/common", - "version": "v3.9.1", - "target-dir": "Guzzle/Common", + "name": "guzzlehttp/psr7", + "version": "1.9.0", "source": { "type": "git", - "url": "https://github.com/guzzle/common.git", - "reference": "707428cd8a99486418a66c859777b56194d67d6c" + "url": "https://github.com/guzzle/psr7.git", + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/common/zipball/707428cd8a99486418a66c859777b56194d67d6c", - "reference": "707428cd8a99486418a66c859777b56194d67d6c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", "shasum": "" }, "require": { - "php": ">=5.3.2", - "symfony/event-dispatcher": ">=2.1" + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { - "psr-0": { - "Guzzle\\Common": "" + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Common libraries used by Guzzle", - "homepage": "http://guzzlephp.org/", + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ - "collection", - "common", - "event", - "exception" + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" ], - "time": "2014-05-07 17:04:22" + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.9.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2022-06-20T21:43:03+00:00" }, { - "name": "guzzle/http", - "version": "v3.9.1", - "target-dir": "Guzzle/Http", + "name": "monolog/monolog", + "version": "1.27.1", "source": { "type": "git", - "url": "https://github.com/guzzle/http.git", - "reference": "222c4e7bccb945c612283d1dd81762f2a20a4efc" + "url": "https://github.com/Seldaek/monolog.git", + "reference": "904713c5929655dc9b97288b69cfeedad610c9a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/http/zipball/222c4e7bccb945c612283d1dd81762f2a20a4efc", - "reference": "222c4e7bccb945c612283d1dd81762f2a20a4efc", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/904713c5929655dc9b97288b69cfeedad610c9a1", + "reference": "904713c5929655dc9b97288b69cfeedad610c9a1", "shasum": "" }, "require": { - "guzzle/common": "self.version", - "guzzle/parser": "self.version", - "guzzle/stream": "self.version", - "php": ">=5.3.2" + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpstan/phpstan": "^0.12.59", + "phpunit/phpunit": "~4.5", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { - "ext-curl": "*" + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" + }, + "type": "library", + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "http://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/1.27.1" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2022-06-09T08:53:42+00:00" + }, + { + "name": "pimple/pimple", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/silexphp/Pimple.git", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-0": { - "Guzzle\\Http": "" + "Pimple": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -208,97 +362,101 @@ ], "authors": [ { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], - "description": "HTTP libraries used by Guzzle", - "homepage": "http://guzzlephp.org/", + "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", + "homepage": "http://pimple.sensiolabs.org", "keywords": [ - "Guzzle", - "client", - "curl", - "http", - "http client" + "container", + "dependency injection" ], - "time": "2014-05-01 21:56:28" + "support": { + "issues": "https://github.com/silexphp/Pimple/issues", + "source": "https://github.com/silexphp/Pimple/tree/v1.1.1" + }, + "time": "2013-11-22T08:30:29+00:00" }, { - "name": "guzzle/parser", - "version": "v3.9.1", - "target-dir": "Guzzle/Parser", + "name": "psr/http-message", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/guzzle/parser.git", - "reference": "6874d171318a8e93eb6d224cf85e4678490b625c" + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", - "reference": "6874d171318a8e93eb6d224cf85e4678490b625c", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "Guzzle\\Parser": "" + "psr-4": { + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Interchangeable parsers used by Guzzle", - "homepage": "http://guzzlephp.org/", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ - "URI Template", - "cookie", "http", - "message", - "url" + "http-message", + "psr", + "psr-7", + "request", + "response" ], - "time": "2014-02-05 18:29:46" + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" }, { - "name": "guzzle/stream", - "version": "v3.9.1", - "target-dir": "Guzzle/Stream", + "name": "psr/log", + "version": "1.1.4", "source": { "type": "git", - "url": "https://github.com/guzzle/stream.git", - "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0" + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", - "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "guzzle/common": "self.version", - "php": ">=5.3.2" - }, - "suggest": { - "guzzle/http": "To convert Guzzle request objects to PHP streams" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.7-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { - "psr-0": { - "Guzzle\\Stream": "" + "psr-4": { + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -307,65 +465,92 @@ ], "authors": [ { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Guzzle stream wrapper component", - "homepage": "http://guzzlephp.org/", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "Guzzle", - "component", - "stream" + "log", + "psr", + "psr-3" ], - "time": "2014-05-01 21:36:02" + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" }, { - "name": "monolog/monolog", - "version": "1.10.0", + "name": "ralouphie/getallheaders", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "25b16e801979098cb2f120e697bfce454b18bf23" + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/25b16e801979098cb2f120e697bfce454b18bf23", - "reference": "25b16e801979098cb2f120e697bfce454b18bf23", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" + "php": ">=5.6" }, "require-dev": { - "aws/aws-sdk-php": "~2.4, >2.4.8", - "doctrine/couchdb": "~1.0@dev", - "graylog2/gelf-php": "~1.0", - "phpunit/phpunit": "~3.7.0", - "raven/raven": "~0.5", - "ruflin/elastica": "0.90.*" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "raven/raven": "Allow sending log messages to a Sentry server", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ratchet/rfc6455", + "version": "v0.2.6", + "source": { + "type": "git", + "url": "https://github.com/ratchetphp/RFC6455.git", + "reference": "879e48c840f8dbc296d68d6a5030673df79bd916" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ratchetphp/RFC6455/zipball/879e48c840f8dbc296d68d6a5030673df79bd916", + "reference": "879e48c840f8dbc296d68d6a5030673df79bd916", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.0", + "php": ">=5.4.2" }, + "require-dev": { + "phpunit/phpunit": "4.8.*", + "react/socket": "^1.3" + }, + "type": "library", "autoload": { "psr-4": { - "Monolog\\": "src/Monolog" + "Ratchet\\RFC6455\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -374,47 +559,211 @@ ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be", + "name": "Chris Boden", + "email": "cboden@gmail.com", "role": "Developer" } ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "http://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "time": "2014-06-04 16:30:04" + "description": "RFC6455 WebSocket protocol handler", + "homepage": "http://socketo.me", + "keywords": [ + "WebSockets", + "rfc6455", + "websocket" + ], + "support": { + "forum": "https://groups.google.com/forum/#!forum/ratchet-php", + "irc": "irc://irc.freenode.org/reactphp", + "issues": "https://github.com/ratchetphp/RFC6455/issues", + "source": "https://github.com/ratchetphp/RFC6455/tree/v0.2.6" + }, + "time": "2019-12-15T10:18:18+00:00" + }, + { + "name": "react/cache", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/4bf736a2cccec7298bdf745db77585966fc2ca7e", + "reference": "4bf736a2cccec7298bdf745db77585966fc2ca7e", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.1.1" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-02-02T06:47:52+00:00" + }, + { + "name": "react/dns", + "version": "v1.9.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb", + "reference": "6d38296756fa644e6cb1bfe95eff0f9a4ed6edcb", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.0 || ^2.7 || ^1.2.1", + "react/promise-timer": "^1.8" + }, + "require-dev": { + "clue/block-react": "^1.2", + "phpunit/phpunit": "^9.3 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2021-12-20T08:46:54+00:00" }, { - "name": "pimple/pimple", - "version": "v1.1.1", + "name": "react/event-loop", + "version": "v1.3.0", "source": { "type": "git", - "url": "https://github.com/fabpot/Pimple.git", - "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d" + "url": "https://github.com/reactphp/event-loop.git", + "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d", - "reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/187fb56f46d424afb6ec4ad089269c72eec2e137", + "reference": "187fb56f46d424afb6ec4ad089269c72eec2e137", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" + }, + "suggest": { + "ext-event": "~1.0 for ExtEventLoop", + "ext-pcntl": "For signal handling support when using the StreamSelectLoop", + "ext-uv": "* for ExtUvLoop" }, + "type": "library", "autoload": { - "psr-0": { - "Pimple": "lib/" + "psr-4": { + "React\\EventLoop\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -423,38 +772,74 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", - "homepage": "http://pimple.sensiolabs.org", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", "keywords": [ - "container", - "dependency injection" + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } ], - "time": "2013-11-22 08:30:29" + "time": "2022-03-17T11:10:22+00:00" }, { - "name": "psr/log", - "version": "1.0.0", + "name": "react/promise", + "version": "v2.9.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log", - "reference": "1.0.0" + "url": "https://github.com/reactphp/promise.git", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" }, "dist": { "type": "zip", - "url": "https://github.com/php-fig/log/archive/1.0.0.zip", - "reference": "1.0.0", + "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", "shasum": "" }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + }, "type": "library", "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -463,87 +848,159 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Common interface for logging libraries", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", "keywords": [ - "log", - "psr", - "psr-3" + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } ], - "time": "2012-12-21 11:40:51" + "time": "2022-02-11T10:27:51+00:00" }, { - "name": "react/event-loop", - "version": "v0.4.1", + "name": "react/promise-timer", + "version": "v1.9.0", "source": { "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "18c5297087ca01de85518e2b55078f444144aa1b" + "url": "https://github.com/reactphp/promise-timer.git", + "reference": "aa7a73c74b8d8c0f622f5982ff7b0351bc29e495" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/18c5297087ca01de85518e2b55078f444144aa1b", - "reference": "18c5297087ca01de85518e2b55078f444144aa1b", + "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/aa7a73c74b8d8c0f622f5982ff7b0351bc29e495", + "reference": "aa7a73c74b8d8c0f622f5982ff7b0351bc29e495", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.3", + "react/event-loop": "^1.2", + "react/promise": "^3.0 || ^2.7.0 || ^1.2.1" }, - "suggest": { - "ext-event": "~1.0", - "ext-libev": "*", - "ext-libevent": ">=0.1.0" + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "React\\EventLoop\\": "" + "React\\Promise\\Timer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Event loop abstraction layer that libraries can use for evented I/O.", + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", + "homepage": "https://github.com/reactphp/promise-timer", "keywords": [ - "event-loop" + "async", + "event-loop", + "promise", + "reactphp", + "timeout", + "timer" + ], + "support": { + "issues": "https://github.com/reactphp/promise-timer/issues", + "source": "https://github.com/reactphp/promise-timer/tree/v1.9.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } ], - "time": "2014-02-26 17:36:58" + "time": "2022-06-13T13:41:03+00:00" }, { "name": "react/socket", - "version": "v0.4.2", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "a6acf405ca53fc6cfbfe7c77778ededff46aa7cc" + "reference": "f474156aaab4f09041144fa8b57c7d70aed32a1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/a6acf405ca53fc6cfbfe7c77778ededff46aa7cc", - "reference": "a6acf405ca53fc6cfbfe7c77778ededff46aa7cc", + "url": "https://api.github.com/repos/reactphp/socket/zipball/f474156aaab4f09041144fa8b57c7d70aed32a1c", + "reference": "f474156aaab4f09041144fa8b57c7d70aed32a1c", "shasum": "" }, "require": { - "evenement/evenement": "~2.0", - "php": ">=5.4.0", - "react/event-loop": "0.4.*", - "react/stream": "0.4.*" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.8", + "react/event-loop": "^1.2", + "react/promise": "^2.6.0 || ^1.2.1", + "react/promise-timer": "^1.8", + "react/stream": "^1.2" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } + "require-dev": { + "clue/block-react": "^1.5", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", + "react/promise-stream": "^1.2" }, + "type": "library", "autoload": { "psr-4": { "React\\Socket\\": "src" @@ -553,55 +1010,133 @@ "license": [ "MIT" ], - "description": "Library for building an evented socket server.", + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", "keywords": [ - "Socket" + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.11.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } ], - "time": "2014-05-25 17:02:16" + "time": "2022-01-14T10:14:32+00:00" }, { "name": "react/stream", - "version": "v0.4.1", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/reactphp/stream.git", - "reference": "9db28e85a6fe7b57fad5e8c036f3434bcb8c8f60" + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/9db28e85a6fe7b57fad5e8c036f3434bcb8c8f60", - "reference": "9db28e85a6fe7b57fad5e8c036f3434bcb8c8f60", + "url": "https://api.github.com/repos/reactphp/stream/zipball/7a423506ee1903e89f1e08ec5f0ed430ff784ae9", + "reference": "7a423506ee1903e89f1e08ec5f0ed430ff784ae9", "shasum": "" }, "require": { - "evenement/evenement": "~2.0", - "php": ">=5.4.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" }, - "suggest": { - "react/event-loop": "0.4.*", - "react/promise": "~2.0" + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, "autoload": { "psr-4": { - "React\\Stream\\": "" + "React\\Stream\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Basic readable and writable stream interfaces that support piping.", + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", "keywords": [ + "event-driven", + "io", + "non-blocking", "pipe", - "stream" + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + }, + { + "url": "https://github.com/clue", + "type": "github" + } ], - "time": "2014-03-30 17:19:02" + "time": "2021-07-11T12:37:55+00:00" }, { "name": "silex/silex", @@ -685,44 +1220,51 @@ "keywords": [ "microframework" ], - "time": "2014-06-06 05:48:07" + "support": { + "issues": "https://github.com/silexphp/Silex/issues", + "source": "https://github.com/silexphp/Silex/tree/1.0" + }, + "abandoned": "symfony/flex", + "time": "2014-06-06T05:48:07+00:00" }, { "name": "symfony/debug", - "version": "v2.5.0", - "target-dir": "Symfony/Component/Debug", + "version": "v2.8.52", "source": { "type": "git", - "url": "https://github.com/symfony/Debug.git", - "reference": "7fd8006e4604ef99c95050ca2b5c7c5b41f5c704" + "url": "https://github.com/symfony/debug.git", + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Debug/zipball/7fd8006e4604ef99c95050ca2b5c7c5b41f5c704", - "reference": "7fd8006e4604ef99c95050ca2b5c7c5b41f5c704", + "url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9", + "psr/log": "~1.0" }, - "require-dev": { - "symfony/http-foundation": "~2.1", - "symfony/http-kernel": "~2.1" + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, - "suggest": { - "symfony/http-foundation": "", - "symfony/http-kernel": "" + "require-dev": { + "symfony/class-loader": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.8-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\Debug\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -731,39 +1273,41 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Debug Component", - "homepage": "http://symfony.com", - "time": "2014-05-25 14:44:21" + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/v2.8.50" + }, + "abandoned": "symfony/error-handler", + "time": "2018-11-11T11:18:13+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.3.16", + "version": "v2.3.42", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "cb7cd38c081507d10997553c4c522956a4d2afab" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "fd6d162d97bf3e6060622e5c015af39ca72e33bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/cb7cd38c081507d10997553c4c522956a4d2afab", - "reference": "cb7cd38c081507d10997553c4c522956a4d2afab", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/fd6d162d97bf3e6060622e5c015af39ca72e33bc", + "reference": "fd6d162d97bf3e6060622e5c015af39ca72e33bc", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "symfony/dependency-injection": "~2.0" + "symfony/dependency-injection": "~2.0,>=2.0.5" }, "suggest": { "symfony/dependency-injection": "", @@ -778,7 +1322,10 @@ "autoload": { "psr-0": { "Symfony\\Component\\EventDispatcher\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -787,36 +1334,38 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony EventDispatcher Component", - "homepage": "http://symfony.com", - "time": "2014-04-16 10:30:19" + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/2.3" + }, + "time": "2016-04-04T09:22:54+00:00" }, { "name": "symfony/http-foundation", - "version": "v2.3.16", + "version": "v2.3.42", "target-dir": "Symfony/Component/HttpFoundation", "source": { "type": "git", - "url": "https://github.com/symfony/HttpFoundation.git", - "reference": "ad7891d4dfe221c5a9edca64b71bdb500f5b026a" + "url": "https://github.com/symfony/http-foundation.git", + "reference": "9f4dbb1f3e3cad22d9462e0306c9c71212458f61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/ad7891d4dfe221c5a9edca64b71bdb500f5b026a", - "reference": "ad7891d4dfe221c5a9edca64b71bdb500f5b026a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9f4dbb1f3e3cad22d9462e0306c9c71212458f61", + "reference": "9f4dbb1f3e3cad22d9462e0306c9c71212458f61", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/polyfill-mbstring": "~1.1" }, "type": "library", "extra": { @@ -830,6 +1379,9 @@ }, "classmap": [ "Symfony/Component/HttpFoundation/Resources/stubs" + ], + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -839,51 +1391,54 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony HttpFoundation Component", - "homepage": "http://symfony.com", - "time": "2014-05-22 16:20:26" + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/2.3" + }, + "time": "2016-05-13T15:22:39+00:00" }, { "name": "symfony/http-kernel", - "version": "v2.3.16", + "version": "v2.3.42", "target-dir": "Symfony/Component/HttpKernel", "source": { "type": "git", - "url": "https://github.com/symfony/HttpKernel.git", - "reference": "d8c00747f592183692afaacf622c444c36092613" + "url": "https://github.com/symfony/http-kernel.git", + "reference": "57e0329236e8edf2b0e683043c604f7c9aba9398" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/d8c00747f592183692afaacf622c444c36092613", - "reference": "d8c00747f592183692afaacf622c444c36092613", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/57e0329236e8edf2b0e683043c604f7c9aba9398", + "reference": "57e0329236e8edf2b0e683043c604f7c9aba9398", "shasum": "" }, "require": { "php": ">=5.3.3", "psr/log": "~1.0", - "symfony/debug": "~2.3", + "symfony/debug": "~2.3.24|~2.5.9|~2.6,>=2.6.2", "symfony/event-dispatcher": "~2.1", - "symfony/http-foundation": "~2.2" + "symfony/http-foundation": "~2.3,>=2.3.4" }, "require-dev": { - "symfony/browser-kit": "~2.2", + "symfony/browser-kit": "~2.3", "symfony/class-loader": "~2.1", - "symfony/config": "~2.0", + "symfony/config": "~2.0,>=2.0.5", "symfony/console": "~2.2", - "symfony/dependency-injection": "~2.0", - "symfony/finder": "~2.0", - "symfony/process": "~2.0", + "symfony/css-selector": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.2", + "symfony/dom-crawler": "~2.0,>=2.0.5", + "symfony/finder": "~2.0,>=2.0.5", + "symfony/process": "~2.0,>=2.0.5", "symfony/routing": "~2.2", - "symfony/stopwatch": "~2.2", + "symfony/stopwatch": "~2.3", "symfony/templating": "~2.2" }, "suggest": { @@ -903,7 +1458,10 @@ "autoload": { "psr-0": { "Symfony\\Component\\HttpKernel\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -912,32 +1470,116 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony HttpKernel Component", - "homepage": "http://symfony.com", - "time": "2014-05-31 02:04:21" + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/2.3" + }, + "time": "2016-05-30T08:41:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.26.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.26-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/routing", - "version": "v2.3.16", + "version": "v2.3.42", "target-dir": "Symfony/Component/Routing", "source": { "type": "git", - "url": "https://github.com/symfony/Routing.git", - "reference": "6e4c9024a04340b83e456a1a24597dba066dcdc9" + "url": "https://github.com/symfony/routing.git", + "reference": "5b8a2bb7569df81401171829498809e90d6e446c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/6e4c9024a04340b83e456a1a24597dba066dcdc9", - "reference": "6e4c9024a04340b83e456a1a24597dba066dcdc9", + "url": "https://api.github.com/repos/symfony/routing/zipball/5b8a2bb7569df81401171829498809e90d6e446c", + "reference": "5b8a2bb7569df81401171829498809e90d6e446c", "shasum": "" }, "require": { @@ -947,7 +1589,8 @@ "doctrine/common": "~2.2", "psr/log": "~1.0", "symfony/config": "~2.2", - "symfony/yaml": "~2.0" + "symfony/http-foundation": "~2.3", + "symfony/yaml": "~2.0,>=2.0.5" }, "suggest": { "doctrine/common": "", @@ -963,7 +1606,10 @@ "autoload": { "psr-0": { "Symfony\\Component\\Routing\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -972,18 +1618,19 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" }, { "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Routing Component", - "homepage": "http://symfony.com", - "time": "2014-04-23 13:35:47" + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/routing/tree/2.3" + }, + "time": "2016-05-29T10:13:06+00:00" }, { "name": "tavendo/autobahnjs", @@ -993,21 +1640,20 @@ "url": "https://github.com/tavendo/AutobahnJS.git", "reference": "v0.6.0" }, - "type": "library", - "time": "2012-03-21 17:30:31" + "type": "library" }, { "name": "twig/twig", "version": "v1.10.3", "source": { "type": "git", - "url": "git://github.com/fabpot/Twig.git", - "reference": "v1.10.3" + "url": "https://github.com/twigphp/Twig.git", + "reference": "79671473d25ef8cad60e840ecc7eb29bbc6dab7e" }, "dist": { "type": "zip", - "url": "https://github.com/fabpot/Twig/zipball/v1.10.3", - "reference": "v1.10.3", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/79671473d25ef8cad60e840ecc7eb29bbc6dab7e", + "reference": "79671473d25ef8cad60e840ecc7eb29bbc6dab7e", "shasum": "" }, "require": { @@ -1024,6 +1670,7 @@ "Twig_": "lib/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3" ], @@ -1042,15 +1689,15 @@ "keywords": [ "templating" ], - "time": "2012-10-19 03:45:49" + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v1.10.3" + }, + "time": "2012-10-19T10:45:49+00:00" } ], - "packages-dev": [ - - ], - "aliases": [ - - ], + "packages-dev": [], + "aliases": [], "minimum-stability": "stable", "stability-flags": { "silex/silex": 20, @@ -1058,10 +1705,11 @@ "tavendo/autobahnjs": 20, "gimite/web-socket-js": 20 }, + "prefer-stable": false, + "prefer-lowest": false, "platform": { "php": ">=5.4.0" }, - "platform-dev": [ - - ] + "platform-dev": [], + "plugin-api-version": "2.1.0" } diff --git a/docker-compose.yml b/docker-compose.yml index bdd1a4d6..cd4fdfbf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,23 +6,31 @@ services: context: ./docker dockerfile: Dockerfile-nginx ports: - - "8080:80" + - "80:80" networks: - ratchet volumes: - ./web/:/var/www/html/ - - ./vendor:/var/www/vendor/ - ./logs/nginx:/var/log/nginx/ php: - image: php:fpm-alpine + image: php:7.4-fpm-alpine networks: - ratchet volumes: - ./web/:/var/www/html/ - ./vendor:/var/www/vendor/ + - ./views:/var/www/views/ + - ./src:/var/www/src/ - ./logs/fpm:/var/log/fpm-php.www.log + chat: + build: + context: ./ + dockerfile: docker/Dockerfile-chat + networks: + - ratchet + restart: on-failure networks: ratchet: diff --git a/Dockerfile b/docker/Dockerfile-chat similarity index 96% rename from Dockerfile rename to docker/Dockerfile-chat index f445882a..ba0e58ec 100644 --- a/Dockerfile +++ b/docker/Dockerfile-chat @@ -11,8 +11,6 @@ RUN chmod +x composer.phar COPY bin bin COPY src src -#COPY views views -#COPY web web COPY composer.json ./ COPY composer.lock ./ RUN ./composer.phar install --ansi --no-interaction --prefer-dist -o --no-scripts --no-plugins diff --git a/docker/nginx-localhost.conf b/docker/nginx-localhost.conf index efcab7da..7c28a19a 100644 --- a/docker/nginx-localhost.conf +++ b/docker/nginx-localhost.conf @@ -1,9 +1,30 @@ +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +upstream websocket { + server chat:8080; +} + server { listen 0.0.0.0:80; root /var/www/html; + + location /chat { + proxy_pass http://websocket; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host "localhost"; + } + + index index.php; + location / { - index index.php index.html; + try_files $uri $uri/ /index.php; } + location ~ \.php$ { include fastcgi_params; fastcgi_pass php:9000; diff --git a/src/Ratchet/Website/Chat/Bot.php b/src/Ratchet/Website/Chat/Bot.php index 852df6d5..70fe115e 100644 --- a/src/Ratchet/Website/Chat/Bot.php +++ b/src/Ratchet/Website/Chat/Bot.php @@ -3,7 +3,7 @@ use Ratchet\ConnectionInterface; use Ratchet\Wamp\WampServerInterface; use Ratchet\Wamp\WampConnection; -use Guzzle\Http\Message\Request; +use GuzzleHttp\Psr7\ServerRequest as Request; class Bot implements WampServerInterface { protected $app; @@ -24,8 +24,7 @@ public function __construct(WampServerInterface $app) { $this->wampBot->resourceId = -1; $this->wampBot->WebSocket = new \StdClass; - $this->wampBot->WebSocket->request = new Request('get', '/'); - $this->wampBot->WebSocket->request->addCookie('name', 'Lonely Bot'); + $this->wampBot->httpRequest = (new Request('get', '/'))->withHeader('cookie', 'name=Lonely Bot'); $this->wampBot->WAMP = new \StdClass; $this->wampBot->WAMP->sessionId = 1; diff --git a/src/Ratchet/Website/Chat/ChatRoom.php b/src/Ratchet/Website/Chat/ChatRoom.php index 9c98a2f3..b55dce80 100644 --- a/src/Ratchet/Website/Chat/ChatRoom.php +++ b/src/Ratchet/Website/Chat/ChatRoom.php @@ -23,8 +23,10 @@ public function onOpen(ConnectionInterface $conn) { $conn->Chat->rooms = array(); $conn->Chat->name = $conn->WAMP->sessionId; - if (isset($conn->WebSocket)) { - $conn->Chat->name = $this->escape($conn->WebSocket->request->getCookie('name')); + if (isset($conn->httpRequest)) { + $raw_cookie = $conn->httpRequest->getHeader('cookie')[0]; + parse_str(strtr($raw_cookie, array('&' => '%26', '+' => '%2B', ';' => '&')), $cookies); + $conn->Chat->name = $cookies['name']; if (empty($conn->Chat->name)) { $conn->Chat->name = 'Anonymous ' . $conn->resourceId; diff --git a/views/demo.html.twig b/views/demo.html.twig index 3da3dc3e..4a009a85 100644 --- a/views/demo.html.twig +++ b/views/demo.html.twig @@ -18,8 +18,8 @@ - - + + {% endblock %} {% block body %} diff --git a/views/layout.html.twig b/views/layout.html.twig index cbfbd959..b68e125d 100644 --- a/views/layout.html.twig +++ b/views/layout.html.twig @@ -19,7 +19,7 @@ - + diff --git a/web/chat/chat.css b/web/app/chat.css similarity index 100% rename from web/chat/chat.css rename to web/app/chat.css diff --git a/web/chat/chat.js b/web/app/chat.js similarity index 100% rename from web/chat/chat.js rename to web/app/chat.js diff --git a/web/chat/transport.js b/web/app/transport.js similarity index 99% rename from web/chat/transport.js rename to web/app/transport.js index 7befb479..c8907e37 100644 --- a/web/chat/transport.js +++ b/web/app/transport.js @@ -158,4 +158,4 @@ ChatRoom = function(optDebug) { ); return api; -}; \ No newline at end of file +};