Closed halfik closed 3 years ago
You should not import any params from globals!
Comet works as stay-in-memory process and there no any guranties that $GLOBALS array contains any HTTP request data or changes with each new request.
Please-please do not assume that globals in Comet are working the same way as in typical PHP app within standard web-server.
I do not use globals. I was checking something and found this issue. Also if you don't want people to use this method, why it is there in first place?
I've disaled fromGlobals() method for Comet\Request objects at all. Thanks for getting my attention to the problem!
When we try to build request from globals:
Request::fromGlobals();
We are going to get few errors: /var/www/html/vendor/gotzmann/comet/src/Request.php:176 >> Class 'Comet\ServerRequest' not found
It seems this imports are missing:
use GuzzleHttp\Psr7\Uri; use GuzzleHttp\Stream\CachingStream; use GuzzleHttp\Stream\LazyOpenStream; use GuzzleHttp\Psr7\ServerRequest;