PHP Australia Conference 2015

EventConfig::requireFeatures

(PECL event >= 1.2.6-beta)

EventConfig::requireFeaturesEnters a required event method feature that the application demands

Descrição

public bool EventConfig::requireFeatures ( int $feature )

Enters a required event method feature that the application demands

Parâmetros

feature

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

Valor Retornado

Exemplos

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 requried\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 irá imprimir algo similar à:

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

Veja Também

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top