EventConfig::requireFeatures

EventConfig::requireFeatures

(PECL event >= 1.2.6-beta)

EventConfig::requireFeaturesEnters a required event method feature that the application demands

Description

public bool EventConfig::requireFeatures (  int $feature  )

Enters a required event method feature that the application demands

Parameters

feature

Bitmask of required features. See EventConfig::FEATURE_* constants

Return Values

Examples

Example #1 EventConfig::requireFeatures() example

<?php
$cfg = new EventConfig();

// Create event_base associated with the config
$base = new EventBase($cfg);

// Require FDS feature
if ($cfg->requireFeatures(EventConfig::FEATURE_FDS)) {
    echo "FDS feature is now requried\n";

    $base = new EventBase($cfg);
    ($base->getFeatures() & EventConfig::FEATURE_FDS)
        and print("FDS - arbitrary file descriptor types, and not just sockets\n");
}
?>

The above example will output something similar to:

FDS feature is now requried
FDS - arbitrary file descriptor types, and not just sockets

See Also

© 1997–2017 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://secure.php.net/manual/en/eventconfig.requirefeatures.php

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部