Event EventConfig::requireFeatures

(PECL event >= 1.2.6-beta)

EventConfig::requireFeatures — 애플리케이션이 요구하는 필수 이벤트 메소드 기능을 입력합니다.


설명

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

애플리케이션이 요구하는 필수 이벤트 메소드 기능을 입력합니다.


매개변수

feature
필수 기능의 비트마스크. EventConfig::FEATURE_* constants 참조

반환 값

성공하면 true를, 실패하면 false를 반환합니다.


Examples

예제 #1 EventConfig::requireFeatures() 예제

                  
<?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");
}
?>
                  
                

위의 예는 다음과 유사한 결과를 출력합니다.

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

기타