PHP Conference Japan 2024

EventConfig::requireFeatures

(PECL event >= 1.2.6-beta)

EventConfig::requireFeatures輸入應用程式所需的事件方法功能

說明

public EventConfig::requireFeatures( int $feature ): bool

輸入應用程式所需的事件方法功能

參數

feature

所需功能的位元遮罩。請參閱 EventConfig::FEATURE_* 常數

傳回值

成功時返回 true,失敗時返回 false

範例

範例 #1 EventConfig::requireFeatures() 範例

<?php
$cfg
= new EventConfig();

// 建立與配置相關聯的 event_base
$base = new EventBase($cfg);

// 要求 FDS 功能
if ($cfg->requireFeatures(EventConfig::FEATURE_FDS)) {
echo
"現在需要 FDS 功能\n";

$base = new EventBase($cfg);
(
$base->getFeatures() & EventConfig::FEATURE_FDS)
and print
"FDS - 任意檔案描述符類型,而不僅僅是 sockets\n";
}
?>

以上範例將輸出類似以下的內容

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

另請參閱

新增註釋

使用者貢獻的註釋

此頁面沒有使用者貢獻的註釋。
To Top