reactphp-legacy / whois

Whois client based on ReactPHP.
MIT License
71 stars 15 forks source link

Please update the require dependencies #14

Closed harikt closed 7 years ago

harikt commented 7 years ago

Hi,

I was trying the example : https://github.com/reactphp/whois/blob/master/examples/query.php after installing react/whois

php example.php
PHP Fatal error:  Uncaught Error: Class 'React\EventLoop\Factory' not found in /home/hari/experiments/php/whois/example.php:5
Stack trace:
#0 {main}
  thrown in /home/hari/experiments/php/whois/example.php on line 5

Fatal error: Uncaught Error: Class 'React\EventLoop\Factory' not found in /home/hari/experiments/php/whois/example.php:5
Stack trace:
#0 {main}
  thrown in /home/hari/experiments/php/whois/example.php on line 5

After trying to install react/event-loop it looks dependencies cannot be resolved.

 ✘  ~/experiments/php/whois  composer require react/event-loop
Using version ^0.4.2 for react/event-loop
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - react/socket v0.3.4 requires react/event-loop 0.3.* -> satisfiable by react/event-loop[0.3.x-dev, v0.3.0, v0.3.3, v0.3.4, v0.3.5] but these conflict with your requirements or minimum-stability.
    - react/socket v0.3.4 requires react/event-loop 0.3.* -> satisfiable by react/event-loop[0.3.x-dev, v0.3.0, v0.3.3, v0.3.4, v0.3.5] but these conflict with your requirements or minimum-stability.
    - react/socket v0.3.4 requires react/event-loop 0.3.* -> satisfiable by react/event-loop[0.3.x-dev, v0.3.0, v0.3.3, v0.3.4, v0.3.5] but these conflict with your requirements or minimum-stability.
    - Installation request for react/socket (locked at v0.3.4) -> satisfiable by react/socket[v0.3.4].

Installation failed, reverting ./composer.json to its original content.
jsor commented 7 years ago

Have you tried a composer install before running the examples? This should install all dependencies including react/event-loop.

harikt commented 7 years ago

@jsor Hm... Interesting. That was actually an error in my part. The query.php was using '../' , but I was trying something like below.

mkdir dns
cd dns
composer require react/whois
wget https://raw.githubusercontent.com/reactphp/whois/master/examples/query.php
php query.php

Closing for this is resolved. Sorry for the hassle.

harikt commented 7 years ago

Interestingly there is a loop going on

Warning: stream_select(): No stream arrays were passed in /home/hari/experiments/php/dns/vendor/react/event-loop/React/EventLoop/StreamSelectLoop.php on line 141
PHP Warning:  stream_select(): supplied argument is not a valid stream resource in /home/hari/experiments/php/dns/vendor/react/event-loop/React/EventLoop/StreamSelectLoop.php on line 141

Warning: stream_select(): supplied argument is not a valid stream resource in /home/hari/experiments/php/dns/vendor/react/event-loop/React/EventLoop/StreamSelectLoop.php on line 141
PHP Warning:  stream_select(): supplied argument is not a valid stream resource in /home/hari/experiments/php/dns/vendor/react/event-loop/React/EventLoop/StreamSelectLoop.php on line 141

Any idea about it ?

jsor commented 7 years ago

This is probably better suited for an issue over at reactphp/event-loop. Be sure to include more context, ideally a reproducible test case.

clue commented 7 years ago

The whois component hasn't been updated in a while. It actually uses the React\Socket\Connection class (https://github.com/reactphp/whois/blob/master/src/React/Whois/ConnectionFactory.php#L20) which is actually not supported (https://github.com/reactphp/socket/pull/13) and may result in the above error.

I guess this component could use an update :+1: