(PECL event >= 1.2.6-beta)
EventConfig::requireFeatures — Enters a required event method feature that the application demands
Enters a required event method feature that the application demands
feature
Bitmask of required features. See
EventConfig::FEATURE_*
constants
Retorna true
em caso de sucesso ou false
em caso de falha.
Exemplo #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";
}
?>
O exemplo acima produzirá algo semelhante a:
FDS feature is now required FDS - arbitrary file descriptor types, and not just sockets