Init Repo

This commit is contained in:
root
2019-09-06 23:53:10 +08:00
commit f0ef89dfbb
7905 changed files with 914138 additions and 0 deletions

15
vendor/swoole/examples/event/inotify.php vendored Executable file
View File

@ -0,0 +1,15 @@
<?php
//创建一个inotify句柄
$fd = inotify_init();
//监听文件仅监听修改操作如果想要监听所有事件可以使用IN_ALL_EVENTS
$watch_descriptor = inotify_add_watch($fd, __DIR__.'/inotify.data', IN_MODIFY);
swoole_event_add($fd, function ($fd) {
$events = inotify_read($fd);
if ($events) {
foreach ($events as $event) {
echo "inotify Event :" . var_export($event, 1) . "\n";
}
}
});