pecl-event / examples / misc.php

Diff from to

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) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.