Skip to content

Commit

Permalink
Merge pull request #62 from reactphp/no7-libevent
Browse files Browse the repository at this point in the history
Discourage libevent on PHP 7
  • Loading branch information
WyriHaximus authored Oct 13, 2017
2 parents ed4b051 + f1c4746 commit f0117e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ class Factory
public static function create()
{
// @codeCoverageIgnoreStart
if (function_exists('event_base_new')) {
return new LibEventLoop();
} elseif (class_exists('libev\EventLoop', false)) {
if (class_exists('libev\EventLoop', false)) {
return new LibEvLoop;
} elseif (class_exists('EventBase', false)) {
return new ExtEventLoop;
} elseif (function_exists('event_base_new') && PHP_VERSION_ID < 70000) {
// only use ext-libevent on PHP < 7 for now
return new LibEventLoop();
}

return new StreamSelectLoop();
Expand Down

0 comments on commit f0117e4

Please sign in to comment.