-
-
Notifications
You must be signed in to change notification settings - Fork 132
Discourage libevent on PHP 7 #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,10 @@ class LibEventLoop implements LoopInterface | |
|
||
public function __construct() | ||
{ | ||
if (version_compare(PHP_VERSION, '7.0.0') >= 0) { | ||
trigger_error('The libevent extension has not yet been updated for PHP 7, it is recommended you use a different loop', E_USER_WARNING); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a big fan of this tbqh 👎 With the above check in place we do not automatically create the This means that if this constructor is invoked, it's explicitly been called. IMHO this is already advanced usage and we should not trigger a warning in this case. Otherwise, how could a user possibly ignore this warning? Using Also, what happens when the extension will be updated to support PHP 7 again? We can't really detect this until we provide an update, in which case the above warning would be superfluous. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the user has upgraded to PHP7 and somehow kept the extension installed, from the reports I've received, it's going to segfault. The trigger_error only issues a warning, the object will still be instantiated an be able to be used.
It looks like that extension isn't going to be...but if it does we'll have to quickly update this to support it. Even if this happens the compare only issues a warning. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the consensus is still a 👎 on this I'm good to remove this check in order to get the updated Factory order into the next release. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we had a consensus here, it was basically just my point of view :-) But if this error is removed, I'm all for getting this in! 👍 |
||
|
||
$this->eventBase = event_base_new(); | ||
$this->futureTickQueue = new FutureTickQueue(); | ||
$this->timerEvents = new SplObjectStorage(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense to lower priority here and do not pick this extension on PHP 7+ at all 👍