EventConfig::requireFeatures

Enters a required event method feature that the application demands

説明

public bool EventConfig::requireFeatures( int $feature )

Enters a required event method feature that the application demands

パラメータ

feature

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

戻り値

成功した場合に true を、失敗した場合に false を返します。

例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 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

参考

  • EventBase::getFeatures