Source

pecl-event / examples / misc.php

Diff from to

File examples/misc.php

 
 echo "Features:\n";
 $features = $base->getFeatures();
-($features & EVENT_FEATURE_ET) and print("ET - edge-triggered IO\n");
-($features & EVENT_FEATURE_O1) and print("O1 - O(1) operation for adding/deletting events\n");
-($features & EVENT_FEATURE_FDS) and print("FDS - arbitrary file descriptor types, and not just sockets\n");
+($features & EventConfig::FEATURE_ET) and print("ET - edge-triggered IO\n");
+($features & EventConfig::FEATURE_O1) and print("O1 - O(1) operation for adding/deletting events\n");
+($features & EventConfig::FEATURE_FDS) and print("FDS - arbitrary file descriptor types, and not just sockets\n");
 
 // Require FDS feature
-if ($cfg->requireFeatures(EVENT_FEATURE_FDS)) {
+if ($cfg->requireFeatures(EventConfig::FEATURE_FDS)) {
 	echo "FDS feature is now requried\n";
 
 	$base = new EventBase($cfg);
-	($base->getFeatures() & EVENT_FEATURE_FDS)
+	($base->getFeatures() & EventConfig::FEATURE_FDS)
 		and print("FDS - arbitrary file descriptor types, and not just sockets\n");
 }
 /* }}} */
 
 /* {{{ Base */
 $base = new EventBase();
-$event = new Event($base, STDIN, EVENT_READ | EVENT_PERSIST, function ($fd, $events, $arg) {
+$event = new Event($base, STDIN, Event::READ | Event::PERSIST, function ($fd, $events, $arg) {
 	static $max_iterations = 0;
 
     if (++$max_iterations >= 5) {