(PECL event >= 1.2.6-beta)
EventConfig::requireFeatures — 输入应用程序要求的必需 event 方法功能
feature
所需功能的位掩码。参考
EventConfig::FEATURE_*
常量
示例 #1 EventConfig::requireFeatures() 示例
<?php
$cfg = new EventConfig();
// 创建跟 config 关联的 event_base
$base = new EventBase($cfg);
// 需要 FDS 功能
if ($cfg->requireFeatures(EventConfig::FEATURE_FDS)) {
echo "FDS feature is now required\n";
$base = new EventBase($cfg);
($base->getFeatures() & EventConfig::FEATURE_FDS)
and print "FDS - arbitrary file descriptor types, and not just sockets\n";
}
?>
以上示例的输出类似于:
FDS feature is now required FDS - arbitrary file descriptor types, and not just sockets